|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.explodingpixels.macwidgets.SourceList
public class SourceList
An implementation of an OS X Source List. For a full descrption of what a Source List is, see the Source Lists section of Apple's Human Interface Guidelines.
This component provides the two basic sytles of Source List: focusble and non-focusable. As the name implies, focusable Source Lists and recieve keyboard focus, and thus can be navigated using the arrow keys. Non-focusable, cannot receive keyboard focus, and thus cannot be navigated via the arrow keys. The two styles ofSourceList are pictured below:
![]() |
![]() |
| Focusable SourceList | Non-focusable SourceList |
SourceList with one item:
SourceListModel model = new SourceListModel();
SourceListCategory category = new SourceListCategory("Category");
model.addCategory(category);
model.addItemToCategory(new SourceListItem("Item"), category);
SourceList sourceList = new SourceList(model);
To install a selection listener on the SourceList, add a
SourceListSelectionListener.
setSourceListContextMenuProvider(SourceListContextMenuProvider) with an implementation
of SourceListContextMenuProvider.
| Constructor Summary | |
|---|---|
SourceList()
Creates a SourceList with an empty SourceListModel. |
|
SourceList(SourceListModel model)
Creates a SourceList with the given SourceListModel. |
|
| Method Summary | |
|---|---|
void |
addSourceListClickListener(SourceListClickListener listener)
Adds the SourceListClickListener to the list of listeners. |
void |
addSourceListSelectionListener(SourceListSelectionListener listener)
Adds the SourceListSelectionListener to the list of listeners. |
void |
dispose()
Uninstalls any listeners that this SourceList installed on creation, thereby allowing
it to be garbage collected. |
javax.swing.JComponent |
getComponent()
Gets the user interface component representing this SourceList. |
SourceListModel |
getModel()
Gets the SourceListModel backing this SourceList. |
SourceListItem |
getSelectedItem()
Gets the selected SourceListItem. |
void |
installSourceListControlBar(SourceListControlBar sourceListControlBar)
Installs the given SourceListControlBar at the base of this SourceList. |
boolean |
isSourceListControlBarInstalled()
True if there is a SourceListControlBar installed on this SourceList. |
void |
removeSourceListClickListener(SourceListClickListener listener)
Removes the SourceListClickListener to the list of listeners. |
void |
removeSourceListSelectionListener(SourceListSelectionListener listener)
Removes the SourceListSelectionListener from the list of listeners. |
void |
setColorScheme(SourceListColorScheme colorScheme)
Sets the SourceListColorScheme that this SourceList uses. |
void |
setFocusable(boolean focusable)
Sets whether this SourceList can have focus. |
void |
setSelectedItem(SourceListItem item)
Selects the given SourceListItem in the list. |
void |
setSourceListContextMenuProvider(SourceListContextMenuProvider contextMenuProvider)
Sets the SourceListContextMenuProvider to use for this SourceList. |
void |
setTransferHandler(javax.swing.TransferHandler transferHandler)
Set's the TransferHandler that this SourceList should use
during drag and drop operations. |
void |
useIAppStyleScrollBars()
Installs iApp style scroll bars on this SourceList. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SourceList()
SourceList with an empty SourceListModel.
public SourceList(SourceListModel model)
SourceList with the given SourceListModel.
model - the SourceListModel to use.| Method Detail |
|---|
public void installSourceListControlBar(SourceListControlBar sourceListControlBar)
SourceListControlBar at the base of this SourceList. This
method can be called only once, and should generally be called during creation of the
SourceList.
sourceListControlBar - the SourceListControlBar to add.
java.lang.IllegalStateException - if a SourceListControlBar has already been installed
on this SourceList.
java.lang.IllegalArgumentException - if the SourceListControlBar is null.public boolean isSourceListControlBarInstalled()
SourceListControlBar installed on this SourceList.
SourceListControlBar installed on this SourceList.public void setSourceListContextMenuProvider(SourceListContextMenuProvider contextMenuProvider)
SourceListContextMenuProvider to use for this SourceList.
contextMenuProvider - the SourceListContextMenuProvider to use for this
SourceList.
java.lang.IllegalArgumentException - if the SourceListContextMenuProvider is null.public void dispose()
SourceList installed on creation, thereby allowing
it to be garbage collected.
public SourceListItem getSelectedItem()
SourceListItem.
SourceListItem.public void setSelectedItem(SourceListItem item)
SourceListItem in the list.
item - the item to select.
java.lang.IllegalArgumentException - if the given item is not in the list.public void setFocusable(boolean focusable)
SourceList can have focus. When focusable and this
SourceList has focus, the keyboard can be used for navigation.
focusable - true if this SourceList should be focusable.public void useIAppStyleScrollBars()
SourceList.
IAppWidgetFactory.makeIAppScrollPane(javax.swing.JScrollPane)public void setColorScheme(SourceListColorScheme colorScheme)
SourceListColorScheme that this SourceList uses.
colorScheme - the SourceListColorScheme that this SourceList uses.public void setTransferHandler(javax.swing.TransferHandler transferHandler)
TransferHandler that this SourceList should use
during drag and drop operations. If the given handler not null, then
dragging will be turned on for the SourceList. If the handler is
null, then dragging will be turned off.
transferHandler - the TransferHandler for this
SourceList. Can be null.public javax.swing.JComponent getComponent()
SourceList. The returned
JComponent should be added to a container that will be displayed.
SourceList.public SourceListModel getModel()
SourceListModel backing this SourceList.
SourceListModel backing this SourceList.public void addSourceListClickListener(SourceListClickListener listener)
SourceListClickListener to the list of listeners.
listener - the SourceListClickListener to add.public void removeSourceListClickListener(SourceListClickListener listener)
SourceListClickListener to the list of listeners.
listener - the SourceListClickListener to remove.public void addSourceListSelectionListener(SourceListSelectionListener listener)
SourceListSelectionListener to the list of listeners.
listener - the SourceListSelectionListener to add.public void removeSourceListSelectionListener(SourceListSelectionListener listener)
SourceListSelectionListener from the list of listeners.
listener - the SourceListSelectionListener to remove.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||