public class IlpToolBarRenderer
extends ilog.cpl.graph.css.renderer.IlpToolBarRenderer
IlpEquipmentView
.
This class is a CSS stylable Bean. It can be configured as follows in a CSS file:
ToolBar { external : boolean; enabled : boolean; button[0] : @+Button0; button[1] : @+Button1; : button[n] : @+ButtonN; }
The enabled
property denotes whether the toolbar is
initially visible. Its value can be true
or false
.
The default is true
.
The button
elements specify the buttons to appear in the
toolbar (IlpEquipmentInteractorButton
) or
separators. When pressed, buttons execute actions; for example, they can install view
interactors. A button can be specified as follows in a CSS file:
Subobject#Button0 { actionType: String; permanent: boolean; name: String; usingObjectInteractor: boolean; }
Here the actionType
property should be one of the following
predefined action names:
EditGroup
EditLabel
EditLinkPort
EditObject
FitToContents
LabelLayout
MakeLinearGroup
MakeLink
MakePolyGroup
MakeRectGroup
Pan
ScrollToContents
Select
Separator
UnZoomView
ZoomBack
ZoomIn
ZoomOut
ZoomReset
ZoomView
IlpEquipmentInteractorAction
that has a public constructor taking one argument of type IlpViewsView
,
for instance:
ToolBar { enabled: true; button[0]: @+SelectButton; button[1]: @+CustomButton; } Subobject#SelectButton { actionType: "Select"; usingObjectInteractor: true; opaqueMove: true; } Subobject#CustomButton { actionType: "samples.equipment.styling.CustomButtonAction"; toolTipText: "Custom Button"; }
The predefined Separator
action type is used to add separators at
specific positions in the toolbar. When separators are added, it is possible to
define a single optional property, dimension
. This property allows you to
customize the dimension of the separator in the toolbar, as illustrated by the example
below:
ToolBar { enabled: true; button[0]: @+SelectButton; button[1]: @+Separator; button[2]: @+CustomButton; } Subobject#Separator { actionType: "Separator"; dimension: "20,10"; }
The name
property denotes the name of the button, so that
it can be referred to by the Interactor
ID; see
IlpInteractorRenderer
.
All the predefined actions already have a name.
The permanent
property is useful for buttons that install a
view interactor. The value can be true
or false
.
The default is true
.
The allowed properties and their values depend on the class of the chosen button.
Additional action
IDs can be specified for buttons that
install a view interactor. It can look like this in the CSS:
Subobject#SelectButton { actionType: "Select"; usingObjectInteractor: true; opaqueMove: true; action[0]: @+action0; popupMenuFactory: @+popupMenuFactory; } Subobject#action0 { key : "DELETE"; class : "ilog.cpl.graph.action.IlpRemoveSelectedObjectsAction"; }
A key
or gesture
property should be specified.
The value of the key
property can be any of the strings
described in class
KeyStroke
.
The value of the gesture
property can be any gesture name
defined in class IlpGesture
or its subclasses.
The value of the class
property should be the name of a
class that implements javax.swing.Action
and has a public
no-argument constructor.
The allowed properties and their values depend on the class of the chosen action.
Also, a pop-up menu factory can be specified. It can look like this in the CSS:
Subobject#popupMenuFactory { class : "MyPopupMenuFactory"; /* Other Bean properties could be added here. */ }
The value of the class
property should be the name of a
class that implements IlpPopupMenuFactory
and has a public
no-argument constructor.
The allowed properties and their values depend on the class of the chosen factory.
IlpEquipmentView
,
IlpEquipmentInteractorButton
,
IlpEquipmentInteractorAction
,
IlpViewInteractor
,
IlpGesture
,
IlpPopupMenuFactory
Constructor and Description |
---|
IlpToolBarRenderer() |
Modifier and Type | Method and Description |
---|---|
JToolBar |
getToolBar()
Returns the toolbar of the view.
|
boolean |
isToolBarExternal()
Tests whether the toolbar is external to the representation view.
|
boolean |
isToolBarVisible()
Tests whether the toolbar is visible.
|
void |
setToolBarExternal(boolean external)
Sets the toolbar to
external (managed by the application)
or integrated (managed by this view). |
void |
setToolBarVisible(boolean visible)
Shows or hides the toolbar.
|
attach, getView, noteContainerAdded, noteContainerUpdated
public JToolBar getToolBar()
getToolBar
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
public boolean isToolBarVisible()
Note that this function is only relevant if the toolbar is integrated in the view and is not managed externally.
isToolBarVisible
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
setToolBarVisible(boolean)
,
isToolBarExternal()
public void setToolBarVisible(boolean visible)
Note that this function has an effect only if the toolbar is integrated in the view and is not managed externally.
setToolBarVisible
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
visible
- The required visibility setting.isToolBarVisible()
,
isToolBarExternal()
public boolean isToolBarExternal()
external
, it is up to the
application to control the toolbar placement and visibility.
For example, the application can place the toolbar into a
modal or non-modal JDialog
or elsewhere in the
application frame.isToolBarExternal
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
setToolBarExternal(boolean)
public void setToolBarExternal(boolean external)
external
(managed by the application)
or integrated
(managed by this view).setToolBarExternal
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
isToolBarExternal()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.