JIDE 3.5.15

com.jidesoft.document
Class DocumentPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jidesoft.swing.JideSplitPane
                      extended by com.jidesoft.document.DocumentPane
All Implemented Interfaces:
IDocumentPane, ComponentListener, ContainerListener, ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible, ChangeListener, SwingConstants
Direct Known Subclasses:
CodeEditorDocumentPane, DashboardDocumentPane

public class DocumentPane
extends JideSplitPane
implements SwingConstants, IDocumentPane, ChangeListener, PropertyChangeListener

The main class for tabbed-document interface.

See Also:
Serialized Form

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 JideTabbedPanes 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 com.jidesoft.swing.JideSplitPane
addExtraDividers, addPane, addProportion, componentAdded, componentHidden, componentMoved, componentRemoved, componentResized, componentShown, doLayout, dragDividerTo, finishDraggingTo, getAccessibleContext, getDividerAt, getDividerLocation, getDividerLocations, getDividerSize, getDividerStepSize, getLeftOneTouchButtonImageIcon, getNextDividerLocation, getOrientation, getPaneAt, getPaneCount, getPreviousDividerLocation, getProportions, getRightOneTouchButtonImageIcon, indexOf, indexOfDivider, indexOfPane, insertPane, insertPane, isContinuousLayout, isDragResizable, isInitiallyEven, isOneTouchExpandable, isProportionalLayout, isShowGripper, isValidateRoot, removeExtraDividers, removePane, removePane, removeProportion, resetToPreferredSizes, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerLocations, setDividerSize, setDividerStepSize, setDividersVisible, setDragResizable, setInitiallyEven, setLeftOneTouchButtonImageIcon, setOneTouchExpandable, setOrientation, setPaneAt, setPaneAt, setProportionalLayout, setProportions, setRightOneTouchButtonImageIcon, setShowGripper, setVisible, startDragging
 
Methods inherited from class javax.swing.JPanel
getUI, getUIClassID, paramString, setUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_tabPlacement

protected int _tabPlacement
Where the tabs are placed.

See Also:
setTabPlacement(int)

TABBED_DOCUMENT_INTERFACE

public static final int TABBED_DOCUMENT_INTERFACE
constant to indicate this DocumentPane is Tabbed-Document Interface.

See Also:
Constant Field Values

PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED

public static final String PROPERTY_HEAVYWEIGHT_COMPONENT_ENABLED
See Also:
Constant Field Values

PROPERTY_MAXIMUM_GROUP_COUNT

public static final String PROPERTY_MAXIMUM_GROUP_COUNT
See Also:
Constant Field Values

PROPERTY_FLOATING_CONTAINER_TYPE

public static final String PROPERTY_FLOATING_CONTAINER_TYPE
Since:
3.3.7
See Also:
Constant Field Values

CONTEXT_MENU_CLOSE

public static final String CONTEXT_MENU_CLOSE
See Also:
Constant Field Values

CONTEXT_MENU_CLOSE_OTHERS

public static final String CONTEXT_MENU_CLOSE_OTHERS
See Also:
Constant Field Values

CONTEXT_MENU_CLOSE_ALL

public static final String CONTEXT_MENU_CLOSE_ALL
See Also:
Constant Field Values

CONTEXT_MENU_NEXT

public static final String CONTEXT_MENU_NEXT
See Also:
Constant Field Values

CONTEXT_MENU_PREVIOUS

public static final String CONTEXT_MENU_PREVIOUS
See Also:
Constant Field Values

CONTEXT_MENU_NEW_HORIZONTAL_GROUP

public static final String CONTEXT_MENU_NEW_HORIZONTAL_GROUP
See Also:
Constant Field Values

CONTEXT_MENU_NEW_VERTICAL_GROUP

public static final String CONTEXT_MENU_NEW_VERTICAL_GROUP
See Also:
Constant Field Values

CONTEXT_MENU_SPLIT_HORIZONTALLY

public static final String CONTEXT_MENU_SPLIT_HORIZONTALLY
See Also:
Constant Field Values

CONTEXT_MENU_SPLIT_VERTICALLY

public static final String CONTEXT_MENU_SPLIT_VERTICALLY
See Also:
Constant Field Values

CONTEXT_MENU_MOVE_TO_NEXT

public static final String CONTEXT_MENU_MOVE_TO_NEXT
See Also:
Constant Field Values

CONTEXT_MENU_MOVE_TO_PREVIOUS

public static final String CONTEXT_MENU_MOVE_TO_PREVIOUS
See Also:
Constant Field Values

CONTEXT_MENU_MOVE_TO_THIS

public static final String CONTEXT_MENU_MOVE_TO_THIS
See Also:
Constant Field Values

CONTEXT_MENU_CHANGE_ORIENTATION

public static final String CONTEXT_MENU_CHANGE_ORIENTATION
See Also:
Constant Field Values

CONTEXT_MENU_FLOATING

public static final String CONTEXT_MENU_FLOATING
See Also:
Constant Field Values

CONTEXT_MENU_DOCKING

public static final String CONTEXT_MENU_DOCKING
See Also:
Constant Field Values

CONTEXT_MENU_CANCEL

public static final String CONTEXT_MENU_CANCEL
See Also:
Constant Field Values
Constructor Detail

DocumentPane

public DocumentPane()
Default constructor for a DocumentPane.

Method Detail

getBackground

public Color getBackground()
Gets the background color of this component.

Overrides:
getBackground in class Component
Returns:
the background

openDocument

public void openDocument(DocumentComponent document)
Open a document component in this pane. Please note, the name the DocumentComponent has to be unique. If you try to open a DocumentComponent that has the same name as one of the existing ones, nothing will happen as the DocumentPane thinks the document has already been opened.
This method is Swing thread-safe.

Specified by:
openDocument in interface IDocumentPane
Parameters:
document - document to be opened

openDocument

public void openDocument(DocumentComponent document,
                         boolean floating)
Open a document component in this pane. Please note, the name the DocumentComponent has to be unique. If you try to open a DocumentComponent that has the same name as one of the existing ones, nothing will happen as the DocumentPane thinks the document has already been opened.
This method is Swing thread-safe.

Parameters:
document - document to be opened
floating - whether the document is floating after it is opened.

isDocumentOpened

public boolean isDocumentOpened(String name)
Checks if the document with the name is opened. As the name for the document in each DocumentPane is unique, the name itself is enough to identify a document.

Specified by:
isDocumentOpened in interface IDocumentPane
Parameters:
name - name of the document
Returns:
true if the document is opened

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

activateGroup

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

Specified by:
activateGroup in interface IDocumentPane
Parameters:
documentGroup - documentGroup to be activated

createDocumentGroup

protected IDocumentGroup createDocumentGroup()
Creates the document group. Subclasses can override this method to change the behavior of the document group. Right now only JideTabbedPane can be returned. However to be safe, you should check if the returned value is JideTabbedPane before you cast to it.

Returns:
the created document group.

getDocumentGroup

public IDocumentGroup getDocumentGroup(String documentName)
Description copied from interface: IDocumentPane
Gets the document group that contains the document with the specified document name.

Specified by:
getDocumentGroup in interface IDocumentPane
Parameters:
documentName - the document name.
Returns:
the document group that contains the document with the specified document name.

createTdiGroup

protected TdiGroup createTdiGroup()
Creates a TdiGroup.

Returns:
a TdiGroup.

closeDocument

public void closeDocument(String name)
Closes the document that identified by name.
This method is Swing thread-safe.

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.

Specified by:
closeDocument in interface IDocumentPane
Parameters:
name - document name

closeSingleDocument

public void closeSingleDocument(String name)
Closes a single document. This method, 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.
This method is Swing thread-safe.

Specified by:
closeSingleDocument in interface IDocumentPane
Parameters:
name - the name of the document.

closeAll

public void closeAll()
Closes all documents.
This method is Swing thread-safe.

Specified by:
closeAll in interface IDocumentPane

closeAllButThis

public void closeAllButThis(String documentName)
Closes all documents except this one.
This method is Swing thread-safe.

Specified by:
closeAllButThis in interface IDocumentPane
Parameters:
documentName - the document name.

setActiveDocument

public void setActiveDocument(String name)
Sets the document that is identified by name as active.
This method is Swing thread-safe.

Specified by:
setActiveDocument in interface IDocumentPane
Parameters:
name - the name of the document.

setActiveDocument

public void setActiveDocument(String name,
                              boolean requestFocus)
Sets the document that is identified by name as active.
This method is Swing thread-safe.

Specified by:
setActiveDocument in interface IDocumentPane
Parameters:
name - the name of the document.
requestFocus - if the active document will request focus.

requestFocusForActiveDocument

protected void requestFocusForActiveDocument()
Requests focus for current active document.

Since:
3.3.0

getActiveDocument

public DocumentComponent getActiveDocument()
Gets the active document.

Specified by:
getActiveDocument in interface IDocumentPane
Returns:
active document

getActiveDocumentName

public String getActiveDocumentName()
Gets name of the active document.

Specified by:
getActiveDocumentName in interface IDocumentPane
Returns:
key of the active document

nextDocument

public void nextDocument()
Sets next document as active. Next document is next one on the screen.

Specified by:
nextDocument in interface IDocumentPane

prevDocument

public void prevDocument()
Sets previous document as active. Previous document is previous one on the screen.

Specified by:
prevDocument in interface IDocumentPane

getNextDocument

public String getNextDocument(String documentName)
Gets the next document name relative to the document specified by the documentName.

Parameters:
documentName - the current document name.
Returns:
the next document name.

getPreviousDocument

public String getPreviousDocument(String documentName)
Gets the previous document name relative to the document specified by the documentName.

Parameters:
documentName - the current document name.
Returns:
the previous document name.

moveDocument

public void moveDocument(String name,
                         int groupIndex)
Moves the document identified by name to a new group whose index is groupIndex.
This method is Swing thread-safe.

Specified by:
moveDocument in interface IDocumentPane
Parameters:
name - name of the document
groupIndex - index of dest group

moveDocument

public void moveDocument(String name,
                         int groupIndex,
                         int index)
Moves the document identified by name to a new group whose index is groupIndex.
This method is Swing thread-safe.

Specified by:
moveDocument in interface IDocumentPane
Parameters:
name - name of the document
groupIndex - 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.

isDocumentGroupEmpty

protected boolean isDocumentGroupEmpty(IDocumentGroup documentGroup)
Checks if the document group is empty.

Parameters:
documentGroup - the document group
Returns:
true if the document group is empty. Otherwise false.

newDocumentGroup

public void newDocumentGroup(String name,
                             int groupIndex,
                             int orientation)
Creates a document group and put the document with name to the new group. You must put at least one DocumentComponent in the group. That's why newDocumentGroup method takes document name as the first parameter as it will put that document into the newly create document group.

Please note, there is no removeDocumentGroup method. When you remove or close the last document from the group, the document group will be removed automatically.

This method is Swing thread-safe.

Specified by:
newDocumentGroup in interface IDocumentPane
Parameters:
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.

isMoreDocumentGroupAllowed

protected boolean isMoreDocumentGroupAllowed()

getNameOf

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

Specified by:
getNameOf in interface IDocumentPane
Parameters:
component - the component in DocumentComponent.
Returns:
name of the specified component

getDocument

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

Specified by:
getDocument in interface IDocumentPane
Parameters:
name - name
Returns:
document

getDocumentAt

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

Specified by:
getDocumentAt in interface IDocumentPane
Parameters:
index - the index
Returns:
document

stateChanged

public void stateChanged(ChangeEvent e)
Invoked when the target of the listener has changed its state.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e - a ChangeEvent object

customizePopupMenu

public final void customizePopupMenu(JPopupMenu menu,
                                     String dragComponentName,
                                     IDocumentGroup dropGroup,
                                     boolean onTab)
Further customize the popup menu. User can call setPopupMenuCustomizer to customize the popup menu.

The menu passed in the the customizePopupMenu already have some menu items. You can remove all of them to add your own, or you can remove some of them. All existing menu items have a unique names. Here are the names - "DocumentPane.close", "DocumentPane.closeOthers", "DocumentPane.closeAll", "DocumentPane.next", "DocumentPane.previous", "DocumentPane.newHorizontalGroupIcon", "DocumentPane.newVerticalGroupIcon", "DocumentPane.moveToNext", "DocumentPane.moveToPrevious", "DocumentPane.moveToThis", "DocumentPane.changeOrientation", and "DocumentPane.cancel". The names should be very obvious to what the menu item do. There are also constants beginning with CONTEXT_MENU_xxx defined on DocumentPane. So instead of using an absolute menu item index, it'd better to use the name to look up a particular menu item.

Parameters:
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.

getTitleConverter

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

Specified by:
getTitleConverter in interface IDocumentPane
Returns:
title converter

setTitleConverter

public void setTitleConverter(StringConverter titleConverter)
Sets the title converter.

Specified by:
setTitleConverter in interface IDocumentPane
Parameters:
titleConverter - the title converter.

getPopupMenuCustomizer

public PopupMenuCustomizer getPopupMenuCustomizer()
Gets the popup menu customizer.

Specified by:
getPopupMenuCustomizer in interface IDocumentPane
Returns:
popup menu customizer

setPopupMenuCustomizer

public void setPopupMenuCustomizer(PopupMenuCustomizer customizer)
Sets the popup menu customizer.

Specified by:
setPopupMenuCustomizer in interface IDocumentPane
Parameters:
customizer - the popup menu customizer

isGroupsAllowed

public boolean isGroupsAllowed()
Checks if document grouping is allowed in this DocumentPane.

Specified by:
isGroupsAllowed in interface IDocumentPane
Returns:
true if document grouping is allowed

setGroupsAllowed

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

Specified by:
setGroupsAllowed in interface IDocumentPane
Parameters:
groupsAllowed - whether document group is allowed.

isReorderAllowed

public boolean isReorderAllowed()
Checks if the document order is allowed to changed by user. By document order, we mean the tab order.

Specified by:
isReorderAllowed in interface IDocumentPane
Returns:
true if the recording is allowed.

setReorderAllowed

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

Specified by:
setReorderAllowed in interface IDocumentPane
Parameters:
reorderAllowed - whether document reordering is allowed.

isRearrangeAllowed

public boolean isRearrangeAllowed()
Checks if document is rearranged by user. That includes new document group, change orientation, move document to different group etc.

Returns:
true if the rearranging is allowed

setRearrangeAllowed

public void setRearrangeAllowed(boolean rearrangeAllowed)
Sets if the document is allowed to be rearranged by user. That includes new document group, change orientation, move document to different group etc.

Parameters:
rearrangeAllowed - whether document rearranging is allowed.

isFloatingAllowed

public boolean isFloatingAllowed()
Checks if the document is allowed to be floating in this DocumentPane.

Returns:
true if the floating is allowed

setFloatingAllowed

public void setFloatingAllowed(boolean floatingAllowed)
Sets if floating is allowed is this DocumentPane.

Parameters:
floatingAllowed - whether the floating is allowed.

getDocumentCount

public int getDocumentCount()
Returns the total number of open documents.

Specified by:
getDocumentCount in interface IDocumentPane
Returns:
the total number of open documents.

getDocumentNameAt

public 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.

Specified by:
getDocumentNameAt in interface IDocumentPane
Parameters:
index - document position
Returns:
name of document. Call getDocument(name) to get the DocumentComponent

getDocumentNames

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

Specified by:
getDocumentNames in interface IDocumentPane
Returns:
an array of all documents

indexOfDocument

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

Specified by:
indexOfDocument in interface IDocumentPane
Parameters:
name - the name of the document.
Returns:
index of the document in it's current group. return -1 if the document is not opened.

groupIndexOfDocument

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

Specified by:
groupIndexOfDocument in interface IDocumentPane
Parameters:
name - the name of the document.
Returns:
the index of the group which contains the document. return -1 if the document is not opened.

updateUI

public void updateUI()
Resets the UI property with a value from the current look and feel.

Overrides:
updateUI in class JideSplitPane
See Also:
JComponent.updateUI()

getTabPlacement

public int getTabPlacement()
Returns the placement of the tabs for this document pane.

Returns:
the tab placement.
See Also:
setTabPlacement(int)

setTabPlacement

public void setTabPlacement(int tabPlacement)
Sets the tab placement for this document pane. Possible values are: The default value, if not set, is SwingConstants.TOP.

Parameters:
tabPlacement - the placement for the tabs relative to the content
Throws:
IllegalArgumentException - if tab placement value isn't one of the above valid values

isDragPassUnmovableAllowed

public boolean isDragPassUnmovableAllowed()
Get the flag indicating if it is allowed that a DocumentComponent could be dragged past another DocumentComponent with 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.

Returns:
true if the pass behavior is allowed. Otherwise false.

setDragPassUnmovableAllowed

public 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.

Parameters:
dragPassUnmovableAllowed - the flag
See Also:
isDragPassUnmovableAllowed()

getTabColorProvider

public DocumentPane.DocumentTabColorProvider getTabColorProvider()
Gets the tab color provider for document.

Returns:
the tab color provider.
Since:
3.5.5

setTabColorProvider

public void setTabColorProvider(DocumentPane.DocumentTabColorProvider tabColorProvider)
Sets the tab color provider for document.

Parameters:
tabColorProvider - the tab color provider
Since:
3.5.5

getTabbedPaneCustomizer

public DocumentPane.TabbedPaneCustomizer getTabbedPaneCustomizer()
Gets a customizer to customize the tabbed pane where DocumentComponents will be in.

Returns:
the tabbed pane customizer.

setTabbedPaneCustomizer

public void setTabbedPaneCustomizer(DocumentPane.TabbedPaneCustomizer customizer)
Set a customizer to customize the tabbed pane where DocumentComponents will be in.

 documentPane.setTabbedPaneCustomizer(new DocumentPane.TabbedPaneCustomizer() {
     public void customize(JideTabbedPane tabbedPane) {
         tabbedPane.setTabPlacement(JideTabbedPane.TOP);
         tabbedPane.setHideOneTab(false);
     }
 });

Parameters:
customizer - new tabbed pane customizer

updateDocument

public void updateDocument(String name)
Updates the document. This can be used when the document's title, tooltip or icon changed. However, in the current release, you shouldn't need to call it as we will call it automatically.

This method is Swing thread-safe.

Specified by:
updateDocument in interface IDocumentPane
Parameters:
name - the document name.

renameDocument

public void renameDocument(String oldName,
                           String newName)
Renames the document with the old name to the new name. This method will not affect the title on the tab. If you just want to change the title of document, use DocumentComponent.setTitle(java.lang.String), then call updateDocument(java.lang.String).

Specified by:
renameDocument in interface IDocumentPane
Parameters:
oldName - old name
newName - new name
Throws:
IllegalArgumentException - if the document with oldName is not opened yet.

isFocusCycleRoot

public boolean isFocusCycleRoot()
Overrides:
isFocusCycleRoot in class Container

isUpdateTitle

public boolean isUpdateTitle()
This is a flag to control if updateTitle() will be called when a document component is selected or unselected. Default value is true. If repaint in your application is expensive, you can change this flag to false. If so, the only sacrifice you made is the text for the selected document will not be bold.

Returns:
if true, updateTitle() will be called or not when a document component is selected or unselected.
See Also:
setUpdateTitle(boolean)

setUpdateTitle

public void setUpdateTitle(boolean updateTitle)
This is a flag to control if updateTitle() will be called when a document component is selected or unselected. Default value is true. If repaint in your application is expensive, you can change this flag to false. If so, the only sacrifice you made is the text for the selected document will not be bold.

Parameters:
updateTitle - if true, updateTitle() will be called or not when a document component is selected or unselected.

getDocumentGroupIndexAt

public int getDocumentGroupIndexAt(Point point)
Gets the index of the document group at position specified as parameter point. Please note the point is relative to the DocumentPane and it will only find the document group which is not floating.

Parameters:
point - the point.
Returns:
the the index of the document group at position specified as parameter point.

getDocumentGroupCount

public int getDocumentGroupCount()
Gets the number of document groups.

Specified by:
getDocumentGroupCount in interface IDocumentPane
Returns:
the number of document groups.

getDocumentGroupAt

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

Specified by:
getDocumentGroupAt in interface IDocumentPane
Parameters:
index - the index.
Returns:
the document group.
See Also:
getDocumentGroupIndexAt(java.awt.Point)

indexOfDocumentGroup

public int indexOfDocumentGroup(IDocumentGroup group)
Gets the index of the document group.

Parameters:
group - the document group
Returns:
the document group index. -1 if the document group is not in this DocumentPane.

getSelectedIndexAtGroupIndex

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

Specified by:
getSelectedIndexAtGroupIndex in interface IDocumentPane
Parameters:
index - the group 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.

setOpenedDocuments

public void setOpenedDocuments(List<DocumentComponent> documentComponents)
Sets the document list. This method is used along with the LayoutPersistence.

Specified by:
setOpenedDocuments in interface IDocumentPane
Parameters:
documentComponents - the list of documents.

setDocumentEnabled

public 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. Also, although user can't select it anymore, it can still be closed.

Specified by:
setDocumentEnabled in interface IDocumentPane
Parameters:
name - the name of the document.
enabled - true to enable the document and false to disable.

getDocumentComponentFactory

public DocumentComponentFactory getDocumentComponentFactory()
Gets the document component factory. The factory is used in 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.

Returns:
the document component factory.

setDocumentComponentFactory

public void setDocumentComponentFactory(DocumentComponentFactory dockableFrameFactory)
Sets the document component factory.

Parameters:
dockableFrameFactory - the document component factory

getLayoutPersistence

public LayoutPersistence getLayoutPersistence()
Description copied from interface: IDocumentPane
Gets the layout persistence that can be used to persist the documents that are opened in document pane.

Specified by:
getLayoutPersistence in interface IDocumentPane
Returns:
the layout persistence.

dispose

public void dispose()
Disposes the DocumentPane to avoid memory leak. You should call this method when you remove the DocumentPane from its parent and not going to use it again.

Specified by:
dispose in interface IDocumentPane

isShowContextMenu

public boolean isShowContextMenu()
Checks if the context menu should be shown.

Returns:
true if context menu will be shown. Otherwise false.

setShowContextMenu

public void setShowContextMenu(boolean showContextMenu)
Sets the flag to show context menu or not.

Parameters:
showContextMenu - whether the context menu is shown.

createSplitPaneDivider

protected JideSplitPaneDivider createSplitPaneDivider()
Overrides:
createSplitPaneDivider in class JideSplitPane

isHeavyweightComponentEnabled

public boolean isHeavyweightComponentEnabled()
Specified by:
isHeavyweightComponentEnabled in interface IDocumentPane
Overrides:
isHeavyweightComponentEnabled in class JideSplitPane
Returns:
true if the heavyweight component is enabled.

setHeavyweightComponentEnabled

public void setHeavyweightComponentEnabled(boolean heavyweightComponentEnabled)
Enables heavyweight component.

Specified by:
setHeavyweightComponentEnabled in interface IDocumentPane
Overrides:
setHeavyweightComponentEnabled in class JideSplitPane
Parameters:
heavyweightComponentEnabled - whether heavyweight component is used.

getMaximumGroupCount

public int getMaximumGroupCount()
Gets maximum document group count.

Returns:
maximum document group count.
See Also:
setMaximumGroupCount(int)

setMaximumGroupCount

public void setMaximumGroupCount(int maximumGroupCount)
Sets maximum allowed document group.

Parameters:
maximumGroupCount - maximum allowed group count. It should be a number greater then or equal to 0. 0 means unlimited.

getNextAvailableIndex

protected int getNextAvailableIndex(String name)

splitDocument

public void splitDocument(String name,
                          int groupIndex,
                          int orientation)
Splits the current document into two views. It basically clones the component in the document, create a new DocumentComponent for it and put it into a new document group. Please note, the DocumentComponent must implement 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.

Parameters:
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.

isUseGlassPaneEnabled

public boolean isUseGlassPaneEnabled()
Checks if we will use glass pane to change cursor.

Returns:
true or false.
See Also:
setUseGlassPaneEnabled(boolean)

setUseGlassPaneEnabled

public void setUseGlassPaneEnabled(boolean useGlassPaneEnabled)
Enables us to use glass pane to for cursor change purpose.

Parameters:
useGlassPaneEnabled - true or false.

populateContextMenu

public void populateContextMenu(JPopupMenu menu)
Populates the context menu for the DocumentPane. You can call this method to populate your "Windows" menu.

Parameters:
menu - This method will add the menu items to this popup menu. Nothing will be added if there is no document in the DocumentPane.

populateContextMenu

protected void populateContextMenu(JPopupMenu menu,
                                   Component dragComponent,
                                   TdiGroup dragGroup,
                                   TdiGroup dropGroup,
                                   boolean onTab)
Populates the context menu. Internally we used the method to handle all the popup menus during drag-n-drop as well as the context menu when right clicking on the tab. If you want to display

Parameters:
menu - This method will add the menu items to this popup menu.
dragComponent - the dragged tab
dragGroup - the tab group from where the tab is dragged.
dropGroup - the tab group where the tab will be dropped
onTab - whether the drop location is on the tab.

getResourceString

protected String getResourceString(String key)
Gets the resource string used in DocumentPane. Subclass can override it to provide their own strings.

Parameters:
key - the resource key
Returns:
the localized string.

floatDocument

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

Specified by:
floatDocument in interface IDocumentPane
Parameters:
documentName - the document name.

floatDocument

public void floatDocument(String documentName,
                          boolean respectPreviousState)
Floating a document of the specified name.

Parameters:
documentName - the document name.
respectPreviousState - the flag to respect previous floating state. false means to always create new floating container for the frame.

floatDocument

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

Specified by:
floatDocument in interface IDocumentPane
Parameters:
floatingContainer - the floating container.
documentName - the document name.

createFloatingDocumentContainer

protected FloatingDocumentContainer createFloatingDocumentContainer()
Creates the floating container that will be used to contain the floating document. By default, it will return a FloatingDocumentContainer based on JFrame.

Returns:
FloatingDocumentContainer

dockDocument

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

Specified by:
dockDocument in interface IDocumentPane
Parameters:
documentName - the name of document that is floating.

dockDocuments

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

Specified by:
dockDocuments in interface IDocumentPane
Parameters:
container - the floating container.

closeDocuments

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

Specified by:
closeDocuments in interface IDocumentPane
Parameters:
container - the floating container.

isDocumentFloating

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

Specified by:
isDocumentFloating in interface IDocumentPane
Parameters:
documentName - the name of the document
Returns:
true if the document is floating. Otherwise false.

getFloatingContainers

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

Specified by:
getFloatingContainers in interface IDocumentPane
Returns:
the list of floating containers.

getFloatingContainerCloseAction

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

Specified by:
getFloatingContainerCloseAction in interface IDocumentPane
Returns:
the close action.

setFloatingContainerCloseAction

public void setFloatingContainerCloseAction(int floatingContainerCloseAction)
Description copied from interface: IDocumentPane
Sets the action when the native close button is pressed on the floating container. It could be either IDocumentPane.CLOSE_ACTION_TO_CLOSE to close all documents inside the floating container, or IDocumentPane.CLOSE_ACTION_TO_DOCK to dock all documents.

Specified by:
setFloatingContainerCloseAction in interface IDocumentPane
Parameters:
floatingContainerCloseAction - the close action. Valid values are IDocumentPane.CLOSE_ACTION_TO_CLOSE or IDocumentPane.CLOSE_ACTION_TO_DOCK.

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class JComponent

getFloatingContainerTitle

protected String getFloatingContainerTitle(TdiGroup tdiGroup)
Gets the title for the container that contains the floating documents.

Parameters:
tdiGroup - the document group that is in the floating mode.
Returns:
the title for the containers that contains the floating documents.

getFloatingContainerType

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

Specified by:
getFloatingContainerType in interface IDocumentPane
Returns:
the floating container type.
Since:
3.3.7

setFloatingContainerType

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

Specified by:
setFloatingContainerType in interface IDocumentPane
Parameters:
floatingContainerType - the floating container type.
Since:
3.3.7

JIDE 3.5.15