|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.ucsb.nceas.morpho.plugins.datapackagewizard.CustomList
Interface CustomList
Nested Class Summary |
Nested classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.AddAction |
addAction
|
static short |
AND
|
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.DeleteAction |
deleteAction
|
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.DuplicateAction |
duplicateAction
|
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.EditAction |
editAction
|
static short |
EMPTY_STRING_NOTRIM
|
static short |
EMPTY_STRING_TRIM
|
static short |
IGNORE
|
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.MoveDownAction |
moveDownAction
|
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.MoveUpAction |
moveUpAction
|
static short |
NULL
|
static short |
OR
|
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
CustomList(java.lang.String[] colNames,
java.lang.Object[] columnEditors,
int displayRows,
boolean showAddButton,
boolean showEditButton,
boolean showDuplicateButton,
boolean showDeleteButton,
boolean showMoveUpButton,
boolean showMoveDownButton)
constructor - creates a multi-column list based on the parameters passed: |
Method Summary | |
void |
addRow(java.util.List rowList)
adds the row to the list after the currently-selected row, or at the end if no row is selected. |
void |
deleteEmptyRows(short logicMode,
short[] conditions)
Removes any rows that are "empty", as defined by the parameters specified in the passed short array "conditions", as described below. |
void |
editCellAt(int row,
int col)
Method to edit a particular cell. |
void |
fireAddAction()
Method to fire the Add action of the CustomList. |
void |
fireDeleteAction()
Method to fire the Delete action of the CustomList. |
void |
fireDuplicateAction()
Method to fire the Duplicate action of the CustomList. |
void |
fireEditAction()
Method to fire the Edit action of the CustomList. |
void |
fireEditingStopped()
Tells the list to stop editing and commit all edited values to the model. |
void |
fireMoveDownAction()
Method to fire the Move-Down action of the CustomList. |
void |
fireMoveUpAction()
Method to fire the Move-Up action of the CustomList. |
void |
focusAddButton()
Gives the "Add" button keyboard focus |
javax.swing.Action |
getCustomAddAction()
Gets the javax.swing.Action to be executed on pressing the
ADD button. |
javax.swing.Action |
getCustomDeleteAction()
Gets the javax.swing.Action to be executed on pressing the
appropriate list button. |
javax.swing.Action |
getCustomDuplicateAction()
Gets the javax.swing.Action to be executed on pressing the
appropriate list button. |
javax.swing.Action |
getCustomEditAction()
Gets the javax.swing.Action to be executed on pressing the
appropriate list button. |
java.util.List |
getListOfRowLists()
returns a java.util.List containing elements that are also
java.util.List objects, each of which represents a row from
the list. |
int |
getRowCount()
returns the total number of rows in the list |
int |
getSelectedRowIndex()
returns the index of the currently-selected row, or -1 if none selected |
java.util.List |
getSelectedRowList()
returns the List containing the objects in the currently-selected row, or null if none selected |
java.util.List[] |
getSelectedRows()
returns an array of Lists containing the objects in the currently-selected rows, or null if none selected |
javax.swing.event.TableModelEvent |
getTableModelEvent()
|
boolean |
isEnabled()
Gets the boolean indicating whether the customlist is enabled or not |
void |
removeAllRows()
removes all the rows from the list |
void |
removeRow(int row)
removes the row with the specified index from the list |
void |
replaceRow(int rowIndex,
java.util.List newRow)
replaces the row corresponding to the given row number with the Objects in the List provided,or with a blank row if the List is null. |
void |
replaceSelectedRow(java.util.List newRow)
replaces the currently-selected row with the Objects in the List provided, or with a blank row if the List is null |
void |
scrollToRow(int row)
Scrolls the CustomList (if necessary) to the particular row such that it becomes visible. |
void |
selectAndEditCell(int row,
int col)
|
void |
setBackground(java.awt.Color bgColor)
Sets the boolean to indicate whether the customlist can be edited or not. |
void |
setBorderForButtonPanel(int top,
int left,
int bottom,
int right)
Sets the border widths for the button Panel. |
void |
setColumnWidthPercentages(double[] columnWidths)
Sets the relative widths of each column in the columnList. |
void |
setCustomAddAction(javax.swing.Action a)
Sets the javax.swing.Action to be executed on pressing the ADD
button. |
void |
setCustomDeleteAction(javax.swing.Action a)
Sets the javax.swing.Action to be executed on pressing the
appropriate list button. |
void |
setCustomDuplicateAction(javax.swing.Action a)
Sets the javax.swing.Action to be executed on pressing the
appropriate list button. |
void |
setCustomEditAction(javax.swing.Action a)
Sets the javax.swing.Action to be executed on pressing the
appropriate list button. |
void |
setEditable(boolean editable)
Sets the boolean to indicate whether the customlist can be edited or not. |
void |
setEnabled(boolean enabled)
Sets the boolean to indicate whether the customlist should be disabled or not. |
void |
setListButtonDimensions(java.awt.Dimension dims)
Sets the dimensions for all the buttons in the custom list. |
void |
setSelectedRows(int[] idx)
|
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final short NULL
public static final short EMPTY_STRING_TRIM
public static final short EMPTY_STRING_NOTRIM
public static final short IGNORE
public static final short OR
public static final short AND
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.AddAction addAction
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.DeleteAction deleteAction
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.EditAction editAction
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.DuplicateAction duplicateAction
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.MoveUpAction moveUpAction
protected edu.ucsb.nceas.morpho.plugins.datapackagewizard.MoveDownAction moveDownAction
Constructor Detail |
public CustomList(java.lang.String[] colNames, java.lang.Object[] columnEditors, int displayRows, boolean showAddButton, boolean showEditButton, boolean showDuplicateButton, boolean showDeleteButton, boolean showMoveUpButton, boolean showMoveDownButton)
colNames
- array containing Strings for column names that will be
displayed at the top of each column.columnEditors
- array containing Objects that this class will use as
the default display and editing widget for the cells in
each column. For example,
String[] listValues = new String[] {"item 1", "item 2"};
Object[] columnEditors
= new Object[] { new JComboBox(listValues),
new JTextField() };
If any array element is null, the
corresponding column will be made non-editable, and if the
entire array is null, all columns will be made
non-editable.displayRows
- the number of rows that should be shown in the list for
display purposes. Note that this will be overridden if,
for example, the list is added to the center of a
BorderLayoutshowAddButton
- boolean value to indicate whether this button is
displayed next to the listshowEditButton
- boolean value to indicate whether this button is
displayed next to the listshowDuplicateButton
- boolean value to indicate whether this button is
displayed next to the listshowDeleteButton
- boolean value to indicate whether this button is
displayed next to the listshowMoveUpButton
- boolean value to indicate whether this button is
displayed next to the listshowMoveDownButton
- boolean value to indicate whether this button is
displayed next to the listMethod Detail |
public javax.swing.event.TableModelEvent getTableModelEvent()
public void setColumnWidthPercentages(double[] columnWidths)
columnWidths
- the array of doubles representing the percentage widths of the columnspublic void setBorderForButtonPanel(int top, int left, int bottom, int right)
top
- the spacing on top of the button panelleft
- the spacing on left of the button panelbottom
- the spacing on bottom of the button panelright
- the spacing on right of the button panelpublic void setListButtonDimensions(java.awt.Dimension dims)
dims
- the required Dimension for all the buttonspublic void focusAddButton()
public void scrollToRow(int row)
row
- the row to be scrolled to.public void fireEditingStopped()
public void fireAddAction()
public void fireEditAction()
public void fireDeleteAction()
public void fireDuplicateAction()
public void fireMoveUpAction()
public void fireMoveDownAction()
public int getSelectedRowIndex()
public java.util.List getSelectedRowList()
public java.util.List[] getSelectedRows()
public void setSelectedRows(int[] idx)
public void replaceSelectedRow(java.util.List newRow)
newRow
- List containing the objects in the new row that will replace
the currently-selected row.public void replaceRow(int rowIndex, java.util.List newRow)
rowIndex
- index of the row to be replacednewRow
- List containing the objects in the new row that will replace
the currently-selected row.public int getRowCount()
public void addRow(java.util.List rowList)
rowList
- List defining the row data. If the list has "n" columns,
the passed List may have 0 -> (n+1) elements as follows: public void removeRow(int row)
row
- index of the row to be removedpublic void removeAllRows()
public void deleteEmptyRows(short logicMode, short[] conditions)
short
array "conditions", as described below.
logicMode
- the logical mode in which the conditions will be .
processed CustomList.OR signifies that the row is
deleted if any of the conditions are met, and
CustomList.AND signifies that the row is deleted only if
all of the conditions are met.conditions
- The elements of the "conditions" array correspond to the
columns in the table (so element [0] defines the first
column, element [1] the second, and so on). Legal values
for the "conditions" array are:
public java.util.List getListOfRowLists()
java.util.List
containing elements that are also
java.util.List
objects, each of which represents a row from
the list. Therefore, element 0 in the return List will contain a List that
has the first row objects in it, and so on. Each row element will contain
the objects used to poopulate the list's (table-)model, so the minimum
number of entries in a row will be zero, and the max number will equal the
number of columns in the list
java.util.List
containing elements that are also
java.util.List
objects, each of which represents a row from
the listpublic void setCustomAddAction(javax.swing.Action a)
javax.swing.Action
to be executed on pressing the ADD
button. NOTE that if no custom add action is set, or if a null action is
set, the ADD button's 'private' Action (defined elsewhere in this class)
will be executed; otherwise the custom action will be executed (and the
'private' Action will NOT be executed). Note that this behavior is
different for the other custom action get/set methods, which are executed
IN ADDITION to private actions
a
- javax.swing.Action
to be executedpublic javax.swing.Action getCustomAddAction()
javax.swing.Action
to be executed on pressing the
ADD button. NOTE that if no custom add action is set, or if a null action
is set, the ADD button's 'private' Action (defined elsewhere in this
class) will be executed; otherwise the custom action will be executed (and
the 'private' Action will NOT be executed).
Note that this behavior is different for the other custom action
get/set methods, which are executed IN ADDITION to private actions
javax.swing.Action
to be executedpublic void setCustomEditAction(javax.swing.Action a)
javax.swing.Action
to be executed on pressing the
appropriate list button. NOTE that the button's 'private' Action (defined
elsewhere in this class) will be executed first, and then the custom action
will be executed
a
- javax.swing.Action
to be executedpublic javax.swing.Action getCustomEditAction()
javax.swing.Action
to be executed on pressing the
appropriate list button. NOTE that the button's 'private' Action (defined
elsewhere in this class) will be executed first, and then the custom
action will be executed
javax.swing.Action
to be executedpublic void setCustomDuplicateAction(javax.swing.Action a)
javax.swing.Action
to be executed on pressing the
appropriate list button. NOTE that the button's 'private' Action (defined
elsewhere in this class) will be executed first, and then the custom action
will be executed
a
- javax.swing.Action
to be executedpublic javax.swing.Action getCustomDuplicateAction()
javax.swing.Action
to be executed on pressing the
appropriate list button. NOTE that the button's 'private' Action (defined
elsewhere in this class) will be executed first, and then the custom
action will be executed
javax.swing.Action
to be executedpublic void setCustomDeleteAction(javax.swing.Action a)
javax.swing.Action
to be executed on pressing the
appropriate list button.
NOTE that if no custom delete action is set, or if a null action
is set, the DELETE button's 'private' Action (defined elsewhere in this
class) will be executed; otherwise the custom action will be executed (and
the 'private' Action will NOT be executed).
Note that this behavior is different for the other custom action
get/set methods, which are executed IN ADDITION to private actions
a
- javax.swing.Action
to be executedpublic javax.swing.Action getCustomDeleteAction()
javax.swing.Action
to be executed on pressing the
appropriate list button. NOTE that the button's 'private' Action (defined
elsewhere in this class) will be executed first, and then the custom
action will be executed
javax.swing.Action
to be executedpublic void setEditable(boolean editable)
editable
- boolean indicating whether the custom list can be edited or notpublic void editCellAt(int row, int col)
row
- the row of the cellcol
- the column of the cellpublic void selectAndEditCell(int row, int col)
public void setEnabled(boolean enabled)
enabled
- boolean indicating whether the custom list be enabled or notpublic boolean isEnabled()
public void setBackground(java.awt.Color bgColor)
bgColor
- boolean indicating whether the custom list can be edited or
not
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |