|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
edu.rice.cs.util.swing.ScrollableListDialog<T>
public class ScrollableListDialog<T>
The ScrollableListDialog is a popup dialog with a message and a scrollable list of items. A ScrollableListDialog should be used when a message may need to display a variable number of items, for example, when reporting missing files.
The message (also know as the leader text) is displayed above the items with an optional icon. The items are displayed in a scrollable list. Buttons are added below the list of items.
This dialog is somewhat styled after JOptionPane
and uses the message-type constants from
JOptionPane.
Nested Class Summary | |
---|---|
static class |
ScrollableListDialog.Builder<T>
Factory design pattern. |
Nested classes/interfaces inherited from class javax.swing.JDialog |
---|
JDialog.AccessibleJDialog |
Nested classes/interfaces inherited from class java.awt.Dialog |
---|
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType |
Nested classes/interfaces inherited from class java.awt.Window |
---|
Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected int |
_buttonPressed
The number of the button that was pressed to close the dialog. |
protected JList |
list
The list of items displayed. |
protected List<T> |
listItems
The list of items being listed. |
Fields inherited from class javax.swing.JDialog |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
---|
DEFAULT_MODALITY_TYPE |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
protected void |
_addButtons(JPanel buttonPanel,
List<JButton> buttons)
Adds buttons to the bottom of the dialog. |
protected void |
closeDialog()
Should be called when the dialog should be closed. |
int |
getButtonPressed()
Return the number of the button that was pressed to close the dialog. |
List<T> |
getSelectedItems()
Return a list of the selected items. |
static void |
main(String[] args)
A simple main method for testing purposes. |
void |
showDialog()
Shows the dialog. |
Methods inherited from class java.awt.Dialog |
---|
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final JList list
protected int _buttonPressed
protected List<T> listItems
Method Detail |
---|
protected void _addButtons(JPanel buttonPanel, List<JButton> buttons)
closeDialog()
. It
is also set as the dialog's default button.
Inheritors should feel free the change settings of the panel such
as the layout manager. However, no guarantees are made that every
change will work with every version of this class.
buttonPanel
- The JPanel that should contain the buttons.buttons
- The list of buttonspublic void showDialog()
protected void closeDialog()
public int getButtonPressed()
public List<T> getSelectedItems()
public static void main(String[] args)
args
- Not used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |