public class BasicSeparatorHandler extends Object implements BasicTitleViewItem<JComponent>, MenuViewItem<JComponent>
JSeparator
for a SeparatorAction
.Constructor and Description |
---|
BasicSeparatorHandler(JSeparator separator,
SeparatorAction action)
Creates a new handler
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener which will be called if this view is triggered.
|
void |
bind()
Binds this item to its action
|
DockAction |
getAction()
Gets the action that is represented by this target.
|
JComponent |
getItem()
Gets this item as component.
|
void |
removeActionListener(ActionListener listener)
Removes a listener from this view.
|
void |
setBackground(Color background)
Called by the title that shows this item to tell this item what the
background color of the title is.
|
void |
setForeground(Color foreground)
Called by the title that shows this item to tell this item what the
foreground color of the title is.
|
void |
setOrientation(DockTitle.Orientation orientation)
Informs the item about the orientation of the title that uses this
item.
|
void |
unbind()
Unbinds this item from its action
|
public BasicSeparatorHandler(JSeparator separator, SeparatorAction action)
separator
- the separator to showaction
- the action for which the action is shownpublic void bind()
ViewItem
bind
in interface ViewItem<JComponent>
public void addActionListener(ActionListener listener)
MenuViewItem
addActionListener
in interface MenuViewItem<JComponent>
listener
- the new listenerpublic void removeActionListener(ActionListener listener)
MenuViewItem
removeActionListener
in interface MenuViewItem<JComponent>
listener
- the listener to removepublic void setOrientation(DockTitle.Orientation orientation)
BasicTitleViewItem
setOrientation
in interface BasicTitleViewItem<JComponent>
orientation
- the orientationpublic DockAction getAction()
ViewItem
getAction
in interface ViewItem<JComponent>
null
public JComponent getItem()
ViewItem
getItem
in interface ViewItem<JComponent>
null
public void setBackground(Color background)
BasicTitleViewItem
setBackground
in interface BasicTitleViewItem<JComponent>
background
- the background color of the titlepublic void setForeground(Color foreground)
BasicTitleViewItem
setForeground
in interface BasicTitleViewItem<JComponent>
foreground
- the foreground color of the titlepublic void unbind()
ViewItem
unbind
in interface ViewItem<JComponent>