com.alee.extended.tab
Class PaneData<T extends DocumentData>

java.lang.Object
  extended by com.alee.extended.tab.PaneData<T>
All Implemented Interfaces:
StructureData<T>, javax.swing.SwingConstants

public final class PaneData<T extends DocumentData>
extends java.lang.Object
implements StructureData<T>, javax.swing.SwingConstants

Data for single tabbed pane within document pane. It basically contains tabbed pane and opened documents list.

Author:
Mikle Garin
See Also:
How to use WebDocumentPane, WebDocumentPane

Field Summary
protected  java.util.List<T> data
          Pane documents.
protected  DefaultFocusTracker focusTracker
          Pane focus tracker.
protected  WebTabbedPane tabbedPane
          Actual tabbed pane component.
 
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
 
Constructor Summary
PaneData(WebDocumentPane<T> documentPane)
          Constructs new PaneData for the specified WebDocumentPane.
 
Method Summary
 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.
 boolean close(int index)
          Closes document at the specified index in the active pane.
 boolean close(java.lang.String id)
          Closes document with the specified ID.
 boolean close(T document)
          Closes the specified document.
 void closeAll()
          Closes all document in this group.
 void closeSelected()
          Closes selected document.
 boolean contains(java.lang.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  javax.swing.JComponent createTabComponent(T document)
          Returns new tab component.
 PaneData<T> findClosestPane()
          Returns closest PaneData.
 T get(int index)
          Returns pane document at the specified index.
 T get(java.lang.String id)
          Returns pane document with the specified ID.
 java.awt.Component getComponent()
          Returns actual component behind this structure element.
 java.util.List<T> getData()
          Returns pane documents.
 WebDocumentPane getDocumentPane()
          Returns parent WebDocumentPane.
 T getSelected()
          Returns pane's selected document.
 WebTabbedPane getTabbedPane()
          Returns actual tabbed pane component.
 int indexOf(java.lang.String id)
          Returns index of the document with the specified ID.
 int indexOf(T document)
          Returns index of the specified document.
 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(java.lang.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 setSelected(int index)
          Sets selected document index.
 void setSelected(java.lang.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.
protected  void updateTabbedPaneCustomizer(WebDocumentPane<T> documentPane)
          Updates tabbed pane customizer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tabbedPane

protected final WebTabbedPane tabbedPane
Actual tabbed pane component.


focusTracker

protected final DefaultFocusTracker focusTracker
Pane focus tracker.


data

protected java.util.List<T extends DocumentData> data
Pane documents.

Constructor Detail

PaneData

public PaneData(WebDocumentPane<T> documentPane)
Constructs new PaneData for the specified WebDocumentPane.

Parameters:
documentPane - parent WebDocumentPane
Method Detail

updateTabbedPaneCustomizer

protected void updateTabbedPaneCustomizer(WebDocumentPane<T> documentPane)
Updates tabbed pane customizer.

Parameters:
documentPane - parent WebDocumentPane

getComponent

public java.awt.Component getComponent()
Returns actual component behind this structure element.

Specified by:
getComponent in interface StructureData<T extends DocumentData>
Returns:
actual component behind this structure element

findClosestPane

public PaneData<T> findClosestPane()
Returns closest PaneData. Used to provide default active pane.

Specified by:
findClosestPane in interface StructureData<T extends DocumentData>
Returns:
closest PaneData

getDocumentPane

public WebDocumentPane getDocumentPane()
Returns parent WebDocumentPane.

Returns:
parent WebDocumentPane

getTabbedPane

public WebTabbedPane getTabbedPane()
Returns actual tabbed pane component.

Returns:
actual tabbed pane component

getData

public java.util.List<T> getData()
Returns pane documents.

Returns:
pane documents

count

public int count()
Returns pane documents count.

Returns:
pane documents count

contains

public boolean contains(T document)
Returns whether specified document is in this pane or not.

Parameters:
document - document to look for
Returns:
true if specified document is in this pane, false otherwise

contains

public boolean contains(java.lang.String documentId)
Returns whether document with the specified ID is in this pane or not.

Parameters:
documentId - ID of the document to look for
Returns:
true if document with the specified ID is in this pane, false otherwise

add

public void add(T document)
Adds new document into this pane.

Parameters:
document - document to add

add

public void add(T document,
                int index)
Adds new document into this pane at the specified index.

Parameters:
document - document to add
index - index to add at

createTabComponent

protected javax.swing.JComponent createTabComponent(T document)
Returns new tab component.

Parameters:
document - document to create tab component for
Returns:
new tab component

open

public void open(T document)
Opens document in this pane. Unlike add method this one informs listeners about opened document.

Parameters:
document - document to open

get

public T get(int index)
Returns pane document at the specified index.

Parameters:
index - document index
Returns:
pane document at the specified index

get

public T get(java.lang.String id)
Returns pane document with the specified ID.

Parameters:
id - document ID
Returns:
pane document with the specified ID

getSelected

public T getSelected()
Returns pane's selected document.

Returns:
pane's selected document

setSelected

public void setSelected(java.lang.String id)
Sets pane's selected document ID.

Parameters:
id - ID of the document to select

setSelected

public void setSelected(T document)
Sets selected document.

Parameters:
document - document to select

setSelected

public void setSelected(int index)
Sets selected document index.

Parameters:
index - index of the document to select

indexOf

public int indexOf(java.lang.String id)
Returns index of the document with the specified ID.

Parameters:
id - document ID
Returns:
index of the document with the specified ID

indexOf

public int indexOf(T document)
Returns index of the specified document.

Parameters:
document - document
Returns:
index of the specified document

remove

public boolean remove(int index)
Closes document at the specified index in the active pane.

Parameters:
index - index of the document to close

remove

public boolean remove(java.lang.String id)
Closes document with the specified ID.

Parameters:
id - ID of the document to close

remove

public boolean remove(T document)
Closes the specified document.

Parameters:
document - document to close

closeAll

public void closeAll()
Closes all document in this group.


close

public boolean close(int index)
Closes document at the specified index in the active pane.

Parameters:
index - index of the document to close

close

public boolean close(java.lang.String id)
Closes document with the specified ID.

Parameters:
id - ID of the document to close

close

public boolean close(T document)
Closes the specified document.

Parameters:
document - document to close

closeSelected

public void closeSelected()
Closes selected document.


activate

public void activate()
Activates this pane within WebDocumentPane.


split

public void split(T document,
                  int direction)
Splits the specified document into a separate pane.

Parameters:
document - document to split
direction - split direction

mergeIfEmpty

public void mergeIfEmpty()
Merges this pane with its neighbour if it is empty.


rotate

public void rotate()
Changes parent split orientation if this pane is located within a split.


merge

public void merge()
Merges this pane with its neighbour.


mergeAll

public void mergeAll()
Merges all panes within WebDocumentPane.