com.ibm.notes.java.ui.documents
Interface NotesUIDocument

All Superinterfaces:
IAdaptable, NotesUIElement

public interface NotesUIDocument
extends NotesUIElement

Represents the document that's currently open in the Notes workspace.

Restriction:
This interface is not intended to be implemented by clients.

Method Summary
 void addEditListener(Listener listener)
          Add a listener to be notified when the user toggles edit mode.
 void addFieldListener(DocumentFieldListener listener)
          Add a listener to be notified after the user has switched field focus.
 void addModifiedListener(Listener listener)
          Add a listener to be notified if the document has be been saved.
 void clearSelectedText()
          Deletes the current selection from a document.
 void copy()
          Copies the current selection in a document to the Clipboard.
 void cut()
          Cuts the current selection from a document and places it on the Clipboard.
 void deselectAll()
          Deselects any selections in a document.
 NotesBEDocument getBEDocument()
          Return the back-end document that corresponds to the currently open document.
 NotesUIField getCurrentField()
          Return the field that the cursor is in.
 NotesDatabaseData getDatabaseData()
          Gets the database data for the database containing this document.
 NotesDocumentData getDocumentData()
          Gets the document data for this document.
 NotesUIField getField(String name)
          Get the field from the document.
 NotesUIField[] getFields()
          Return all of the fields within the document.
 String getForm()
          Get the name of the document's form.
 String getSelectedText()
          Gets the text that is highlighted in the UI.
 void gotoNextField()
          Places the cursor in the next field on a document.
 void gotoPreviousField()
          Places the cursor in the previous field on a document.
 void insertHtml(String html)
          Inserts HMTL at the cursor.
 void insertText(String text)
          Inserts text at the cursor.
 boolean isEditable()
          Indicates whether the document can be placed in edit mode.
 boolean isEditMode()
          Indicates whether a document is in edit mode.
 boolean isInPreviewPane()
          Indicates whether the document is being accessed from the preview pane.
 boolean isNewDoc()
          Indicates whether a document is new.
 void paste()
          Pastes the contents of the Clipboard at the current cursor position on a document.
 void print()
          Sends the document to the printer.
 void refresh()
          Refreshes a document.
 void refreshHideFormulas()
          Recalculates the hide-when formulas on the current document's form.
 void reload()
          Refreshes the current document with any changes that have been made to the corresponding back-end document.
 void removeEditListener(Listener listener)
          Remove the given listener set to listen for the edit event.
 void removeFieldListener(DocumentFieldListener listener)
          Remove the given listener set to receive field events.
 void removeModifiedListener(Listener listener)
          Remove the given listener set to listen for the modified event.
 void save()
          Saves the document.
 void selectAll()
          If the document is in edit mode, selects the entire contents of the current field.
 void setEditMode(boolean edit)
          Set whether or not the document should be in edit mode.
 
Methods inherited from interface com.ibm.notes.java.ui.NotesUIElement
activate, addCloseListener, close, getTitle, getUrl, getWindow, removeCloseListener
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Method Detail

getBEDocument

NotesBEDocument getBEDocument()
Return the back-end document that corresponds to the currently open document.

Returns:
the back-end document
Since:
8.5.1

getCurrentField

NotesUIField getCurrentField()
Return the field that the cursor is in. This property is valid only when the document is in Edit mode. If the document is in Read mode, this method returns null.

Returns:
the field that the cursor is in
Since:
8.5.1

getFields

NotesUIField[] getFields()
Return all of the fields within the document.

Returns:
document fields
Since:
8.5.1

getField

NotesUIField getField(String name)
Get the field from the document.

Parameters:
name - name of the field
Returns:
the field denoted by the given name
Since:
8.5.1

gotoNextField

void gotoNextField()
Places the cursor in the next field on a document. The next field is the one below and to the right of the current field. This method is valid only when the document is in edit mode.

Since:
8.5.1

gotoPreviousField

void gotoPreviousField()
Places the cursor in the previous field on a document. The previous field is the one above and to the left of the current field. This method is valid only when the document is in edit mode.

Since:
8.5.1

isNewDoc

boolean isNewDoc()
Indicates whether a document is new. A new document is one that hasn't been saved.

Returns:
true indicates that the document is new, and hasn't been saved, false indicates that the document is not new, and has been saved
Since:
8.5.1

isEditable

boolean isEditable()
Indicates whether the document can be placed in edit mode.

Returns:
true if the document is or can be put into edit mode, false if the document is not or cannot be but into edit mode
Since:
8.5.1

isEditMode

boolean isEditMode()
Indicates whether a document is in edit mode.

Returns:
true if the document is in edit mode, false if the document is not in edit mode
Since:
8.5.1

setEditMode

void setEditMode(boolean edit)
Set whether or not the document should be in edit mode.

Parameters:
edit - true to put the document in edit more, false to put it in read-only mode
Since:
8.5.1

isInPreviewPane

boolean isInPreviewPane()
Indicates whether the document is being accessed from the preview pane.

Returns:
true indicates that the document is being accessed from the preview pane, false indicates that the document was opened by the user
Since:
8.5.1

clearSelectedText

void clearSelectedText()
Deletes the current selection from a document. The current selection can be anything in an editable field, such as text or graphics. This method is valid only when the document is in Edit mode.

Since:
8.5.1

copy

void copy()
Copies the current selection in a document to the Clipboard. The current selection can be anything on the document, such as text or graphics. This method is valid only when the document is in Edit mode.

Since:
8.5.1

cut

void cut()
Cuts the current selection from a document and places it on the Clipboard. The current selection can be anything in an editable field, such as text or graphics. This method is valid only when the document is in Edit mode.


paste

void paste()
Pastes the contents of the Clipboard at the current cursor position on a document. This method is valid only when the document is in Edit mode.


getSelectedText

String getSelectedText()
Gets the text that is highlighted in the UI. Gives an empty String if no text is selected.

Returns:
the currently selected text, or an empty string if nothing is selected

insertText

void insertText(String text)
Inserts text at the cursor. If there is a selection, it is replaced. If the user can place the document into edit mode, that is done and the text is inserted.

Parameters:
text - plain text to insert

insertHtml

void insertHtml(String html)
Inserts HMTL at the cursor. If there is a selection, it is replaced. If the user can place the document into edit mode, that is done and the HTML is inserted.

Parameters:
html - HTML to insert

print

void print()
Sends the document to the printer.


refresh

void refresh()
Refreshes a document. When you refresh a document, its computed fields are recalculated. This method is valid only when the document is in edit mode.


refreshHideFormulas

void refreshHideFormulas()
Recalculates the hide-when formulas on the current document's form. Use this method when you want to recalculate hide-when formulas without recalculating all the formulas on the current document's form. This method is an expensive operation, and may affect performance.


reload

void reload()
Refreshes the current document with any changes that have been made to the corresponding back-end document. Refreshing the current document updates its representation in memory, and visually on the workspace, to reflect the changes that have been made to the back-end document. This method is valid only when the document is in edit mode. Modifications made to rich text items on the back-end document will not appear on the current document until the current document is closed and reopened.


getForm

String getForm()
Get the name of the document's form. Note this method returns the actual form name, not the alias of the form.

Returns:
the form name

save

void save()
Saves the document. Valid only when the document is in edit mode.


selectAll

void selectAll()
If the document is in edit mode, selects the entire contents of the current field. If the document is in read mode, selects the entire contents of the document.


deselectAll

void deselectAll()
Deselects any selections in a document.


addEditListener

void addEditListener(Listener listener)
Add a listener to be notified when the user toggles edit mode.

Parameters:
listener - listener to be notified when the document is edited

removeEditListener

void removeEditListener(Listener listener)
Remove the given listener set to listen for the edit event.

Parameters:
listener - listener to remove

addModifiedListener

void addModifiedListener(Listener listener)
Add a listener to be notified if the document has be been saved.

Parameters:
listener - listener to be notified when the document is modified

removeModifiedListener

void removeModifiedListener(Listener listener)
Remove the given listener set to listen for the modified event.

Parameters:
listener - listener to remove

addFieldListener

void addFieldListener(DocumentFieldListener listener)
Add a listener to be notified after the user has switched field focus. This listener is valid only when the document is in Edit mode.

Parameters:
listener - listener to be notified about field events

removeFieldListener

void removeFieldListener(DocumentFieldListener listener)
Remove the given listener set to receive field events.

Parameters:
listener - listener to remove

getDocumentData

NotesDocumentData getDocumentData()
Gets the document data for this document.

Returns:
the document data for this document

getDatabaseData

NotesDatabaseData getDatabaseData()
Gets the database data for the database containing this document.

Returns:
the database data for the database containing this document