T
- DocumentData
typepublic final class PaneData<T extends DocumentData> extends Object implements StructureData<T>, SwingConstants
WebDocumentPane
Modifier and Type | Field and Description |
---|---|
protected List<T> |
data
Pane documents.
|
protected WebDocumentPane<T> |
documentPane
WebDocumentPane this PaneData belongs to. |
protected DefaultFocusTracker |
focusTracker
Pane focus tracker.
|
protected WebTabbedPane |
tabbedPane
Actual tabbed pane component.
|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
Constructor and Description |
---|
PaneData(WebDocumentPane<T> documentPane)
Constructs new
PaneData for the specified WebDocumentPane . |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates this pane within WebDocumentPane.
|
void |
add(T document)
Adds new document into this pane.
|
void |
add(T document,
int index)
Adds new document into this pane at the specified index.
|
void |
checkSelection()
Checks document pane selection.
|
boolean |
close(int index)
Closes document at the specified index in the active pane.
|
boolean |
close(String id)
Closes document with the specified ID.
|
boolean |
close(T document)
Closes the specified document.
|
boolean |
closeAll()
Closes all document in this group.
|
boolean |
closeOthers(T document)
Closes all documents except the specified one.
|
boolean |
closeSelected()
Closes selected document.
|
boolean |
contains(String documentId)
Returns whether document with the specified ID is in this pane or not.
|
boolean |
contains(T document)
Returns whether specified document is in this pane or not.
|
int |
count()
Returns pane documents count.
|
protected JComponent |
createTabComponent(T document)
Returns new tab component.
|
PaneData<T> |
findClosestPane()
Returns closest
PaneData . |
protected DocumentDataListener<T> |
findDocumentListener(T document)
Returns document listener attached by this pane data class.
|
T |
get(int index)
Returns pane document at the specified index.
|
T |
get(String id)
Returns pane document with the specified ID.
|
Component |
getComponent()
Returns actual
Component behind this StructureData . |
List<T> |
getData()
Returns pane documents.
|
List<String> |
getDocumentIds()
Returns pane document IDs.
|
WebDocumentPane |
getDocumentPane()
Returns parent WebDocumentPane.
|
DocumentPaneState |
getDocumentPaneState()
Returns current
DocumentPaneState for this StructureData . |
T |
getSelected()
Returns pane's selected document.
|
int |
getSelectedIndex()
Returns pane's selected document index.
|
WebTabbedPane |
getTabbedPane()
Returns actual tabbed pane component.
|
int |
indexOf(String id)
Returns index of the document with the specified ID.
|
int |
indexOf(T document)
Returns index of the specified document.
|
boolean |
isActive()
Returns whether this pane is active one within WebDocumentPane or not.
|
void |
merge()
Merges this pane with its neighbour.
|
void |
mergeAll()
Merges all panes within WebDocumentPane.
|
void |
mergeIfEmpty()
Merges this pane with its neighbour if it is empty.
|
void |
open(T document)
Opens document in this pane.
|
boolean |
remove(int index)
Closes document at the specified index in the active pane.
|
boolean |
remove(String id)
Closes document with the specified ID.
|
boolean |
remove(T document)
Closes the specified document.
|
void |
rotate()
Changes parent split orientation if this pane is located within a split.
|
void |
selectNext()
Increments selected document index inside the active pane.
|
void |
selectPrevious()
Decrements selected document index inside the active pane.
|
void |
setDocumentPane(WebDocumentPane<T> documentPane)
Sets parent WebDocumentPane reference.
|
void |
setSelected(int index)
Sets selected document index.
|
void |
setSelected(String id)
Sets pane's selected document ID.
|
void |
setSelected(T document)
Sets selected document.
|
void |
split(T document,
int direction)
Splits the specified document into a separate pane.
|
void |
swap()
Changes parent split sides if this pane is located within a split.
|
void |
updateTabBackground(T document)
Updates tab background for the specified document.
|
protected void |
updateTabbedPaneCustomizer(WebDocumentPane<T> documentPane)
Updates tabbed pane customizer.
|
void |
updateTabComponent(T document)
Updates tab view for the specified document.
|
void |
updateTabTitleComponent(T document)
Updates tab title component for the specified document.
|
void |
updateTabTitleComponents()
Updates all tab title components.
|
protected WebDocumentPane<T extends DocumentData> documentPane
WebDocumentPane
this PaneData
belongs to.
Referenced to properly act when WebDocumentPane
is required to retrieve customizers or perform any operation.protected final WebTabbedPane tabbedPane
protected final DefaultFocusTracker focusTracker
protected List<T extends DocumentData> data
public PaneData(WebDocumentPane<T> documentPane)
PaneData
for the specified WebDocumentPane
.documentPane
- parent WebDocumentPane
public void checkSelection()
protected void updateTabbedPaneCustomizer(WebDocumentPane<T> documentPane)
documentPane
- parent WebDocumentPanepublic Component getComponent()
StructureData
Component
behind this StructureData
.getComponent
in interface StructureData<T extends DocumentData>
Component
behind this StructureData
public PaneData<T> findClosestPane()
StructureData
findClosestPane
in interface StructureData<T extends DocumentData>
PaneData
public DocumentPaneState getDocumentPaneState()
StructureData
DocumentPaneState
for this StructureData
.
Might return null
when last side's document is dragged or moved or something is splitted/merged.getDocumentPaneState
in interface StructureData<T extends DocumentData>
DocumentPaneState
for this StructureData
DocumentPaneState
public WebDocumentPane getDocumentPane()
public void setDocumentPane(WebDocumentPane<T> documentPane)
documentPane
- parent WebDocumentPane referencepublic WebTabbedPane getTabbedPane()
public List<String> getDocumentIds()
public int count()
public boolean contains(T document)
document
- document to look forpublic boolean contains(String documentId)
documentId
- ID of the document to look forpublic void add(T document)
document
- document to addpublic void add(T document, int index)
document
- document to addindex
- index to add atprotected JComponent createTabComponent(T document)
document
- document to create tab component forpublic void updateTabTitleComponents()
public void updateTabTitleComponent(T document)
document
- document to update tab title component forpublic void updateTabBackground(T document)
document
- document to update tab background forpublic void updateTabComponent(T document)
document
- document to update tab view forpublic void open(T document)
document
- document to openpublic T get(int index)
index
- document indexpublic T get(String id)
id
- document IDpublic T getSelected()
public int getSelectedIndex()
public void setSelected(String id)
id
- ID of the document to selectpublic void setSelected(T document)
document
- document to selectpublic void setSelected(int index)
index
- index of the document to selectpublic void selectPrevious()
public void selectNext()
public int indexOf(String id)
id
- document IDpublic int indexOf(T document)
document
- documentpublic boolean remove(int index)
index
- index of the document to closepublic boolean remove(String id)
id
- ID of the document to closepublic boolean remove(T document)
document
- document to closeprotected DocumentDataListener<T> findDocumentListener(T document)
document
- listened documentpublic boolean closeAll()
true
if all documents were successfully closed, false
otherwisepublic boolean close(int index)
index
- index of the document to closetrue
if document was successfully closed, false
otherwisepublic boolean close(String id)
id
- ID of the document to closetrue
if document was successfully closed, false
otherwisepublic boolean close(T document)
document
- document to closetrue
if document was successfully closed, false
otherwisepublic boolean closeOthers(T document)
document
- document to keep openedtrue
if all documents were successfully closed, false
otherwisepublic boolean closeSelected()
true
if selected document was successfully closed, false
otherwisepublic void activate()
public boolean isActive()
public void split(T document, int direction)
document
- document to splitdirection
- split directionpublic void mergeIfEmpty()
public void rotate()
public void swap()
public void merge()
public void mergeAll()
Copyright © 2020. All rights reserved.