JIDE 3.5.15

com.jidesoft.document
Interface IDocumentPane

All Known Implementing Classes:
CodeEditorDocumentPane, DashboardDocumentPane, DocumentPane

public interface IDocumentPane

Interface of any document interface.


Field Summary
static int CLOSE_ACTION_TO_CLOSE
           
static int CLOSE_ACTION_TO_DOCK
           
static int FLOATING_CONTAINER_TYPE_DIALOG
           
static int FLOATING_CONTAINER_TYPE_FRAME
           
 
Method Summary
 void activateGroup(IDocumentGroup documentGroup)
          Activate the document group.
 void closeAll()
          Closes all documents.
 void closeAllButThis(String documentName)
          Closes all documents except the one specified as parameter.
 void closeDocument(String name)
          Removes the component that identified by name.
 void closeDocuments(FloatingDocumentContainer container)
          Closes all floating documents inside the floating container.
 void closeSingleDocument(String documentName)
          Closes a single document.
 void dispose()
          Dispose DocumentPane.
 void dockDocument(String documentName)
          Docks a floating document back that was floated before.
 void dockDocuments(FloatingDocumentContainer container)
          Docks all floating documents inside the floating container.
 void floatDocument(FloatingDocumentContainer floatingContainer, String documentName)
          Floating a document of the specified name into a specified floating container.
 void floatDocument(String documentName)
          Floating a document of the specified name.
 DocumentComponent getActiveDocument()
          Gets the active component.
 String getActiveDocumentName()
          Gets key of the active component.
 DocumentComponent getDocument(String name)
          Gets document whose name is name.
 DocumentComponent getDocumentAt(int index)
          Gets document at the specified index.
 int getDocumentCount()
          Return the total number of open documents.
 IDocumentGroup getDocumentGroup(String documentName)
          Gets the document group that contains the document with the specified document name.
 IDocumentGroup getDocumentGroupAt(int index)
          Gets document group at the specified index.
 int getDocumentGroupCount()
          Gets the number of document groups.
 String getDocumentNameAt(int index)
          Gets document at position specified in index.
 String[] getDocumentNames()
          Return an array of DocumentComponents.
 int getFloatingContainerCloseAction()
          Gets the action when the native close button is pressed on the floating container.
 List<FloatingDocumentContainer> getFloatingContainers()
          Gets the list of floating containers.
 int getFloatingContainerType()
          Gets the floating container type.
 LayoutPersistence getLayoutPersistence()
          Gets the layout persistence that can be used to persist the documents that are opened in document pane.
 String getNameOf(Component component)
          Gets name of document whose component is component.
 PopupMenuCustomizer getPopupMenuCustomizer()
          Gets the popup menu customizer.
 int getSelectedIndexAtGroupIndex(int index)
          Gets the selected document index in the document group at the specified index.
 StringConverter getTitleConverter()
          Gets the title converter that convert the title.
 int groupIndexOfDocument(String name)
          Gets group index of the document.
 int indexOfDocument(String name)
          Gets index of the document in it's group.
 boolean isDocumentFloating(String documentName)
          Checks if the document is floating.
 boolean isDocumentOpened(String name)
          Check if the document with the name is opened.
 boolean isGroupsAllowed()
          Is document group allowed in this document pane.
 boolean isHeavyweightComponentEnabled()
           
 boolean isReorderAllowed()
          Checks if document order is allowed to changed by user.
 void moveDocument(String name, int groupIndex)
          Move the document identified by name to a new group whose index is groupIndex.
 void moveDocument(String name, int groupIndex, int tabIndex)
          Move the document identified by name to a new group whose index is groupIndex.
 void newDocumentGroup(String name, int groupIndex, int orientation)
          New a document group and put the document with name to the new group.
 void nextDocument()
          Sets next document as active.
 void openDocument(DocumentComponent document)
          Inserts the component into this pane.
 void prevDocument()
          Sets previous document as active.
 void renameDocument(String oldName, String newName)
          Renames the document with the old name to the new name.
 void setActiveDocument(String documentName)
          Sets the tab that identified by name as active.
 void setActiveDocument(String documentName, boolean requestFocus)
          Sets the tab that identified by name as active.
 void setDocumentEnabled(String name, boolean enabled)
          Enables or disables the document that identified by name.
 void setFloatingContainerCloseAction(int action)
          Sets the action when the native close button is pressed on the floating container.
 void setFloatingContainerType(int floatingContainerType)
          Sets the floating container type.
 void setGroupsAllowed(boolean groupsAllowed)
          Sets if document group is allowed is this document pane.
 void setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
          Enables heavyweight component.
 void setOpenedDocuments(List<DocumentComponent> documentComponents)
          Sets the opened components.
 void setPopupMenuCustomizer(PopupMenuCustomizer customizer)
          Sets the popup customizer.
 void setReorderAllowed(boolean reorderAllowed)
          Sets if document order is allowed to be changed by user.
 void setTitleConverter(StringConverter titleConverter)
          Sets the title converter.
 void updateDocument(String documentName)
          Updates document title when user changes the title.
 

Field Detail

CLOSE_ACTION_TO_CLOSE

static final int CLOSE_ACTION_TO_CLOSE
See Also:
Constant Field Values

CLOSE_ACTION_TO_DOCK

static final int CLOSE_ACTION_TO_DOCK
See Also:
Constant Field Values

FLOATING_CONTAINER_TYPE_DIALOG

static final int FLOATING_CONTAINER_TYPE_DIALOG
Since:
3.3.7
See Also:
Constant Field Values

FLOATING_CONTAINER_TYPE_FRAME

static final int FLOATING_CONTAINER_TYPE_FRAME
Since:
3.3.7
See Also:
Constant Field Values
Method Detail

openDocument

void openDocument(DocumentComponent document)
Inserts the component into this pane.

Parameters:
document - document to be opened

closeDocument

void closeDocument(String name)
Removes the component that identified by name.

Parameters:
name - name

closeAll

void closeAll()
Closes all documents.


closeSingleDocument

void closeSingleDocument(String documentName)
Closes a single document. closeAll() and closeAllButThis(String) will eventually call this method to close each document. This method will call closeDocument(String) by default. However subclass can override this method to do additional logic.

You can refer to http://www.jidesoft.com/forum/viewtopic.php?p=10262#10262 to see the reason of adding this method.

Parameters:
documentName - the document name.

closeAllButThis

void closeAllButThis(String documentName)
Closes all documents except the one specified as parameter.

Parameters:
documentName - the document name.

setActiveDocument

void setActiveDocument(String documentName)
Sets the tab that identified by name as active.

Parameters:
documentName - the document name.

setActiveDocument

void setActiveDocument(String documentName,
                       boolean requestFocus)
Sets the tab that identified by name as active.

Parameters:
documentName - the document name.
requestFocus - true to request focus on the document. Otherwise false.

getActiveDocument

DocumentComponent getActiveDocument()
Gets the active component.

Returns:
active component

getActiveDocumentName

String getActiveDocumentName()
Gets key of the active component.

Returns:
key of the active component

nextDocument

void nextDocument()
Sets next document as active.


prevDocument

void prevDocument()
Sets previous document as active.


moveDocument

void moveDocument(String name,
                  int groupIndex)
Move the document identified by name to a new group whose index is groupIndex.

Parameters:
name - name of the document
groupIndex - index of dest group

moveDocument

void moveDocument(String name,
                  int groupIndex,
                  int tabIndex)
Move the document identified by name to a new group whose index is groupIndex.

Parameters:
name - name of the document
groupIndex - index of dest group
tabIndex - index of the dest tab

newDocumentGroup

void newDocumentGroup(String name,
                      int groupIndex,
                      int orientation)
New a document group and put the document with name to the new group.

Parameters:
name - name of the document
groupIndex - group index
orientation - HORIZONTAL or VERTICAL. It will be ignored if there are groups already.

getNameOf

String getNameOf(Component component)
Gets name of document whose component is component.

Parameters:
component - the component of the document.
Returns:
component with the specified name

getDocument

DocumentComponent getDocument(String name)
Gets document whose name is name.

Parameters:
name - name
Returns:
document

getDocumentAt

DocumentComponent getDocumentAt(int index)
Gets document at the specified index.

Parameters:
index - the index
Returns:
document

activateGroup

void activateGroup(IDocumentGroup documentGroup)
Activate the document group. Each document group can have its own selected document. But only the active group's selected document is active document.

Parameters:
documentGroup - documentGroup to be activated

getDocumentGroup

IDocumentGroup getDocumentGroup(String documentName)
Gets the document group that contains the document with the specified document name.

Parameters:
documentName - the document name.
Returns:
the document group that contains the document with the specified document name.

getTitleConverter

StringConverter getTitleConverter()
Gets the title converter that convert the title.

Returns:
title converter

setTitleConverter

void setTitleConverter(StringConverter titleConverter)
Sets the title converter.

Parameters:
titleConverter - the new title converter.

getPopupMenuCustomizer

PopupMenuCustomizer getPopupMenuCustomizer()
Gets the popup menu customizer.

Returns:
popup menu customizer

setPopupMenuCustomizer

void setPopupMenuCustomizer(PopupMenuCustomizer customizer)
Sets the popup customizer.

Parameters:
customizer - the popup menu customizer.

isGroupsAllowed

boolean isGroupsAllowed()
Is document group allowed in this document pane.

Returns:
true if group is allowed

setGroupsAllowed

void setGroupsAllowed(boolean groupsAllowed)
Sets if document group is allowed is this document pane.

Parameters:
groupsAllowed - true or false.

isReorderAllowed

boolean isReorderAllowed()
Checks if document order is allowed to changed by user.

Returns:
true if group is allowed

setReorderAllowed

void setReorderAllowed(boolean reorderAllowed)
Sets if document order is allowed to be changed by user.

Parameters:
reorderAllowed - true or false.

isDocumentOpened

boolean isDocumentOpened(String name)
Check if the document with the name is opened.

Parameters:
name - name of the document
Returns:
true if the document is opened

getDocumentCount

int getDocumentCount()
Return the total number of open documents.

Returns:
the total number of open documents.

getDocumentNameAt

String getDocumentNameAt(int index)
Gets document at position specified in index. The order is as the same as the order of when documents are opened.

Parameters:
index - document position
Returns:
name of document. Call getDocument(name) to get the DocumentComponent

getDocumentNames

String[] getDocumentNames()
Return an array of DocumentComponents. The order is as the same as the order of when documents are opened.

Returns:
an array of all documents

indexOfDocument

int indexOfDocument(String name)
Gets index of the document in it's group.

Parameters:
name - the name of the document.
Returns:
index

groupIndexOfDocument

int groupIndexOfDocument(String name)
Gets group index of the document.

Parameters:
name - the name of the document.
Returns:
the group index where the document is in.

updateDocument

void updateDocument(String documentName)
Updates document title when user changes the title. User should call this method since we don't know the title of a document is changed.

Parameters:
documentName - the document name.

renameDocument

void renameDocument(String oldName,
                    String newName)
Renames the document with the old name to the new name.

Parameters:
oldName - old name
newName - new name

getDocumentGroupCount

int getDocumentGroupCount()
Gets the number of document groups.

Returns:
the number of document groups.

getDocumentGroupAt

IDocumentGroup getDocumentGroupAt(int index)
Gets document group at the specified index.

Parameters:
index - the index.
Returns:
the document group.

floatDocument

void floatDocument(String documentName)
Floating a document of the specified name.

Parameters:
documentName - the document name.

floatDocument

void floatDocument(FloatingDocumentContainer floatingContainer,
                   String documentName)
Floating a document of the specified name into a specified floating container.

Parameters:
floatingContainer - the floating container.
documentName - the document name.

dockDocument

void dockDocument(String documentName)
Docks a floating document back that was floated before.

Parameters:
documentName - the name of document that is floating.

dockDocuments

void dockDocuments(FloatingDocumentContainer container)
Docks all floating documents inside the floating container.

Parameters:
container - the floating container.

closeDocuments

void closeDocuments(FloatingDocumentContainer container)
Closes all floating documents inside the floating container.

Parameters:
container - the floating container.

isDocumentFloating

boolean isDocumentFloating(String documentName)
Checks if the document is floating.

Parameters:
documentName - the name of the document
Returns:
true if the document is floating. Otherwise false.

getFloatingContainers

List<FloatingDocumentContainer> getFloatingContainers()
Gets the list of floating containers.

Returns:
the list of floating containers.

getSelectedIndexAtGroupIndex

int getSelectedIndexAtGroupIndex(int index)
Gets the selected document index in the document group at the specified index.

Parameters:
index - the index
Returns:
the selected document index. It should return a non-negative number in normal cases. -1 if there is no document selected. In current implementation of document group, it is impossible.
Throws:
IndexOutOfBoundsException - if the index passed in is less than 0 or greater than the number of document groups.

getLayoutPersistence

LayoutPersistence getLayoutPersistence()
Gets the layout persistence that can be used to persist the documents that are opened in document pane.

Returns:
the layout persistence.

setOpenedDocuments

void setOpenedDocuments(List<DocumentComponent> documentComponents)
Sets the opened components. This method will not show those documents. After this method, load

Parameters:
documentComponents - the list of documents.

setDocumentEnabled

void setDocumentEnabled(String name,
                        boolean enabled)
Enables or disables the document that identified by name. If you disable a document, the tab for the document will not be selectable. However if the document is active, it will remain active even you disable it. So it is recommended to make another document active if you want to disable the active document.

Parameters:
name - the name of the document.
enabled - true to enable the document and false to disable.

dispose

void dispose()
Dispose DocumentPane.


isHeavyweightComponentEnabled

boolean isHeavyweightComponentEnabled()
Returns:
true if the heavyweight component is enabled.

setHeavyweightComponentEnabled

void setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
Enables heavyweight component.

Parameters:
heavyweightComponentEnabled - true or false.

getFloatingContainerCloseAction

int getFloatingContainerCloseAction()
Gets the action when the native close button is pressed on the floating container. It could be either CLOSE_ACTION_TO_CLOSE to close all documents inside the floating container, or CLOSE_ACTION_TO_DOCK to dock all documents.

Returns:
the close action.

setFloatingContainerCloseAction

void setFloatingContainerCloseAction(int action)
Sets the action when the native close button is pressed on the floating container. It could be either CLOSE_ACTION_TO_CLOSE to close all documents inside the floating container, or CLOSE_ACTION_TO_DOCK to dock all documents.

Parameters:
action - the close action. Valid values are CLOSE_ACTION_TO_CLOSE or CLOSE_ACTION_TO_DOCK.

getFloatingContainerType

int getFloatingContainerType()
Gets the floating container type. It could be FLOATING_CONTAINER_TYPE_DIALOG or FLOATING_CONTAINER_TYPE_FRAME.

Returns:
the floating container type.
Since:
3.3.7

setFloatingContainerType

void setFloatingContainerType(int floatingContainerType)
Sets the floating container type. It could be FLOATING_CONTAINER_TYPE_DIALOG, or FLOATING_CONTAINER_TYPE_FRAME.

Parameters:
floatingContainerType - the floating container type.
Since:
3.3.7

JIDE 3.5.15