|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXTaskPane
public class JXTaskPane
JXTaskPane is a container for tasks and other
arbitrary components.
Several JXTaskPanes are usually grouped together within a
JXTaskPaneContainer. However it is not mandatory
to use a JXTaskPaneContainer as the parent for JXTaskPane. The JXTaskPane can
be added to any other container. See
JXTaskPaneContainer to understand the benefits of
using it as the parent container.
JXTaskPane provides control to expand and
collapse the content area in order to show or hide the task list. It can have an
icon, a title and can be marked as
special. Marking a JXTaskPane as
special (setSpecial(boolean) is only a hint for
the pluggable UI which will usually paint it differently (by example by
using another color for the border of the pane).
When the JXTaskPane is expanded or collapsed, it will be
animated with a fade effect. The animated can be disabled on a per
component basis through setAnimated(boolean).
To disable the animation for all newly created JXTaskPane,
use the UIManager property:
UIManager.put("TaskPane.animate", Boolean.FALSE);.
Example:
JXFrame frame = new JXFrame();
// a container to put all JXTaskPane together
JXTaskPaneContainer taskPaneContainer = new JXTaskPaneContainer();
// create a first taskPane with common actions
JXTaskPane actionPane = new JXTaskPane();
actionPane.setTitle("Files and Folders");
actionPane.setSpecial(true);
// actions can be added, a hyperlink will be created
Action renameSelectedFile = createRenameFileAction();
actionPane.add(renameSelectedFile);
actionPane.add(createDeleteFileAction());
// add this taskPane to the taskPaneContainer
taskPaneContainer.add(actionPane);
// create another taskPane, it will show details of the selected file
JXTaskPane details = new JXTaskPane();
details.setTitle("Details");
// add standard components to the details taskPane
JLabel searchLabel = new JLabel("Search:");
JTextField searchField = new JTextField("");
details.add(searchLabel);
details.add(searchField);
taskPaneContainer.add(details);
// put the action list on the left
frame.add(taskPaneContainer, BorderLayout.EAST);
// and a file browser in the middle
frame.add(fileBrowser, BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
JXTaskPaneContainer,
JXCollapsiblePane,
Serialized Form| Nested Class Summary |
|---|
| 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.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static String |
ANIMATED_CHANGED_KEY
Used when generating PropertyChangeEvents for the "animated" property |
static String |
ICON_CHANGED_KEY
Used when generating PropertyChangeEvents for the "icon" property |
static String |
SCROLL_ON_EXPAND_CHANGED_KEY
Used when generating PropertyChangeEvents for the "scrollOnExpand" property |
static String |
SPECIAL_CHANGED_KEY
Used when generating PropertyChangeEvents for the "special" property |
static String |
TITLE_CHANGED_KEY
Used when generating PropertyChangeEvents for the "title" property |
static String |
uiClassID
JXTaskPane pluggable UI key swingx/TaskPaneUI |
| 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 java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JXTaskPane()
Creates a new empty JXTaskPane. |
|
| Method Summary | |
|---|---|
Component |
add(Action action)
Adds an action to this JXTaskPane. |
protected void |
addImpl(Component comp,
Object constraints,
int index)
Overridden to redirect call to the content pane. |
Container |
getContentPane()
Returns the contentPane object for this JXTaskPane. |
Icon |
getIcon()
Returns the icon currently displayed in the border of this pane. |
String |
getTitle()
Returns the title currently displayed in the border of this pane. |
String |
getUIClassID()
Returns the name of the L&F class that renders this component. |
Container |
getValidatingContainer()
|
boolean |
isAnimated()
Returns true if this task pane is animated during expand/collapse transition. |
boolean |
isCollapsed()
Returns the collapsed state of this task pane. |
boolean |
isScrollOnExpand()
Should this group scroll to be visible after this group was expanded. |
boolean |
isSpecial()
Returns true if this pane is "special". |
protected String |
paramString()
Returns a string representation of this JPanel. |
void |
remove(Component comp)
Overridden to redirect call to the content pane |
void |
remove(int index)
Overridden to redirect call to the content pane. |
void |
removeAll()
Overridden to redirect call to the content pane. |
void |
setAnimated(boolean animated)
Enables or disables animation during expand/collapse transition. |
void |
setCollapsed(boolean collapsed)
Expands or collapses this group. |
void |
setIcon(Icon icon)
Sets the icon to be displayed in the border of this pane. |
void |
setLayout(LayoutManager mgr)
Overridden to redirect call to the content pane. |
void |
setScrollOnExpand(boolean scrollOnExpand)
Should this group be scrolled to be visible on expand. |
void |
setSpecial(boolean special)
Sets this pane to be "special" or not. |
void |
setTitle(String title)
Sets the title to be displayed in the border of this pane. |
void |
setUI(TaskPaneUI ui)
Sets the L&F object that renders this component. |
void |
updateUI()
Notification from the UIManager that the L&F has changed. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, setUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String uiClassID
public static final String SCROLL_ON_EXPAND_CHANGED_KEY
public static final String TITLE_CHANGED_KEY
public static final String ICON_CHANGED_KEY
public static final String SPECIAL_CHANGED_KEY
public static final String ANIMATED_CHANGED_KEY
| Constructor Detail |
|---|
public JXTaskPane()
JXTaskPane.
| Method Detail |
|---|
public Container getContentPane()
public void updateUI()
UIManager that the L&F has changed.
Replaces the current UI object with the latest version from the UIManager.
updateUI in class JPanelJComponent.updateUI()public void setUI(TaskPaneUI ui)
ui - the TaskPaneUI L&F objectUIDefaults.getUI(javax.swing.JComponent)public String getUIClassID()
getUIClassID in class JPaneluiClassIDJComponent.getUIClassID(),
UIDefaults.getUI(javax.swing.JComponent)public String getTitle()
public void setTitle(String title)
title - the title to be displayed in the border of this panepublic Icon getIcon()
public void setIcon(Icon icon)
icon - the icon to be displayed in the border of this panepublic boolean isSpecial()
setSpecial(boolean)public void setSpecial(boolean special)
JXTaskPane
as special is only a hint for the pluggable UI which will
usually paint it differently (by example by using another color for the
border of the pane).
Usually the first JXTaskPane in a JXTaskPaneContainer is marked as special because it contains the default set of actions which can be executed given the current context.
special - true if this pane is "special", false otherwisepublic void setScrollOnExpand(boolean scrollOnExpand)
scrollOnExpand - true to scroll this group to be
visible if this group is expanded.setCollapsed(boolean)public boolean isScrollOnExpand()
public void setCollapsed(boolean collapsed)
collapsed - true to collapse the group, false to expand itpublic boolean isCollapsed()
true if the task pane is collapsed; false
otherwisepublic void setAnimated(boolean animated)
animated - public boolean isAnimated()
public Component add(Action action)
JXTaskPane. Returns a
component built from the action. The returned component has been
added to the JXTaskPane.
action -
public Container getValidatingContainer()
getValidatingContainer in interface JXCollapsiblePane.CollapsiblePaneContainerJXCollapsiblePane.CollapsiblePaneContainer
protected void addImpl(Component comp,
Object constraints,
int index)
addImpl in class Containercomp - the component to be addedconstraints - an object expressing layout constraints
for this componentindex - the position in the container's list at which to
insert the component, where -1
means append to the endContainer.add(Component),
Container.add(Component, int),
Container.add(Component, java.lang.Object),
LayoutManager,
LayoutManager2public void setLayout(LayoutManager mgr)
setLayout in class Containermgr - the specified layout managerContainer.doLayout(),
Container.getLayout()public void remove(Component comp)
remove in class Containercomp - the component to be removedContainer.add(java.awt.Component),
Container.remove(int)public void remove(int index)
remove in class Containerindex - the index of the component to be removedContainer.add(java.awt.Component)public void removeAll()
removeAll in class ContainerContainer.add(java.awt.Component),
Container.remove(int)protected String paramString()
javax.swing.JPanelnull.
paramString in class JPanelJComponent.paramString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||