Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


oracle.javatools.ui
Class Header

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by oracle.javatools.ui.Header

All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public final class Header
extends javax.swing.JComponent
implements javax.accessibility.Accessible

A header is a UI component that is used to deliniate a group of related components.

The appearance of the header is primarily controlled by its Header.Level, which you can set using setLevel(Level). Headers at any level other than Header.Level.PAGE will display a disclosure icon, used to expand and collapse the section.

A header is not a container for components. It is intended to be associated with a group of components using a HeaderGroup, in much the same way ButtonGroup works for radio buttons. HeaderGroup automatically takes care of hiding or showing components as the header's disclosure icon is toggled.

A header may have one or more action controls associated with it. Action controls will be displayed in the order in which they are added using the addActionControl( Component ) method.

Since:
11.0
See Also:
Serialized Form

Nested Class Summary
static class Header.Level
          The visual appearance of a header changes based on its level in the document.
static class Header.Orientation
          The orientation of a header can be either horizontal (default) or vertical.

 

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

 

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
Header()
          Constructs a header.

 

Method Summary
 void addActionControl(javax.swing.Action action)
          Adds a control to the toolbar area of this header bound to the specified action.
 void addActionControl(java.awt.Component actionControl)
          Adds a control to the toolbar area of this header.
 void addHeaderListener(HeaderListener headerListener)
          Adds a listener that will be notified when the header is collapsed or expanded either using the disclosure icon, or programmatically.
 javax.swing.JButton disclosureIcon()
           
 void doLayout()
           
protected  void fireHeaderCollapsed()
          Fires the headerCollapsed event to all HeaderListeners registered using addHeaderListener( HeaderListener ).
protected  void fireHeaderExpanded()
          Fires the headerExpanded event to all HeaderListeners registered using addHeaderListener( HeaderListener ).
 javax.accessibility.AccessibleContext getAccessibleContext()
           
 java.awt.Color getForeground()
           
 java.lang.String getHelpTopicId()
          Returns the help topic id for this header.
 javax.swing.Icon getIcon()
          Returns the decorative icon for the header.
 Header.Level getLevel()
          Returns the level of this header.
 int getMinimumChars()
          Returns the minimum number of characters that will be displayed in the label when there is not enough space.
 java.awt.Dimension getMinimumSize()
           
 Header.Orientation getOrientation()
          Returns the orientation of this header.
 java.awt.Dimension getPreferredSize()
           
 java.lang.String getRollupStatusText()
          Returns the text of the rollup status label.
 java.lang.String getText()
          Returns the text of the header.
 boolean isExpandable()
          Returns whether this header is expandable.
 boolean isExpanded()
          Returns true if the header is currently expanded, false otherwise.
protected  void paintComponent(java.awt.Graphics g)
           
 void removeActionControl(javax.swing.Action action)
          Removes a control to the toolbar area of this header that was previously added using addActionControl(Action).
 void removeActionControl(java.awt.Component actionControl)
          Removes a control from the toolbar area of this header.
 void removeHeaderListener(HeaderListener headerListener)
          Removes a listener for header expansion that was previously added using the addHeaderListener( HeaderListener) method.
 void setExpandable(boolean expandable)
          Sets whether this header is expandable.
 void setExpanded(boolean expanded)
          Programmatically sets whether the header is expanded.
 void setForeground(java.awt.Color c)
           
 void setHelpTopicId(java.lang.String helpTopicId)
          Sets the help topic id for this header.
 void setIcon(javax.swing.Icon icon)
          Sets the header's decorative icon.
 void setLevel(Header.Level level)
          Sets the level of this header.
 void setMinimumChars(int minimumChars)
          Sets the minimum number of characters that will be displayed in the label when there is not enough space.
 void setName(java.lang.String name)
          Override default get name functionality to automatically set derrived name on the disclosure and help icons for testing purposes
 void setOrientation(Header.Orientation orientation)
          Sets the orientation of this header.
 void setRollupStatusText(java.lang.String rollupStatusText)
          Sets the text of the roll up status label.
 void setText(java.lang.String text)
          Sets the text of the header.
 java.lang.String toString()
           

 

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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI

 

Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, 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, 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, isFocusable, 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, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

Header

public Header()
Constructs a header. The header will be a Page level header by default.

Method Detail

setForeground

public void setForeground(java.awt.Color c)
Overrides:
setForeground in class javax.swing.JComponent

getForeground

public java.awt.Color getForeground()
Overrides:
getForeground in class java.awt.Component

disclosureIcon

public javax.swing.JButton disclosureIcon()

setName

public void setName(java.lang.String name)
Override default get name functionality to automatically set derrived name on the disclosure and help icons for testing purposes
Overrides:
setName in class java.awt.Component
Parameters:
name -

setMinimumChars

public void setMinimumChars(int minimumChars)
Sets the minimum number of characters that will be displayed in the label when there is not enough space. The default is 15.
Parameters:
minimumChars - the minimum number of characters to display when there is not enough space to display the whole header text. Must be greater than or equal to zero.
Throws:
java.lang.IllegalArgumentException - if minimumChars is less than zero.

getMinimumChars

public int getMinimumChars()
Returns the minimum number of characters that will be displayed in the label when there is not enough space. The default is 15.
Returns:
a value greater than or equal to zero indicating the minimum number of characters to display when truncation is in effect.

setOrientation

public void setOrientation(Header.Orientation orientation)
Sets the orientation of this header. The default orientation if none is specified is Header.Orientation.HORIZONTAL.
Parameters:
orientation - whether this header has a horizontal or vertical orientation. Must not be null.

getOrientation

public Header.Orientation getOrientation()
Returns the orientation of this header.
Returns:
the orientation of this header.

setHelpTopicId

public void setHelpTopicId(java.lang.String helpTopicId)
Sets the help topic id for this header. If the header has a help topic id associated with it, then it will display a help icon.
Parameters:
helpTopicId - a help topic id. If null, no dynamic help is associated with the header.

getHelpTopicId

public java.lang.String getHelpTopicId()
Returns the help topic id for this header.
Returns:
the help topic id for this header, or null if this header does not have dynamic help.

addActionControl

public void addActionControl(java.awt.Component actionControl)
Adds a control to the toolbar area of this header.
Parameters:
actionControl - a component to add to the toolbar area of this header. Must not be null.
Throws:
java.lang.NullPointerException - if actionControl is null.

addActionControl

public void addActionControl(javax.swing.Action action)
Adds a control to the toolbar area of this header bound to the specified action. The control will assume the correct visual style for a toolbar item in a header. This is the recommended way to add controls to a header toolbar.
Parameters:
action - an action to bind to a button in the toolbar area of this header. Must not be null.
Throws:
java.lang.NullPointerException - if action is null.

removeActionControl

public void removeActionControl(javax.swing.Action action)
Removes a control to the toolbar area of this header that was previously added using addActionControl(Action).
Parameters:
action - an action to remove from the toolbar.

removeActionControl

public void removeActionControl(java.awt.Component actionControl)
Removes a control from the toolbar area of this header.
Parameters:
actionControl - a component to remove from the toolbar area of this header.

setText

public void setText(java.lang.String text)
Sets the text of the header.
Parameters:
text - the text of the header. Must not be null.

getText

public java.lang.String getText()
Returns the text of the header.
Returns:
the text of the header.

setRollupStatusText

public void setRollupStatusText(java.lang.String rollupStatusText)
Sets the text of the roll up status label. The roll up status label is a label containing information about a collapsed header.
Parameters:
rollupStatusText - text for the rollup status label. If null, or the empty string, the rollup status label will be unconditionally hidden.

getRollupStatusText

public java.lang.String getRollupStatusText()
Returns the text of the rollup status label.
Returns:
the text of the rollup status label.

setExpandable

public void setExpandable(boolean expandable)
Sets whether this header is expandable.
Parameters:
expandable - if true, the header can be expanded.

isExpandable

public boolean isExpandable()
Returns whether this header is expandable.
Returns:
true if this header is expandable.

setIcon

public void setIcon(javax.swing.Icon icon)
Sets the header's decorative icon.
Parameters:
icon - a decorative icon for the header. If null, the icon will be hidden.

getIcon

public javax.swing.Icon getIcon()
Returns the decorative icon for the header.
Returns:
the decoarative icon for the header.

setExpanded

public void setExpanded(boolean expanded)
Programmatically sets whether the header is expanded. This method will fire appropriate events to listeners registered using the addHeaderListener( HeaderListener ) method.
Parameters:
expanded - if true, the header will be expanded. Otherwise, it will be collapsed.

isExpanded

public boolean isExpanded()
Returns true if the header is currently expanded, false otherwise.
Returns:
true if the header is expanded.

addHeaderListener

public void addHeaderListener(HeaderListener headerListener)
Adds a listener that will be notified when the header is collapsed or expanded either using the disclosure icon, or programmatically.
Parameters:
headerListener - a listener for header events. Must not be null.

removeHeaderListener

public void removeHeaderListener(HeaderListener headerListener)
Removes a listener for header expansion that was previously added using the addHeaderListener( HeaderListener) method.
Parameters:
headerListener - a listener to remove.

fireHeaderExpanded

protected final void fireHeaderExpanded()
Fires the headerExpanded event to all HeaderListeners registered using addHeaderListener( HeaderListener ).

fireHeaderCollapsed

protected final void fireHeaderCollapsed()
Fires the headerCollapsed event to all HeaderListeners registered using addHeaderListener( HeaderListener ).

setLevel

public void setLevel(Header.Level level)
Sets the level of this header.
Parameters:
level - one of the values of Header.Level. Must not be null.

getLevel

public Header.Level getLevel()
Returns the level of this header.
Returns:
the level of this header.

paintComponent

protected void paintComponent(java.awt.Graphics g)
Overrides:
paintComponent in class javax.swing.JComponent

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getPreferredSize

public java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

doLayout

public void doLayout()
Overrides:
doLayout in class java.awt.Container

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class javax.swing.JComponent

toString

public java.lang.String toString()
Overrides:
toString in class java.awt.Component

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.2.0)

E17493-03


Copyright © 1997, 2012, Oracle. All rights reserved.