|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.explodingpixels.macwidgets.SourceListControlBar
public class SourceListControlBar
A bar that can contain buttons and pop-down buttons that act on a given SourceList. This
control bar is displayed at the base of the SourceList. The control bar also has a
draggable widget that can control the divider location of a given JSplitPane.
Heres how to create and install an empty SourceListControlBar:
SourceList sourceList = DSourceListITunes.createSourceList(); SourceListControlBar controlBar = new SourceListControlBar(); sourceList.installSourceListControlBar(controlBar);The above code creates a control bar that looks like this:
The following code adds two push buttons and a drop-down button to the control bar:
controlBar.createAndAddPopdownButton(MacIcons.GEAR,
new PopupMenuCustomizer() {
public void customizePopup(JPopupMenu popup) {
popup.removeAll();
popup.add(new JMenuItem("Item One"));
popup.add(new JMenuItem("Item Two"));
popup.add(new JMenuItem("Item Three"));
}
});
The above code creates a control bar that looks like this:
| Constructor Summary | |
|---|---|
SourceListControlBar()
Creates a SourceListControlBar. |
|
| Method Summary | |
|---|---|
void |
createAndAddButton(javax.swing.Icon icon,
java.awt.event.ActionListener actionListener)
Adds a new button with the given icon. |
void |
createAndAddPopdownButton(javax.swing.Icon icon,
com.explodingpixels.widgets.PopupMenuCustomizer popupMenuCustomizer)
Add a new pop-down style button. |
javax.swing.JComponent |
getComponent()
Gets the user interface component representing this SourceListControlBar. |
void |
installDraggableWidgetOnSplitPane(javax.swing.JSplitPane splitPane)
Connects the draggable widget in this SourceListControlBar to the divider of the
given JSplitPane. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SourceListControlBar()
SourceListControlBar.
| Method Detail |
|---|
public void installDraggableWidgetOnSplitPane(javax.swing.JSplitPane splitPane)
SourceListControlBar to the divider of the
given JSplitPane. Thus when the user drags the SourceListControlBar draggable
widget, the given JSplitPanes divider location will be adjusted.
splitPane - the JSplitPane to connect the draggable widget to.public javax.swing.JComponent getComponent()
SourceListControlBar. The
returned JComponent should be added to a container that will be displayed.
SourceListControlBar.
public void createAndAddPopdownButton(javax.swing.Icon icon,
com.explodingpixels.widgets.PopupMenuCustomizer popupMenuCustomizer)
PopupMenuCustomizer will be called just
prior to each showing of the menu.
icon - the icon to use in the pop-down menu.popupMenuCustomizer - the PopupMenuCustomizer to be called just prior to showing
the menu.
public void createAndAddButton(javax.swing.Icon icon,
java.awt.event.ActionListener actionListener)
ActionListener will be called when
the button is pressed.
icon - the icon to use for the button.actionListener - the ActionListener to call when the button is pressed.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||