|
|||||||||
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
com.l2fprod.common.swing.JTaskPaneGroup
public class JTaskPaneGroup
JTaskPaneGroup
is a container for tasks and other
arbitrary components.
Several JTaskPaneGroup
s are usually grouped together within a
JTaskPane
. However it is not mandatory
to use a JTaskPane as the parent for JTaskPaneGroup. The JTaskPaneGroup can
be added to any other container. See
JTaskPane
to understand the benefits of
using it as the parent container.
JTaskPaneGroup
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 JTaskPaneGroup
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).
When the JTaskPaneGroup 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 JTaskPaneGroup
,
use the UIManager property:
UIManager.put("TaskPaneGroup.animate", Boolean.FALSE);
.
Example:
JXFrame frame = new JXFrame();
// a container to put all JTaskPaneGroup together
JTaskPane taskPaneContainer = new JTaskPane();
// create a first taskPane with common actions
JTaskPaneGroup actionPane = new JTaskPaneGroup();
actionPane.setTitle("Files and Folders");
actionPane.setSpecial(true);
// actions can be added, an 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
JTaskPaneGroup details = new JTaskPaneGroup();
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);
JTaskPane
,
JCollapsiblePane
,
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 | |
---|---|
static java.lang.String |
ANIMATED_CHANGED_KEY
Used when generating PropertyChangeEvents for the "animated" property |
static java.lang.String |
COLLAPSABLE_CHANGED_KEY
Used when generating PropertyChangeEvents for the "collapsable" property |
static java.lang.String |
EXPANDED_CHANGED_KEY
Used when generating PropertyChangeEvents for the "expanded" property |
static java.lang.String |
ICON_CHANGED_KEY
Used when generating PropertyChangeEvents for the "icon" property |
static java.lang.String |
SCROLL_ON_EXPAND_CHANGED_KEY
Used when generating PropertyChangeEvents for the "scrollOnExpand" property |
static java.lang.String |
SPECIAL_CHANGED_KEY
Used when generating PropertyChangeEvents for the "special" property |
static java.lang.String |
TITLE_CHANGED_KEY
Used when generating PropertyChangeEvents for the "title" property |
static java.lang.String |
UI_CLASS_ID
|
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 | |
---|---|
JTaskPaneGroup()
Creates a new empty JTaskPaneGroup . |
Method Summary | |
---|---|
java.awt.Component |
add(javax.swing.Action action)
Adds an action to this JTaskPaneGroup . |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int index)
Overriden to redirect call to the content pane. |
java.awt.Container |
getContentPane()
Returns the contentPane object for this JTaskPaneGroup. |
javax.swing.Icon |
getIcon()
Returns the icon currently displayed in the border of this pane. |
java.lang.String |
getText()
Deprecated. |
java.lang.String |
getTitle()
Returns the title currently displayed in the border of this pane. |
java.lang.String |
getUIClassID()
Returns the name of the L&F class that renders this component. |
java.awt.Container |
getValidatingContainer()
|
boolean |
isAnimated()
Returns true if this taskpane is animated during expand/collapse transition. |
boolean |
isCollapsable()
|
boolean |
isExpanded()
Returns true if this taskpane is expanded, false if it is collapsed. |
boolean |
isFocusable()
Overriden to prevent focus to group header when group is not collapsable |
boolean |
isScrollOnExpand()
Should this group scroll to be visible after this group was expanded. |
boolean |
isSpecial()
Returns true if this pane is "special". |
protected java.lang.String |
paramString()
|
void |
remove(java.awt.Component comp)
Overriden to redirect call to the content pane |
void |
remove(int index)
Overriden to redirect call to the content pane. |
void |
removeAll()
Overriden to redirect call to the content pane. |
void |
setAnimated(boolean animated)
Enables or disables animation during expand/collapse transition. |
void |
setCollapsable(boolean collapsable)
Sets whether or not this group can be collapsed by the user |
void |
setExpanded(boolean expanded)
Expands or collapses this group. |
void |
setIcon(javax.swing.Icon icon)
Sets the icon to be displayed in the border of this pane. |
void |
setLayout(java.awt.LayoutManager mgr)
Overriden 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 |
setText(java.lang.String text)
Deprecated. |
void |
setTitle(java.lang.String title)
Sets the title to be displayed in the border of this pane. |
void |
setUI(TaskPaneGroupUI 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 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, getPreferredSize, 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, 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, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String UI_CLASS_ID
public static final java.lang.String EXPANDED_CHANGED_KEY
public static final java.lang.String COLLAPSABLE_CHANGED_KEY
public static final java.lang.String SCROLL_ON_EXPAND_CHANGED_KEY
public static final java.lang.String TITLE_CHANGED_KEY
public static final java.lang.String ICON_CHANGED_KEY
public static final java.lang.String SPECIAL_CHANGED_KEY
public static final java.lang.String ANIMATED_CHANGED_KEY
Constructor Detail |
---|
public JTaskPaneGroup()
JTaskPaneGroup
.
Method Detail |
---|
public java.awt.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 javax.swing.JPanel
JComponent.updateUI()
public void setUI(TaskPaneGroupUI ui)
ui
- the TaskPaneGroupUI
L&F objectUIDefaults.getUI(javax.swing.JComponent)
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JPanel
UI_CLASS_ID
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title
- the title to be displayed in the border of this panepublic void setText(java.lang.String text)
text
- setTitle(String)
public java.lang.String getText()
getTitle()
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon
- the icon to be displayed in the border of this panepublic boolean isSpecial()
public void setSpecial(boolean special)
JTaskPaneGroup
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 JTaskPaneGroup in a JTaskPane 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.setExpanded(boolean)
public boolean isScrollOnExpand()
public void setExpanded(boolean expanded)
expanded
- true to expand the group, false to collapse itpublic boolean isExpanded()
public void setCollapsable(boolean collapsable)
collapsable
- false to prevent the group to be manually collapsedpublic boolean isCollapsable()
public void setAnimated(boolean animated)
animated
- public boolean isAnimated()
public java.awt.Component add(javax.swing.Action action)
JTaskPaneGroup
. Returns a
component built from the action. The returned component has been
added to the JTaskPaneGroup
.
action
-
public java.awt.Container getValidatingContainer()
getValidatingContainer
in interface JCollapsiblePane.JCollapsiblePaneContainer
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int index)
addImpl
in class java.awt.Container
public void setLayout(java.awt.LayoutManager mgr)
setLayout
in class java.awt.Container
public void remove(java.awt.Component comp)
remove
in class java.awt.Container
public void remove(int index)
remove
in class java.awt.Container
public void removeAll()
removeAll
in class java.awt.Container
public boolean isFocusable()
isFocusable
in class java.awt.Component
protected java.lang.String paramString()
paramString
in class javax.swing.JPanel
JComponent.paramString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |