com.vlsolutions.swing.docking

Class DockTabbedPane

Implemented Interfaces:
DockableContainer, DockableDragSource, DockDropReceiver, TabbedDockableContainer

public class DockTabbedPane
extends JTabbedPane
implements DockDropReceiver, DockableDragSource, TabbedDockableContainer

A JTabbedPane customized for integration with the docking framework.

Defaults :

This tabbed pane is not meant to be used outside of DockingDesktop because of their connected behaviour (drag/drop support, docking constraints, etc).

As of version 2.0 of the framework, the tabbed pane displays a close icon (other functions are available with a right click menu).

See Also:
DockingDesktop

Field Summary

protected DockingDesktop
desktop
protected JPopupMenu
popup
The pop-up menu used to provide fast "close" shortcuts (close all, close others)
protected int
popupTab
the tab currently associated with the pop-up
protected int
previousSelectedDockable
The tab that was selected before the current one

Constructor Summary

DockTabbedPane()

Method Summary

void
addDockable(Dockable dockable, int tab)
Adds a new tab respecting the presentation and constraints of the component.
protected GeneralPath
buildPathAfterLastTab(Rectangle vbounds, Rectangle afterlast)
Creates a general path suitable for showing tab insertion after the last tab
protected GeneralPath
buildPathForCurrentTab(Rectangle vbounds, Rectangle tabbounds)
Creates a general path suitable for showing tab insertion before the currentTab
void
endDragComponent(boolean dropped)
notifies the source when the drag operation has ended (by a drop or cancelled)
Dockable
getDockable()
Dockable
getDockableAt(int index)
Container
getDockableContainer()
returns the DockableContainer responsible for displaying the associated dockable
int
getDockableIndex(DockKey key)
Returns the tab index of the dockable corresponding to the given key, or null if the dockable doesn't belong to this tab.
Dockable
getSelectedDockable()
int
indexOfDockable(Dockable dockable)
void
installDocking(DockingDesktop desktop)
void
processDockableDrag(DockDragEvent e)
void
processDockableDrop(DockDropEvent event)
void
removeDockable(Dockable dockable)
void
removeDockable(int index)
void
setSelectedDockable(Dockable dockable)
boolean
startDragComponent(Point p)
String
toString()
void
uninstallDocking(DockingDesktop desktop)

Field Details

desktop

protected DockingDesktop desktop

popup

protected JPopupMenu popup
The pop-up menu used to provide fast "close" shortcuts (close all, close others)

popupTab

protected int popupTab
the tab currently associated with the pop-up

previousSelectedDockable

protected int previousSelectedDockable
The tab that was selected before the current one

Constructor Details

DockTabbedPane

public DockTabbedPane()

Method Details

addDockable

public void addDockable(Dockable dockable,
                        int tab)
Adds a new tab respecting the presentation and constraints of the component.
Specified by:
addDockable in interface TabbedDockableContainer

buildPathAfterLastTab

protected GeneralPath buildPathAfterLastTab(Rectangle vbounds,
                                            Rectangle afterlast)
Creates a general path suitable for showing tab insertion after the last tab

buildPathForCurrentTab

protected GeneralPath buildPathForCurrentTab(Rectangle vbounds,
                                             Rectangle tabbounds)
Creates a general path suitable for showing tab insertion before the currentTab

endDragComponent

public void endDragComponent(boolean dropped)
notifies the source when the drag operation has ended (by a drop or cancelled)
Specified by:
endDragComponent in interface DockableDragSource
Since:
2.1.3

getDockable

public Dockable getDockable()
Specified by:
getDockable in interface DockableDragSource

getDockableAt

public Dockable getDockableAt(int index)
Specified by:
getDockableAt in interface TabbedDockableContainer

getDockableContainer

public Container getDockableContainer()
returns the DockableContainer responsible for displaying the associated dockable
Specified by:
getDockableContainer in interface DockableDragSource

getDockableIndex

public int getDockableIndex(DockKey key)
Returns the tab index of the dockable corresponding to the given key, or null if the dockable doesn't belong to this tab.

getSelectedDockable

public Dockable getSelectedDockable()
Specified by:
getSelectedDockable in interface TabbedDockableContainer

indexOfDockable

public int indexOfDockable(Dockable dockable)
Specified by:
indexOfDockable in interface TabbedDockableContainer

installDocking

public void installDocking(DockingDesktop desktop)
Specified by:
installDocking in interface DockableContainer

processDockableDrag

public void processDockableDrag(DockDragEvent e)
Specified by:
processDockableDrag in interface DockDropReceiver

processDockableDrop

public void processDockableDrop(DockDropEvent event)
Specified by:
processDockableDrop in interface DockDropReceiver

removeDockable

public void removeDockable(Dockable dockable)
Specified by:
removeDockable in interface TabbedDockableContainer

removeDockable

public void removeDockable(int index)
Specified by:
removeDockable in interface TabbedDockableContainer

setSelectedDockable

public void setSelectedDockable(Dockable dockable)
Specified by:
setSelectedDockable in interface TabbedDockableContainer

startDragComponent

public boolean startDragComponent(Point p)
Specified by:
startDragComponent in interface DockableDragSource

toString

public String toString()

uninstallDocking

public void uninstallDocking(DockingDesktop desktop)
Specified by:
uninstallDocking in interface DockableContainer

© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications