|
||||||||||
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.alee.laf.panel.WebPanel com.alee.extended.tab.WebDocumentPane<T>
T
- document typepublic class WebDocumentPane<T extends DocumentData>
This component is basically a special container for customizable documents described by DocumentData class. You can also override DocumentData class and for example include your own data into the document itself.
This component uses either single or multiply tabbed panes and allow tabs reorder, drag, split and closability. All those features are of course configurable within the WebDocumentPane instance.
PaneData
,
SplitData
,
DocumentData
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected PaneData<T> |
activePane
Last active pane. |
protected boolean |
closeable
Whether documents can be closed or not. |
protected static java.lang.String |
DATA_KEY
Constant key used to put pane element data into the UI component. |
protected boolean |
dragBetweenPanesEnabled
Whether documents drag between tabbed panes is enabled or not. |
protected boolean |
dragEnabled
Whether documents drag enabled or not. |
protected java.lang.String |
id
Unique document pane ID. |
protected java.util.List<DocumentListener<T>> |
listeners
Document listeners. |
protected StructureData |
root
Root structure element. |
protected boolean |
splitEnabled
Whether split creation is enabled or not. |
protected Customizer<WebSplitPane> |
splitPaneCustomizer
Document customizer. |
protected Customizer<WebTabbedPane> |
tabbedPaneCustomizer
Tabbed panes customizer. |
protected boolean |
tabMenuEnabled
Whether tab menu is enabled or not. |
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 java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
WebDocumentPane()
Constructs new document pane. |
|
WebDocumentPane(Customizer<WebTabbedPane> tabbedPaneCustomizer,
Customizer<WebSplitPane> splitPaneCustomizer)
Constructs new document pane. |
Method Summary | ||
---|---|---|
protected void |
activate(PaneData<T> paneData)
Sets active pane. |
|
protected void |
activate(T document)
Sets active pane. |
|
void |
addDocumentListener(DocumentListener<T> listener)
Adds document listener. |
|
void |
closeAll()
Closes all documents. |
|
void |
closeDocument(int index)
Closes document at the specified index in the active pane. |
|
void |
closeDocument(java.lang.String id)
Closes document with the specified ID. |
|
void |
closeDocument(T document)
Closes the specified document. |
|
protected void |
collectPanes(StructureData structureData,
java.util.List<PaneData<T>> panes)
Collects all PaneData available under the specified stucture element into list. |
|
protected void |
collectSplitPanes(StructureData structureData,
java.util.List<SplitData<T>> splits)
Collects all SplitData available under the specified stucture element into list. |
|
void |
fireDocumentClosed(T document,
PaneData<T> pane,
int index)
Fires document closed event. |
|
boolean |
fireDocumentClosing(T document,
PaneData<T> pane,
int index)
Fires document closing event. |
|
void |
fireDocumentOpened(T document,
PaneData<T> pane,
int index)
Fires document opened event. |
|
PaneData<T> |
getActivePane()
Returns currently active pane data. |
|
java.util.List<PaneData<T>> |
getAllPanes()
Returns list of all available panes within this document pane. |
|
java.util.List<SplitData<T>> |
getAllSplitPanes()
Returns list of all available split panes within this document pane. |
|
static
|
getData(WebSplitPane splitPane)
Returns split data stored inside the split pane component. |
|
static
|
getData(WebTabbedPane tabbedPane)
Returns pane data stored inside the tabbed pane component. |
|
T |
getDocument(int index)
Returns document at the specified tab index of the active pane. |
|
T |
getDocument(java.lang.String id)
Returns document with the specified ID or null if it is not inside this document pane. |
|
java.util.List<T> |
getDocuments()
Returns all documents opened in this document pane. |
|
int |
getDocumentsCount()
Returns amount of documents opened in this document pane. |
|
java.lang.String |
getId()
Returns unique document pane ID. |
|
PaneData<T> |
getPane(java.lang.String documentId)
Returns pane that contains document with the specified ID. |
|
PaneData<T> |
getPane(T document)
Returns pane that contains specified document. |
|
T |
getSelectedDocument()
Returns selected document data. |
|
Customizer<WebSplitPane> |
getSplitPaneCustomizer()
Returns split pane customizer. |
|
StructureData |
getStructureRoot()
Returns current root element data. |
|
Customizer<WebTabbedPane> |
getTabbedPaneCustomizer()
Returns tabbed pane customizer. |
|
protected void |
init()
Initializes root and active pane. |
|
boolean |
isCloseable()
Returns whether tabs in this document pane are globally closable or not. |
|
boolean |
isDocumentOpened(java.lang.String documentId)
Returns whether document with the specified ID is opened inside this document pane or not. |
|
boolean |
isDocumentOpened(T document)
Returns whether specified document is opened inside this document pane or not. |
|
boolean |
isDragBetweenPanesEnabled()
Returns whether tabs drag between different tabbed panes is enabled or not. |
|
boolean |
isDragEnabled()
Returns whether tabs drag is enabled or not. |
|
static boolean |
isEmptyPane(StructureData data)
Returns whether the specified element is an empty pane or not. |
|
boolean |
isSplitEnabled()
Returns whether split creation is enabled or not. |
|
boolean |
isTabMenuEnabled()
Returns whether tab menu is enabled or not. |
|
void |
merge(StructureData toMerge)
Merges specified structure element and its sub-elements if it is possible. |
|
protected void |
mergeImpl(SplitData<T> splitData)
Merges specified split element and its sub-elements if it is possible. |
|
void |
openDocument(T document)
Opens document in this document pane. |
|
void |
removeDocumentListener(DocumentListener<T> listener)
Removes document listener. |
|
void |
setCloseable(boolean closeable)
Sets whether tabs in this document pane should be globally closable or not. |
|
void |
setDragBetweenPanesEnabled(boolean dragBetweenPanesEnabled)
Sets whether tabs drag between different tabbed panes is enabled or not. |
|
void |
setDragEnabled(boolean dragEnabled)
Sets whether tabs drag is enabled or not. |
|
void |
setSelected(DocumentData document)
Sets document selected inside its pane. |
|
void |
setSelected(int index)
Sets selected document index inside the active pane. |
|
void |
setSelected(java.lang.String id)
Sets document with the specified ID selected inside its pane. |
|
void |
setSplitEnabled(boolean splitEnabled)
Sets whether split creation is enabled or not. |
|
void |
setSplitPaneCustomizer(Customizer<WebSplitPane> customizer)
Sets split pane customizer and applies it to existing panes. |
|
void |
setStructureRoot(StructureData root)
Sets new root element data. |
|
void |
setTabbedPaneCustomizer(Customizer<WebTabbedPane> customizer)
Sets tabbed pane customizer and applies it to existing panes. |
|
void |
setTabMenuEnabled(boolean tabMenuEnabled)
Sets whether tab menu is enabled or not. |
|
protected PaneData<T> |
split(PaneData<T> splittedPane,
T movedDocument,
int direction)
Splits specified pane into two panes using the specified direction to decide split settings. |
|
void |
split(T movedDocument,
int direction)
Splits document's pane into two panes using the specified direction to decide split settings. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, 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, getBackground, 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 |
---|
protected static final java.lang.String DATA_KEY
protected java.util.List<DocumentListener<T extends DocumentData>> listeners
protected final java.lang.String id
protected StructureData root
protected PaneData<T extends DocumentData> activePane
protected Customizer<WebTabbedPane> tabbedPaneCustomizer
protected Customizer<WebSplitPane> splitPaneCustomizer
protected boolean closeable
protected boolean dragEnabled
protected boolean dragBetweenPanesEnabled
protected boolean splitEnabled
protected boolean tabMenuEnabled
Constructor Detail |
---|
public WebDocumentPane()
public WebDocumentPane(Customizer<WebTabbedPane> tabbedPaneCustomizer, Customizer<WebSplitPane> splitPaneCustomizer)
Method Detail |
---|
public java.lang.String getId()
public Customizer<WebTabbedPane> getTabbedPaneCustomizer()
public void setTabbedPaneCustomizer(Customizer<WebTabbedPane> customizer)
customizer
- new tabbed pane customizerpublic Customizer<WebSplitPane> getSplitPaneCustomizer()
public void setSplitPaneCustomizer(Customizer<WebSplitPane> customizer)
customizer
- new split pane customizerpublic boolean isCloseable()
public void setCloseable(boolean closeable)
closeable
- whether tabs in this document pane should be globally closable or notpublic boolean isDragEnabled()
public void setDragEnabled(boolean dragEnabled)
dragEnabled
- whether tabs drag is enabled or notpublic boolean isDragBetweenPanesEnabled()
public void setDragBetweenPanesEnabled(boolean dragBetweenPanesEnabled)
dragBetweenPanesEnabled
- whether tabs drag between different tabbed panes is enabled or notpublic boolean isSplitEnabled()
public void setSplitEnabled(boolean splitEnabled)
splitEnabled
- true if split creation is enabled, false otherwisepublic boolean isTabMenuEnabled()
public void setTabMenuEnabled(boolean tabMenuEnabled)
tabMenuEnabled
- whether tab menu is enabled or notpublic StructureData getStructureRoot()
public void setStructureRoot(StructureData root)
root
- new root element dataprotected void init()
public void split(T movedDocument, int direction)
movedDocument
- document that should be moved to new panedirection
- split directionprotected PaneData<T> split(PaneData<T> splittedPane, T movedDocument, int direction)
splittedPane
- pane that will be splittedmovedDocument
- document that should be moved from splitted pane to new onedirection
- split direction
public void merge(StructureData toMerge)
toMerge
- structure element to mergeprotected void mergeImpl(SplitData<T> splitData)
splitData
- split element to mergepublic PaneData<T> getActivePane()
protected void activate(PaneData<T> paneData)
paneData
- new active paneprotected void activate(T document)
document
- document to activatepublic T getSelectedDocument()
public T getDocument(int index)
index
- active pane tab index
public T getDocument(java.lang.String id)
id
- document ID
public java.util.List<T> getDocuments()
public int getDocumentsCount()
public java.util.List<PaneData<T>> getAllPanes()
protected void collectPanes(StructureData structureData, java.util.List<PaneData<T>> panes)
structureData
- structure elementpanes
- PaneData listpublic java.util.List<SplitData<T>> getAllSplitPanes()
protected void collectSplitPanes(StructureData structureData, java.util.List<SplitData<T>> splits)
structureData
- structure elementsplits
- SplitData listpublic PaneData<T> getPane(T document)
document
- document to look for
public PaneData<T> getPane(java.lang.String documentId)
documentId
- ID of the document to look for
public void setSelected(int index)
index
- index of the document to selectpublic void setSelected(DocumentData document)
document
- document to selectpublic void setSelected(java.lang.String id)
id
- ID of the document to selectpublic boolean isDocumentOpened(T document)
document
- document to look for
public boolean isDocumentOpened(java.lang.String documentId)
documentId
- ID of the document to look for
public void openDocument(T document)
document
- document to openpublic void closeDocument(int index)
index
- index of the document to closepublic void closeDocument(java.lang.String id)
id
- ID of the document to closepublic void closeDocument(T document)
document
- document to closepublic void closeAll()
public void addDocumentListener(DocumentListener<T> listener)
listener
- new document listenerpublic void removeDocumentListener(DocumentListener<T> listener)
listener
- document listenerpublic void fireDocumentOpened(T document, PaneData<T> pane, int index)
document
- opened documentpane
- document's paneindex
- document's indexpublic boolean fireDocumentClosing(T document, PaneData<T> pane, int index)
document
- closing documentpane
- document's paneindex
- document's index
public void fireDocumentClosed(T document, PaneData<T> pane, int index)
document
- closed documentpane
- document's paneindex
- document's indexpublic static <T extends DocumentData> PaneData<T> getData(WebTabbedPane tabbedPane)
T
- document typetabbedPane
- tabbed pane component
public static <T extends DocumentData> SplitData<T> getData(WebSplitPane splitPane)
T
- document typesplitPane
- split pane component
public static boolean isEmptyPane(StructureData data)
data
- structure element to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |