public abstract class AbstractCRUDTable<T>
extends javax.swing.JPanel
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractCRUDTable.Column<C> |
protected class |
AbstractCRUDTable.CRUDModel |
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected java.util.List<javax.swing.JButton> |
actions |
protected javax.swing.Action |
addAction |
protected javax.swing.Action |
deleteAction |
protected com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable.DeleteConfirm |
deleteConfirmPanel |
protected javax.swing.Action |
downAction |
protected javax.swing.Action |
editAction |
protected LoadingIcon |
loadingIcon |
protected javax.swing.JLabel |
loadingOverlay |
protected LoggerEx |
log |
protected AbstractCRUDTable.CRUDModel |
model |
protected boolean |
requireConfirmOnDelete |
protected javax.swing.JScrollPane |
scrollPane |
protected TouchscreenTable |
table |
protected java.util.List<AbstractCRUDTable.Column<?>> |
tableColumns |
protected javax.swing.Action |
upAction |
protected java.beans.PropertyChangeListener |
updatePCL
A property change listener that simply calls update()
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier | Constructor and Description |
---|---|
protected |
AbstractCRUDTable() |
protected |
AbstractCRUDTable(boolean initialize)
If initialize is false, the sub class must make sure to call initialize() in order to actually build the
component.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canAdd() |
protected boolean |
canDelete() |
protected boolean |
canEdit() |
protected javax.swing.JButton |
createToolbarButton(javax.swing.Action action) |
protected javax.swing.Icon |
getAddIcon() |
protected javax.swing.Icon |
getDeleteIcon() |
protected javax.swing.Icon |
getDownIcon() |
protected javax.swing.Icon |
getEditIcon() |
java.util.List<T> |
getItems() |
protected abstract java.lang.String |
getNoun()
Return the noun that describes the item being manipulated.
|
java.util.List<T> |
getSelected()
Returns a list of the selected items
|
protected javax.swing.Icon |
getUpIcon() |
protected void |
handleLoadingError(java.lang.Exception ex)
Called on the EDT if items() throws an exception
|
protected void |
initActions()
Create the addAction, editAction, and deleteAction
|
protected abstract void |
initColumns(java.util.List<AbstractCRUDTable.Column<?>> columns)
Add your columns to the list
|
protected void |
initialize(boolean callUpdate)
This sets up the UI.
|
protected void |
initLayout() |
protected LoggerEx |
initLogger() |
protected AbstractCRUDTable.CRUDModel |
initModel(java.util.List<AbstractCRUDTable.Column<?>> columns) |
protected javax.swing.JScrollPane |
initScrollPane(javax.swing.JTable table) |
protected TouchscreenTable |
initTable(javax.swing.table.TableModel model) |
protected abstract java.util.Collection<T> |
items()
Load the available items.
|
protected java.lang.String |
migInsets() |
protected abstract void |
onAdd()
Callback when the add action is pressed.
|
protected void |
onAfterLoad()
Called on the EDT after the table has re-loaded rows.
|
protected void |
onBeforeLoad()
Called on the EDT before the table re-loads its rows
|
protected abstract void |
onDelete(java.util.List<T> toDelete)
Callback when the delete action is pressed.
|
protected void |
onDoubleClick()
By default, simply calls onEdit if editing is allowed
|
protected abstract void |
onEdit(java.util.List<T> toEdit)
Callback when the edit action is pressed.
|
protected void |
onMoveDown(T toMove) |
protected void |
onMoveUp(T toMove) |
protected boolean |
ordered()
Override this to have up and down arrows
|
void |
setEnabled(boolean enabled) |
void |
setFont(java.awt.Font font) |
void |
setRowHeight(int height)
Sets the height of the rows of the child table
|
void |
update()
Call this when the item list has changed and needs to be reloaded
|
protected void |
updateAddText(java.lang.String message) |
void |
updateColumns()
Call this if you have altered the columns (for example, changing visibility)
|
protected void |
updateDeleteConfirm(java.lang.String message,
java.lang.String yesText,
java.lang.String noText,
LoggerEx log) |
protected void |
updateDeleteText(java.lang.String message) |
protected void |
updateDownText(java.lang.String message) |
protected void |
updateEditText(java.lang.String message) |
void |
updateEnabled()
Call to update the enabled-ness of the button actions.
|
void |
updateModel()
Rebuilds the columns and the model.
|
protected void |
updateUpText(java.lang.String message) |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected AbstractCRUDTable.CRUDModel model
protected javax.swing.JScrollPane scrollPane
protected TouchscreenTable table
protected java.util.List<AbstractCRUDTable.Column<?>> tableColumns
protected LoadingIcon loadingIcon
protected javax.swing.JLabel loadingOverlay
protected com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable.DeleteConfirm deleteConfirmPanel
protected javax.swing.Action addAction
protected javax.swing.Action editAction
protected javax.swing.Action deleteAction
protected javax.swing.Action upAction
protected javax.swing.Action downAction
protected boolean requireConfirmOnDelete
protected java.util.List<javax.swing.JButton> actions
protected LoggerEx log
protected java.beans.PropertyChangeListener updatePCL
protected AbstractCRUDTable()
protected AbstractCRUDTable(boolean initialize)
protected void initialize(boolean callUpdate)
protected LoggerEx initLogger()
public void updateEnabled()
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
protected abstract java.lang.String getNoun()
protected abstract void initColumns(java.util.List<AbstractCRUDTable.Column<?>> columns)
protected AbstractCRUDTable.CRUDModel initModel(java.util.List<AbstractCRUDTable.Column<?>> columns)
protected TouchscreenTable initTable(javax.swing.table.TableModel model)
protected javax.swing.JScrollPane initScrollPane(javax.swing.JTable table)
protected javax.swing.Icon getAddIcon()
protected javax.swing.Icon getEditIcon()
protected javax.swing.Icon getDeleteIcon()
protected javax.swing.Icon getUpIcon()
protected javax.swing.Icon getDownIcon()
protected void initActions()
protected void updateAddText(java.lang.String message)
protected void updateEditText(java.lang.String message)
protected void updateDeleteText(java.lang.String message)
protected void updateUpText(java.lang.String message)
protected void updateDownText(java.lang.String message)
protected void updateDeleteConfirm(java.lang.String message, java.lang.String yesText, java.lang.String noText, LoggerEx log)
protected javax.swing.JButton createToolbarButton(javax.swing.Action action)
protected void initLayout()
protected java.lang.String migInsets()
public void setFont(java.awt.Font font)
setFont
in class javax.swing.JComponent
public java.util.List<T> getSelected()
public java.util.List<T> getItems()
protected boolean canAdd()
protected boolean canEdit()
protected boolean canDelete()
protected boolean ordered()
protected abstract void onAdd()
protected abstract void onEdit(java.util.List<T> toEdit)
protected abstract void onDelete(java.util.List<T> toDelete)
protected void onDoubleClick()
protected void onMoveUp(T toMove)
protected void onMoveDown(T toMove)
protected void onAfterLoad()
protected void onBeforeLoad()
protected abstract java.util.Collection<T> items() throws java.lang.Exception
java.lang.Exception
public void updateColumns()
public void update()
public void updateModel()
protected void handleLoadingError(java.lang.Exception ex)
public void setRowHeight(int height)