|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.jidesoft.swing.JideSplitPane com.jidesoft.document.DocumentPane
public class DocumentPane
The main class for tabbed-document interface.
Nested Class Summary | |
---|---|
static interface |
DocumentPane.DocumentTabColorProvider
An interface to provide colors for tab background and foreground of a Document. |
static interface |
DocumentPane.TabbedPaneCustomizer
A tabbed pane customizer that can customize the JideTabbedPane s used by DocumentPane . |
Nested classes/interfaces inherited from class com.jidesoft.swing.JideSplitPane |
---|
JideSplitPane.AccessibleJideSplitPane |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
_tabPlacement
Where the tabs are placed. |
static String |
CONTEXT_MENU_CANCEL
|
static String |
CONTEXT_MENU_CHANGE_ORIENTATION
|
static String |
CONTEXT_MENU_CLOSE
|
static String |
CONTEXT_MENU_CLOSE_ALL
|
static String |
CONTEXT_MENU_CLOSE_OTHERS
|
static String |
CONTEXT_MENU_DOCKING
|
static String |
CONTEXT_MENU_FLOATING
|
static String |
CONTEXT_MENU_MOVE_TO_NEXT
|
static String |
CONTEXT_MENU_MOVE_TO_PREVIOUS
|
static String |
CONTEXT_MENU_MOVE_TO_THIS
|
static String |
CONTEXT_MENU_NEW_HORIZONTAL_GROUP
|
static String |
CONTEXT_MENU_NEW_VERTICAL_GROUP
|
static String |
CONTEXT_MENU_NEXT
|
static String |
CONTEXT_MENU_PREVIOUS
|
static String |
CONTEXT_MENU_SPLIT_HORIZONTALLY
|
static String |
CONTEXT_MENU_SPLIT_VERTICALLY
|
static String |
PROPERTY_FLOATING_CONTAINER_TYPE
|
static String |
PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
|
static String |
PROPERTY_MAXIMUM_GROUP_COUNT
|
static int |
TABBED_DOCUMENT_INTERFACE
constant to indicate this DocumentPane is Tabbed-Document Interface. |
Fields inherited from class com.jidesoft.swing.JideSplitPane |
---|
_windowDeactivatedListener, CONTINUOUS_LAYOUT_PROPERTY, DIVIDER_SIZE_PROPERTY, GRIPPER_PROPERTY, HORIZONTAL_SPLIT, NON_CONTINUOUS_DIVIDER, ONE_TOUCH_EXPANDABLE_PROPERTY, ORIENTATION_PROPERTY, PROPERTY_DIVIDER_LOCATION, PROPORTIONAL_LAYOUT_PROPERTY, PROPORTIONS_PROPERTY, VERTICAL_SPLIT |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface com.jidesoft.document.IDocumentPane |
---|
CLOSE_ACTION_TO_CLOSE, CLOSE_ACTION_TO_DOCK, FLOATING_CONTAINER_TYPE_DIALOG, FLOATING_CONTAINER_TYPE_FRAME |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DocumentPane()
Default constructor for a DocumentPane. |
Method Summary | |
---|---|
void |
activateGroup(IDocumentGroup documentGroup)
Activates the document group. |
void |
addNotify()
|
void |
closeAll()
Closes all documents. |
void |
closeAllButThis(String documentName)
Closes all documents except this one. |
void |
closeDocument(String name)
Closes the document that identified by name . |
void |
closeDocuments(FloatingDocumentContainer container)
Closes all floating documents inside the floating container. |
void |
closeSingleDocument(String name)
Closes a single document. |
protected IDocumentGroup |
createDocumentGroup()
Creates the document group. |
protected FloatingDocumentContainer |
createFloatingDocumentContainer()
Creates the floating container that will be used to contain the floating document. |
protected JideSplitPaneDivider |
createSplitPaneDivider()
|
protected TdiGroup |
createTdiGroup()
Creates a TdiGroup. |
void |
customizePopupMenu(JPopupMenu menu,
String dragComponentName,
IDocumentGroup dropGroup,
boolean onTab)
Further customize the popup menu. |
void |
dispose()
Disposes the DocumentPane to avoid memory leak. |
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. |
void |
floatDocument(String documentName,
boolean respectPreviousState)
Floating a document of the specified name. |
DocumentComponent |
getActiveDocument()
Gets the active document. |
String |
getActiveDocumentName()
Gets name of the active document. |
Color |
getBackground()
Gets the background color of this component. |
DocumentComponent |
getDocument(String name)
Gets document whose name is name . |
DocumentComponent |
getDocumentAt(int index)
Gets the document at the specified index. |
DocumentComponentFactory |
getDocumentComponentFactory()
Gets the document component factory. |
int |
getDocumentCount()
Returns 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. |
int |
getDocumentGroupIndexAt(Point point)
Gets the index of the document group at position specified as parameter point. |
String |
getDocumentNameAt(int index)
Gets document at position specified in index . |
String[] |
getDocumentNames()
Returns 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. |
protected String |
getFloatingContainerTitle(TdiGroup tdiGroup)
Gets the title for the container that contains the floating documents. |
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. |
int |
getMaximumGroupCount()
Gets maximum document group count. |
String |
getNameOf(Component component)
Gets name of document whose component is component . |
protected int |
getNextAvailableIndex(String name)
|
String |
getNextDocument(String documentName)
Gets the next document name relative to the document specified by the documentName. |
PopupMenuCustomizer |
getPopupMenuCustomizer()
Gets the popup menu customizer. |
String |
getPreviousDocument(String documentName)
Gets the previous document name relative to the document specified by the documentName. |
protected String |
getResourceString(String key)
Gets the resource string used in DocumentPane. |
int |
getSelectedIndexAtGroupIndex(int index)
Gets the selected document index in the document group at the specified index. |
DocumentPane.TabbedPaneCustomizer |
getTabbedPaneCustomizer()
Gets a customizer to customize the tabbed pane where DocumentComponents will be in. |
DocumentPane.DocumentTabColorProvider |
getTabColorProvider()
Gets the tab color provider for document. |
int |
getTabPlacement()
Returns the placement of the tabs for this document pane. |
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. |
int |
indexOfDocumentGroup(IDocumentGroup group)
Gets the index of the document group. |
boolean |
isDocumentFloating(String documentName)
Checks if the document is floating. |
protected boolean |
isDocumentGroupEmpty(IDocumentGroup documentGroup)
Checks if the document group is empty. |
boolean |
isDocumentOpened(String name)
Checks if the document with the name is opened. |
boolean |
isDragPassUnmovableAllowed()
Get the flag indicating if it is allowed that a DocumentComponent could be dragged past another DocumentComponent with DocumentComponent.allowMoving() returns false. |
boolean |
isFloatingAllowed()
Checks if the document is allowed to be floating in this DocumentPane. |
boolean |
isFocusCycleRoot()
|
boolean |
isGroupsAllowed()
Checks if document grouping is allowed in this DocumentPane. |
boolean |
isHeavyweightComponentEnabled()
|
protected boolean |
isMoreDocumentGroupAllowed()
|
boolean |
isRearrangeAllowed()
Checks if document is rearranged by user. |
boolean |
isReorderAllowed()
Checks if the document order is allowed to changed by user. |
boolean |
isShowContextMenu()
Checks if the context menu should be shown. |
boolean |
isUpdateTitle()
This is a flag to control if updateTitle() will be called when a document component is selected or unselected. |
boolean |
isUseGlassPaneEnabled()
Checks if we will use glass pane to change cursor. |
void |
moveDocument(String name,
int groupIndex)
Moves the document identified by name to a new group whose index is groupIndex . |
void |
moveDocument(String name,
int groupIndex,
int index)
Moves the document identified by name to a new group whose index is groupIndex . |
void |
newDocumentGroup(String name,
int groupIndex,
int orientation)
Creates a document group and put the document with name to the new group. |
void |
nextDocument()
Sets next document as active. |
void |
openDocument(DocumentComponent document)
Open a document component in this pane. |
void |
openDocument(DocumentComponent document,
boolean floating)
Open a document component in this pane. |
void |
populateContextMenu(JPopupMenu menu)
Populates the context menu for the DocumentPane. |
protected void |
populateContextMenu(JPopupMenu menu,
Component dragComponent,
TdiGroup dragGroup,
TdiGroup dropGroup,
boolean onTab)
Populates the context menu. |
void |
prevDocument()
Sets previous document as active. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
removeNotify()
|
void |
renameDocument(String oldName,
String newName)
Renames the document with the old name to the new name. |
protected void |
requestFocusForActiveDocument()
Requests focus for current active document. |
void |
setActiveDocument(String name)
Sets the document that is identified by name as active. |
void |
setActiveDocument(String name,
boolean requestFocus)
Sets the document that is identified by name as active. |
void |
setDocumentComponentFactory(DocumentComponentFactory dockableFrameFactory)
Sets the document component factory. |
void |
setDocumentEnabled(String name,
boolean enabled)
Enables or disables the document that identified by name . |
void |
setDragPassUnmovableAllowed(boolean dragPassUnmovableAllowed)
Set the flag indicating if it is allowed that a DocumentComponent could be dragged past another DocumentComponent with DocumentComponent.allowMoving() returns false. |
void |
setFloatingAllowed(boolean floatingAllowed)
Sets if floating is allowed is this DocumentPane. |
void |
setFloatingContainerCloseAction(int floatingContainerCloseAction)
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 DocumentPane. |
void |
setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
Enables heavyweight component. |
void |
setMaximumGroupCount(int maximumGroupCount)
Sets maximum allowed document group. |
void |
setOpenedDocuments(List<DocumentComponent> documentComponents)
Sets the document list. |
void |
setPopupMenuCustomizer(PopupMenuCustomizer customizer)
Sets the popup menu customizer. |
void |
setRearrangeAllowed(boolean rearrangeAllowed)
Sets if the document is allowed to be rearranged by user. |
void |
setReorderAllowed(boolean reorderAllowed)
Sets if document order is allowed to be changed by user. |
void |
setShowContextMenu(boolean showContextMenu)
Sets the flag to show context menu or not. |
void |
setTabbedPaneCustomizer(DocumentPane.TabbedPaneCustomizer customizer)
Set a customizer to customize the tabbed pane where DocumentComponents will be in. |
void |
setTabColorProvider(DocumentPane.DocumentTabColorProvider tabColorProvider)
Sets the tab color provider for document. |
void |
setTabPlacement(int tabPlacement)
Sets the tab placement for this document pane. |
void |
setTitleConverter(StringConverter titleConverter)
Sets the title converter. |
void |
setUpdateTitle(boolean updateTitle)
This is a flag to control if updateTitle() will be called when a document component is selected or unselected. |
void |
setUseGlassPaneEnabled(boolean useGlassPaneEnabled)
Enables us to use glass pane to for cursor change purpose. |
void |
splitDocument(String name,
int groupIndex,
int orientation)
Splits the current document into two views. |
void |
stateChanged(ChangeEvent e)
Invoked when the target of the listener has changed its state. |
void |
updateDocument(String name)
Updates the document. |
void |
updateUI()
Resets the UI property with a value from the current look and feel. |
Methods inherited from class javax.swing.JPanel |
---|
getUI, getUIClassID, paramString, setUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int _tabPlacement
setTabPlacement(int)
public static final int TABBED_DOCUMENT_INTERFACE
public static final String PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
public static final String PROPERTY_MAXIMUM_GROUP_COUNT
public static final String PROPERTY_FLOATING_CONTAINER_TYPE
public static final String CONTEXT_MENU_CLOSE
public static final String CONTEXT_MENU_CLOSE_OTHERS
public static final String CONTEXT_MENU_CLOSE_ALL
public static final String CONTEXT_MENU_NEXT
public static final String CONTEXT_MENU_PREVIOUS
public static final String CONTEXT_MENU_NEW_HORIZONTAL_GROUP
public static final String CONTEXT_MENU_NEW_VERTICAL_GROUP
public static final String CONTEXT_MENU_SPLIT_HORIZONTALLY
public static final String CONTEXT_MENU_SPLIT_VERTICALLY
public static final String CONTEXT_MENU_MOVE_TO_NEXT
public static final String CONTEXT_MENU_MOVE_TO_PREVIOUS
public static final String CONTEXT_MENU_MOVE_TO_THIS
public static final String CONTEXT_MENU_CHANGE_ORIENTATION
public static final String CONTEXT_MENU_FLOATING
public static final String CONTEXT_MENU_DOCKING
public static final String CONTEXT_MENU_CANCEL
Constructor Detail |
---|
public DocumentPane()
Method Detail |
---|
public Color getBackground()
getBackground
in class Component
public void openDocument(DocumentComponent document)
openDocument
in interface IDocumentPane
document
- document to be openedpublic void openDocument(DocumentComponent document, boolean floating)
document
- document to be openedfloating
- whether the document is floating after it is opened.public boolean isDocumentOpened(String name)
isDocumentOpened
in interface IDocumentPane
name
- name of the document
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void activateGroup(IDocumentGroup documentGroup)
activateGroup
in interface IDocumentPane
documentGroup
- documentGroup to be activatedprotected IDocumentGroup createDocumentGroup()
public IDocumentGroup getDocumentGroup(String documentName)
IDocumentPane
getDocumentGroup
in interface IDocumentPane
documentName
- the document name.
protected TdiGroup createTdiGroup()
public void closeDocument(String name)
name
. closeSingleDocument(String)
, closeAll()
and closeAllButThis(String)
will eventually
call this method to close the documents. So if you want to override a method to detect all closing document
actions, this is the method to override.
closeDocument
in interface IDocumentPane
name
- document namepublic void closeSingleDocument(String name)
closeAll()
and closeAllButThis(String)
will eventually
call closeDocument(String)
to close the documents.
You can refer to http://www.jidesoft.com/forum/viewtopic.php?p=10262#10262 to see the reason of adding this
method.
closeSingleDocument
in interface IDocumentPane
name
- the name of the document.public void closeAll()
closeAll
in interface IDocumentPane
public void closeAllButThis(String documentName)
closeAllButThis
in interface IDocumentPane
documentName
- the document name.public void setActiveDocument(String name)
setActiveDocument
in interface IDocumentPane
name
- the name of the document.public void setActiveDocument(String name, boolean requestFocus)
setActiveDocument
in interface IDocumentPane
name
- the name of the document.requestFocus
- if the active document will request focus.protected void requestFocusForActiveDocument()
public DocumentComponent getActiveDocument()
getActiveDocument
in interface IDocumentPane
public String getActiveDocumentName()
getActiveDocumentName
in interface IDocumentPane
public void nextDocument()
nextDocument
in interface IDocumentPane
public void prevDocument()
prevDocument
in interface IDocumentPane
public String getNextDocument(String documentName)
documentName
- the current document name.
public String getPreviousDocument(String documentName)
documentName
- the current document name.
public void moveDocument(String name, int groupIndex)
groupIndex
.
moveDocument
in interface IDocumentPane
name
- name of the documentgroupIndex
- index of dest grouppublic void moveDocument(String name, int groupIndex, int index)
groupIndex
.
moveDocument
in interface IDocumentPane
name
- name of the documentgroupIndex
- index of the destination group. If the index is less than 0, we will treat it as 0. If greater
than the group count, we will treat it as the last group.index
- new index of the document inside the destination group.protected boolean isDocumentGroupEmpty(IDocumentGroup documentGroup)
documentGroup
- the document group
public void newDocumentGroup(String name, int groupIndex, int orientation)
newDocumentGroup
in interface IDocumentPane
name
- the name of the document. If there is no document with this name, this method will return and
do nothing. So it is important you verify the document exists.groupIndex
- the group index. This is the index that the new group will be at. 0 means the first group. 1
means the second group etc. Any value less than 0 will be treated as 0 and greater than
current group count will be treated as the last group.orientation
- HORIZONTAL or VERTICAL. It will be ignored if there are groups already as we only support
groups of either all horizontal or all vertical. You can always use setOrientation to change
the orientation.protected boolean isMoreDocumentGroupAllowed()
public String getNameOf(Component component)
component
.
getNameOf
in interface IDocumentPane
component
- the component in DocumentComponent
.
public DocumentComponent getDocument(String name)
name
.
getDocument
in interface IDocumentPane
name
- name
public DocumentComponent getDocumentAt(int index)
getDocumentAt
in interface IDocumentPane
index
- the index
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
e
- a ChangeEvent objectpublic final void customizePopupMenu(JPopupMenu menu, String dragComponentName, IDocumentGroup dropGroup, boolean onTab)
menu
- the menu that will be displayed.dragComponentName
- name of the dragged document. It could be the document where mouse is right clicked.dropGroup
- the drop group.onTab
- whether the click is on tab. The only case onTab is false is when you drag-n-drop to
move a document but didn't drop at an empty space.public StringConverter getTitleConverter()
getTitleConverter
in interface IDocumentPane
public void setTitleConverter(StringConverter titleConverter)
setTitleConverter
in interface IDocumentPane
titleConverter
- the title converter.public PopupMenuCustomizer getPopupMenuCustomizer()
getPopupMenuCustomizer
in interface IDocumentPane
public void setPopupMenuCustomizer(PopupMenuCustomizer customizer)
setPopupMenuCustomizer
in interface IDocumentPane
customizer
- the popup menu customizerpublic boolean isGroupsAllowed()
isGroupsAllowed
in interface IDocumentPane
public void setGroupsAllowed(boolean groupsAllowed)
setGroupsAllowed
in interface IDocumentPane
groupsAllowed
- whether document group is allowed.public boolean isReorderAllowed()
isReorderAllowed
in interface IDocumentPane
public void setReorderAllowed(boolean reorderAllowed)
setReorderAllowed
in interface IDocumentPane
reorderAllowed
- whether document reordering is allowed.public boolean isRearrangeAllowed()
public void setRearrangeAllowed(boolean rearrangeAllowed)
rearrangeAllowed
- whether document rearranging is allowed.public boolean isFloatingAllowed()
public void setFloatingAllowed(boolean floatingAllowed)
floatingAllowed
- whether the floating is allowed.public int getDocumentCount()
getDocumentCount
in interface IDocumentPane
public String getDocumentNameAt(int index)
index
. The order is as the same as the order of when
documents are opened.
getDocumentNameAt
in interface IDocumentPane
index
- document position
getDocument(name)
to get the DocumentComponentpublic String[] getDocumentNames()
getDocumentNames
in interface IDocumentPane
public int indexOfDocument(String name)
indexOfDocument
in interface IDocumentPane
name
- the name of the document.
public int groupIndexOfDocument(String name)
groupIndexOfDocument
in interface IDocumentPane
name
- the name of the document.
public void updateUI()
updateUI
in class JideSplitPane
JComponent.updateUI()
public int getTabPlacement()
setTabPlacement(int)
public void setTabPlacement(int tabPlacement)
JTabbedPane.TOP
JTabbedPane.BOTTOM
JTabbedPane.LEFT
JTabbedPane.RIGHT
SwingConstants.TOP
.
tabPlacement
- the placement for the tabs relative to the content
IllegalArgumentException
- if tab placement value isn't one of the above valid valuespublic boolean isDragPassUnmovableAllowed()
DocumentComponent.allowMoving()
returns false.
By default, the flag would be true to keep the original behavior. You could set it to true if you want to freeze
the DocumentComponent which is not movable.
public void setDragPassUnmovableAllowed(boolean dragPassUnmovableAllowed)
DocumentComponent.allowMoving()
returns false.
dragPassUnmovableAllowed
- the flagisDragPassUnmovableAllowed()
public DocumentPane.DocumentTabColorProvider getTabColorProvider()
public void setTabColorProvider(DocumentPane.DocumentTabColorProvider tabColorProvider)
tabColorProvider
- the tab color providerpublic DocumentPane.TabbedPaneCustomizer getTabbedPaneCustomizer()
public void setTabbedPaneCustomizer(DocumentPane.TabbedPaneCustomizer customizer)
documentPane.setTabbedPaneCustomizer(new DocumentPane.TabbedPaneCustomizer() {
public void customize(JideTabbedPane tabbedPane) {
tabbedPane.setTabPlacement(JideTabbedPane.TOP);
tabbedPane.setHideOneTab(false);
}
});
customizer
- new tabbed pane customizerpublic void updateDocument(String name)
updateDocument
in interface IDocumentPane
name
- the document name.public void renameDocument(String oldName, String newName)
DocumentComponent.setTitle(java.lang.String)
, then call updateDocument(java.lang.String)
.
renameDocument
in interface IDocumentPane
oldName
- old namenewName
- new name
IllegalArgumentException
- if the document with oldName is not opened yet.public boolean isFocusCycleRoot()
isFocusCycleRoot
in class Container
public boolean isUpdateTitle()
setUpdateTitle(boolean)
public void setUpdateTitle(boolean updateTitle)
updateTitle
- if true, updateTitle() will be called or not when a document component is selected or
unselected.public int getDocumentGroupIndexAt(Point point)
point
- the point.
public int getDocumentGroupCount()
getDocumentGroupCount
in interface IDocumentPane
public IDocumentGroup getDocumentGroupAt(int index)
getDocumentGroupAt
in interface IDocumentPane
index
- the index.
getDocumentGroupIndexAt(java.awt.Point)
public int indexOfDocumentGroup(IDocumentGroup group)
group
- the document group
public int getSelectedIndexAtGroupIndex(int index)
getSelectedIndexAtGroupIndex
in interface IDocumentPane
index
- the group index.
IndexOutOfBoundsException
- if the index passed in is less than 0 or greater than the number of document
groups.public void setOpenedDocuments(List<DocumentComponent> documentComponents)
LayoutPersistence
.
setOpenedDocuments
in interface IDocumentPane
documentComponents
- the list of documents.public void setDocumentEnabled(String name, boolean enabled)
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. Also, although user
can't select it anymore, it can still be closed.
setDocumentEnabled
in interface IDocumentPane
name
- the name of the document.enabled
- true to enable the document and false to disable.public DocumentComponentFactory getDocumentComponentFactory()
LayoutPersistence.loadLayoutFrom(java.io.InputStream)
method. If the document component exists in initial layout but not added to DocumentPane, the factory will be
used to create the document component.
public void setDocumentComponentFactory(DocumentComponentFactory dockableFrameFactory)
dockableFrameFactory
- the document component factorypublic LayoutPersistence getLayoutPersistence()
IDocumentPane
getLayoutPersistence
in interface IDocumentPane
public void dispose()
dispose
in interface IDocumentPane
public boolean isShowContextMenu()
public void setShowContextMenu(boolean showContextMenu)
showContextMenu
- whether the context menu is shown.protected JideSplitPaneDivider createSplitPaneDivider()
createSplitPaneDivider
in class JideSplitPane
public boolean isHeavyweightComponentEnabled()
isHeavyweightComponentEnabled
in interface IDocumentPane
isHeavyweightComponentEnabled
in class JideSplitPane
public void setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
setHeavyweightComponentEnabled
in interface IDocumentPane
setHeavyweightComponentEnabled
in class JideSplitPane
heavyweightComponentEnabled
- whether heavyweight component is used.public int getMaximumGroupCount()
setMaximumGroupCount(int)
public void setMaximumGroupCount(int maximumGroupCount)
maximumGroupCount
- maximum allowed group count. It should be a number greater then or equal to 0. 0 means
unlimited.protected int getNextAvailableIndex(String name)
public void splitDocument(String name, int groupIndex, int orientation)
CloneableDocumentComponent
. Otherwise this method will do nothing. This interface has CloneableDocumentComponent.clone()
method which will clone the component to create two
views of the same model (or data). An example of this is CodeEditorDocumentComponent in JIDE Code Editor.
This method is Swing thread-safe.
name
- the name of the document to be split. If there is no document with this name, this method will
return and do nothing. So it is important you verify the document exists.groupIndex
- the group index. This is the index that the new group will be at. 0 means the first group. 1
means the second group etc. Any value less than 0 will be treated as 0 and greater than
current group count will be treated as the last group.orientation
- HORIZONTAL or VERTICAL. It will be ignored if there are groups already as we only support
groups of either all horizontal or all vertical. You can always use setOrientation to change
the orientation.public boolean isUseGlassPaneEnabled()
setUseGlassPaneEnabled(boolean)
public void setUseGlassPaneEnabled(boolean useGlassPaneEnabled)
useGlassPaneEnabled
- true or false.public void populateContextMenu(JPopupMenu menu)
menu
- This method will add the menu items to this popup menu. Nothing will be added if there is no document
in the DocumentPane.protected void populateContextMenu(JPopupMenu menu, Component dragComponent, TdiGroup dragGroup, TdiGroup dropGroup, boolean onTab)
menu
- This method will add the menu items to this popup menu.dragComponent
- the dragged tabdragGroup
- the tab group from where the tab is dragged.dropGroup
- the tab group where the tab will be droppedonTab
- whether the drop location is on the tab.protected String getResourceString(String key)
key
- the resource key
public void floatDocument(String documentName)
floatDocument
in interface IDocumentPane
documentName
- the document name.public void floatDocument(String documentName, boolean respectPreviousState)
documentName
- the document name.respectPreviousState
- the flag to respect previous floating state. false means to always create new
floating container for the frame.public void floatDocument(FloatingDocumentContainer floatingContainer, String documentName)
floatDocument
in interface IDocumentPane
floatingContainer
- the floating container.documentName
- the document name.protected FloatingDocumentContainer createFloatingDocumentContainer()
public void dockDocument(String documentName)
dockDocument
in interface IDocumentPane
documentName
- the name of document that is floating.public void dockDocuments(FloatingDocumentContainer container)
dockDocuments
in interface IDocumentPane
container
- the floating container.public void closeDocuments(FloatingDocumentContainer container)
closeDocuments
in interface IDocumentPane
container
- the floating container.public boolean isDocumentFloating(String documentName)
isDocumentFloating
in interface IDocumentPane
documentName
- the name of the document
public List<FloatingDocumentContainer> getFloatingContainers()
getFloatingContainers
in interface IDocumentPane
public int getFloatingContainerCloseAction()
IDocumentPane
IDocumentPane.CLOSE_ACTION_TO_CLOSE
to close all documents inside the floating container, or IDocumentPane.CLOSE_ACTION_TO_DOCK
to
dock all documents.
getFloatingContainerCloseAction
in interface IDocumentPane
public void setFloatingContainerCloseAction(int floatingContainerCloseAction)
IDocumentPane
IDocumentPane.CLOSE_ACTION_TO_CLOSE
to close all documents inside the floating container, or IDocumentPane.CLOSE_ACTION_TO_DOCK
to
dock all documents.
setFloatingContainerCloseAction
in interface IDocumentPane
floatingContainerCloseAction
- the close action. Valid values are IDocumentPane.CLOSE_ACTION_TO_CLOSE
or IDocumentPane.CLOSE_ACTION_TO_DOCK
.public void addNotify()
addNotify
in class JComponent
public void removeNotify()
removeNotify
in class JComponent
protected String getFloatingContainerTitle(TdiGroup tdiGroup)
tdiGroup
- the document group that is in the floating mode.
public int getFloatingContainerType()
IDocumentPane.FLOATING_CONTAINER_TYPE_DIALOG
or IDocumentPane.FLOATING_CONTAINER_TYPE_FRAME
.
getFloatingContainerType
in interface IDocumentPane
public void setFloatingContainerType(int floatingContainerType)
IDocumentPane.FLOATING_CONTAINER_TYPE_DIALOG
, or IDocumentPane.FLOATING_CONTAINER_TYPE_FRAME
.
setFloatingContainerType
in interface IDocumentPane
floatingContainerType
- the floating container type.
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |