Get current document using java code

What is the conversion of this code in java? Is this possible?

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc=ws.CurrentDocument

Call uidoc.FieldSetText(“TestField1”)

Subject: Get current document using java code

Found this in the Designer help.

Session session = getSession();

AgentContext agentContext = session.getAgentContext();

// (Your code goes here)

Document doc = agentContext.getDocumentContext();

Thanks!

Subject: Get current document using java code

There is no equivalent since there is no access to the Notes UI in the Java classes.