Skip navigation links

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

E17493-04


oracle.javatools.ui.builders
Class ToolBarBuilder

java.lang.Object
  extended by oracle.javatools.ui.builders.ToolBarBuilder


public final class ToolBarBuilder
extends java.lang.Object

A Builder of ToolBars. Tell the builder what things to put on a toolbar, then call 'build()'. The builder will build a toolbar to the given specifications which conforms to UI guidelines.

Some items have a fixed location on the toolbar: e.g. the search field, and the secondary actions drop down. Other items can either be added to the left or right hand side of the toolbar. Items are placed on the toolbar from left to right in the order in which they were given to the builder.


Constructor Summary
ToolBarBuilder()
           

 

Method Summary
 void addActions(boolean leftAligned, javax.swing.Action... actions)
          Add actions to the toolbar.
 void addComponents(boolean leftAligned, java.awt.Component... components)
          Add an arbitrary component to the toolbar
 void addDropActions(boolean leftAligned, javax.swing.Icon icon, java.lang.String tooltipText, javax.swing.Action... actions)
          Add an icon button to the toolbar that when pressed reveals a drop list of actions.
 void addDropActions(boolean leftAligned, java.lang.String text, javax.swing.Action... actions)
          Add a button to the toolbar that when pressed reveals a drop list of actions.
 void addSeparator(boolean leftAligned)
          Add a separator to the toolbar.
 BuiltToolBar build()
          Create and return the class containing the built UI for the specified toolbar.
 void setActionsSecondary(javax.swing.Action... actions)
          Add additional (less important) action(s) to the list.
 void setActionsSecondary(java.lang.String moreActionsText, javax.swing.Action... actions)
          Add additional (less important) action(s) to the list.
 void setSearch(SearchField.Style searchStyle, java.lang.String searchPrompt)
          Add a search control to the toolbar.
 void setToolBar(javax.swing.JToolBar toolBar)
          Set the toolbar instance used by the builder, e.g.

 

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

 

Constructor Detail

ToolBarBuilder

public ToolBarBuilder()

Method Detail

build

public BuiltToolBar build()
Create and return the class containing the built UI for the specified toolbar.
Returns:
a BuiltToolBar configured to the specification of previous calls to this builder.

setToolBar

public void setToolBar(javax.swing.JToolBar toolBar)
Set the toolbar instance used by the builder, e.g. to supply custom toolbars such as oracle.ide.controls.ToolBar
Parameters:
toolBar - the custom toolbar used by the builder

addActions

public void addActions(boolean leftAligned,
                       javax.swing.Action... actions)
Add actions to the toolbar. Actions are added left to right in the order presented to the builder.
Parameters:
leftAligned - if true the actions will be added to the left area of the toolbar, otherwise they'll be added to the right
actions -

addDropActions

public void addDropActions(boolean leftAligned,
                           java.lang.String text,
                           javax.swing.Action... actions)
Add a button to the toolbar that when pressed reveals a drop list of actions.
Parameters:
leftAligned - if true the actions will be added to the left area of the toolbar, otherwise they'll be added to the right
actions -
text - the text of the drop button (may include mnemonic &)

addDropActions

public void addDropActions(boolean leftAligned,
                           javax.swing.Icon icon,
                           java.lang.String tooltipText,
                           javax.swing.Action... actions)
Add an icon button to the toolbar that when pressed reveals a drop list of actions.
Parameters:
leftAligned - if true the actions will be added to the left area of the toolbar, otherwise they'll be added to the right
actions -
icon - the icon for the drop button
tooltipText - tooltip text for the drop button

addComponents

public void addComponents(boolean leftAligned,
                          java.awt.Component... components)
Add an arbitrary component to the toolbar
Parameters:
leftAligned - if true the actions will be added to the left area of the toolbar, otherwise they'll be added to the right
components - one or more components to add

addSeparator

public void addSeparator(boolean leftAligned)
Add a separator to the toolbar. Items are added to the toolbar left to right in the order presented to the builder.
Parameters:
leftAligned - if true the separator will be added to the left side of the toolbar, otherwise the right

setActionsSecondary

public void setActionsSecondary(javax.swing.Action... actions)
Add additional (less important) action(s) to the list. They may appear in a "More Actions" style drop list.
Parameters:
actions -

setActionsSecondary

public void setActionsSecondary(java.lang.String moreActionsText,
                                javax.swing.Action... actions)
Add additional (less important) action(s) to the list. They may appear in a "More Actions" style drop list.
Parameters:
moreActionsText - the name (including mnemonic) for the drop list button, or null to accept the default.
actions -

setSearch

public void setSearch(SearchField.Style searchStyle,
                      java.lang.String searchPrompt)
Add a search control to the toolbar. It will be placed in the location designated by the UI guidelines. The search component can be retrieved from the BuiltToolBar after it has been built
Parameters:
searchStyle - set the style of the search
searchPrompt - set the hint text to appear in the search field

Skip navigation links

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

E17493-04


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