Class SectionToolbar
java.lang.Object
com._1c.g5.v8.dt.common.ui.controls.SectionToolbar
This class provides a convenient shorthand for creating and initializing
ToolBar. This offers several benefits over creating ToolBar normal way:
- Minimize the codes of the creating of the ToolBar
- The setters on SectionToolbar all return "this", allowing them to be chained
-
Constructor Summary
ConstructorsConstructorDescriptionSectionToolbar(org.eclipse.swt.widgets.Composite section) Create SectionToolbar with default style (SWT.FLAT | SWT.HORIZONTAL)SectionToolbar(org.eclipse.swt.widgets.Composite section, int style) Create SectionToolbar using specified style (See styles of theToolBarManager). -
Method Summary
Modifier and TypeMethodDescriptionadd(org.eclipse.jface.action.IAction action) Adds an action as a contribution item, and returns this for convenienceadd(org.eclipse.jface.action.IContributionItem iContributionItem) Adds a contribution item to this manager, and returns this for conveniencedone()Updates the wrapped ToolBarManager.
Equivalent tothis.toolBarManager#update(true);org.eclipse.swt.widgets.ToolBarGets the created ToolBar.org.eclipse.jface.action.ToolBarManagerGets the created ToolBar manager.
-
Constructor Details
-
SectionToolbar
public SectionToolbar(org.eclipse.swt.widgets.Composite section) Create SectionToolbar with default style (SWT.FLAT | SWT.HORIZONTAL)- Parameters:
section- - a parent composite
-
SectionToolbar
public SectionToolbar(org.eclipse.swt.widgets.Composite section, int style) Create SectionToolbar using specified style (See styles of theToolBarManager).- Parameters:
section- - a parent compositestyle- - a style for the create of the ToolBarManager
-
-
Method Details
-
add
Adds an action as a contribution item, and returns this for convenience- Parameters:
action- - the action, this cannot benull- Returns:
thisfor convenience
-
add
Adds a contribution item to this manager, and returns this for convenience- Parameters:
iContributionItem- - the contribution item, this cannot benull- Returns:
thisfor convenience
-
done
Updates the wrapped ToolBarManager.
Equivalent tothis.toolBarManager#update(true);- Returns:
thisfor convenience- See Also:
-
ToolBarManager.update(boolean)
-
getControl
public org.eclipse.swt.widgets.ToolBar getControl()Gets the created ToolBar.- Returns:
- created ToolBar
-
getManager
public org.eclipse.jface.action.ToolBarManager getManager()Gets the created ToolBar manager.- Returns:
- created ToolBar
-