Class AbstractCRUDTable<T>
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable<T>
- All Implemented Interfaces:
- ImageObserver,- MenuContainer,- Serializable,- Accessible
- Direct Known Subclasses:
- TermTable
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected classprotected classNested classes/interfaces inherited from class javax.swing.JPanelJPanel.AccessibleJPanelNested classes/interfaces inherited from class javax.swing.JComponentJComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.ContainerContainer.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.ComponentComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected Actionprotected Actionprotected AbstractCRUDTable<T>.com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable.DeleteConfirmprotected Actionprotected Actionprotected LoadingIconprotected JLabelprotected LoggerExprotected AbstractCRUDTable<T>.CRUDModelprotected booleanprotected JScrollPaneprotected TouchscreenTableprotected List<AbstractCRUDTable<T>.Column<?>>protected Actionprotected PropertyChangeListenerA property change listener that simply calls update()Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.ComponentaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserverABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedprotectedAbstractCRUDTable(boolean initialize) If initialize is false, the sub class must make sure to call initialize() in order to actually build the component.
- 
Method SummaryModifier and TypeMethodDescriptionprotected booleancanAdd()protected booleanprotected booleancanEdit()protected JButtoncreateToolbarButton(Action action) protected Iconprotected Iconprotected Iconprotected IconGets the table's header background color.Gets the table's header text color.getItems()protected abstract StringgetNoun()Return the noun that describes the item being manipulated.Returns a list of the selected itemsgetTable()Getter for the internalJTableGets the table's background color.Gets the table's text color.protected Iconprotected voidCalled on the EDT if items() throws an exceptionprotected voidCreate the addAction, editAction, and deleteActionprotected abstract voidinitColumns(List<AbstractCRUDTable<T>.Column<?>> columns) Add your columns to the listprotected voidinitialize(boolean callUpdate) This sets up the UI.protected voidprotected LoggerExprotected AbstractCRUDTable<T>.CRUDModelinitModel(List<AbstractCRUDTable<T>.Column<?>> columns) protected JScrollPaneinitScrollPane(JTable table) protected TouchscreenTableinitTable(TableModel model) protected abstract Collection<T>items()Load the available items.protected Stringprotected abstract voidonAdd()Callback when the add action is pressed.protected voidCalled on the EDT after the table has re-loaded rows.protected voidCalled on the EDT before the table re-loads its rowsprotected abstract voidCallback when the delete action is pressed.protected voidBy default, simply calls onEdit if editing is allowedprotected abstract voidCallback when the edit action is pressed.protected voidonMoveDown(T toMove) protected voidprotected booleanordered()Override this to have up and down arrowsvoidsetEnabled(boolean enabled) voidvoidsetHeaderBackground(Color color) Sets the header background to this table.voidsetHeaderTextColor(Color color) Sets the header text color to this table.voidsetRowHeight(int height) Sets the height of the rows of the child tablevoidsetTableBackground(Color color) Sets the background to this table.voidsetTableForeground(Color color) Sets the text color to this table.voidsetWindowBackground(Color color) Sets the background color of the window to the passedColor.voidsetWindowForeground(Color color) Sets the text color of the window to the passedColor.voidupdate()Call this when the item list has changed and needs to be reloadedprotected voidupdateAddText(String message) voidCall this if you have altered the columns (for example, changing visibility)protected voidupdateDeleteConfirm(String message, String yesText, String noText, LoggerEx log) protected voidupdateDeleteText(String message) protected voidupdateDownText(String message) protected voidupdateEditText(String message) voidCall to update the enabled-ness of the button actions.voidRebuilds the columns and the model.protected voidupdateUpText(String message) Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods inherited from class javax.swing.JComponentaddAncestorListener, 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, updateMethods inherited from class java.awt.Containeradd, 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, validateTreeMethods inherited from class java.awt.Componentaction, 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, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
- 
Field Details- 
model
- 
scrollPane
- 
table
- 
tableColumns
- 
loadingIcon
- 
loadingOverlay
- 
deleteConfirmPanelprotected AbstractCRUDTable<T>.com.inductiveautomation.ignition.client.util.gui.AbstractCRUDTable.DeleteConfirm deleteConfirmPanel
- 
addAction
- 
editAction
- 
deleteAction
- 
upAction
- 
downAction
- 
requireConfirmOnDeleteprotected boolean requireConfirmOnDelete
- 
actions
- 
log
- 
updatePCLA property change listener that simply calls update()
 
- 
- 
Constructor Details- 
AbstractCRUDTableprotected AbstractCRUDTable()
- 
AbstractCRUDTableprotected AbstractCRUDTable(boolean initialize) If initialize is false, the sub class must make sure to call initialize() in order to actually build the component.On a side note, if the subclass does not want "update" to be called immediately, it must pass false to this function, and then manually call initialize, passing in "false" for the "call update" argument. 
 
- 
- 
Method Details- 
initializeprotected void initialize(boolean callUpdate) This sets up the UI. Only call it once.
- 
initLogger
- 
updateEnabledpublic void updateEnabled()Call to update the enabled-ness of the button actions. Automatically called when the selection changes.
- 
setEnabledpublic void setEnabled(boolean enabled) - Overrides:
- setEnabledin class- JComponent
 
- 
getNounReturn the noun that describes the item being manipulated.
- 
initColumnsAdd your columns to the list
- 
initModel
- 
initTable
- 
initScrollPane
- 
getAddIcon
- 
getEditIcon
- 
getDeleteIcon
- 
getUpIcon
- 
getDownIcon
- 
initActionsprotected void initActions()Create the addAction, editAction, and deleteAction
- 
updateAddText
- 
updateEditText
- 
updateDeleteText
- 
updateUpText
- 
updateDownText
- 
updateDeleteConfirm
- 
createToolbarButton
- 
initLayoutprotected void initLayout()
- 
migInsets
- 
setFont- Overrides:
- setFontin class- JComponent
 
- 
setWindowBackgroundSets the background color of the window to the passedColor.- Parameters:
- color- the- Colorthe window is to be set to. Must not be null.
 
- 
setWindowForegroundSets the text color of the window to the passedColor.- Parameters:
- color- the- Colorthe windows text is to be set to. Must not be null.
 
- 
setHeaderBackgroundSets the header background to this table. This is here for setting this components color via a property.- Parameters:
- color- the specified color. Must not be null
 
- 
setHeaderTextColorSets the header text color to this table. This is here for setting this components color via a property.- Parameters:
- color- the specified color. Must not be null
 
- 
setTableBackgroundSets the background to this table. This is here for setting this components color via a property.- Parameters:
- color- the specified color. Must not be null
 
- 
setTableForegroundSets the text color to this table. This is here for setting this components color via a property.- Parameters:
- color- the specified color. Must not be null
 
- 
getHeaderBackgroundGets the table's header background color. This is here for setting this components color via a property.- Returns:
- the table's header background color. Will not be null
 
- 
getHeaderTextColorGets the table's header text color. This is here for setting this components color via a property.- Returns:
- the table's header text color. Will not be null
 
- 
getTableBackgroundGets the table's background color. This is here for setting this components color via a property.- Returns:
- the table's background color. Will not be null
 
- 
getTableForegroundGets the table's text color. This is here for setting this components color via a property.- Returns:
- the table's text color. Will not be null
 
- 
getSelectedReturns a list of the selected items
- 
getItems
- 
canAddprotected boolean canAdd()- Returns:
- if adding an item is currently available
 
- 
canEditprotected boolean canEdit()- Returns:
- if editing an item is currently available
 
- 
canDeleteprotected boolean canDelete()- Returns:
- if deleting an item is currently available
 
- 
orderedprotected boolean ordered()Override this to have up and down arrows
- 
onAddprotected abstract void onAdd()Callback when the add action is pressed. Take some action to add an item, and later call update()
- 
onEditCallback when the edit action is pressed. Take some action to edit the item(s), and later call update()
- 
onDeleteCallback when the delete action is pressed. Take some action to edit the item(s), and later call update()
- 
onDoubleClickprotected void onDoubleClick()By default, simply calls onEdit if editing is allowed
- 
onMoveUp
- 
onMoveDown
- 
onAfterLoadprotected void onAfterLoad()Called on the EDT after the table has re-loaded rows.
- 
onBeforeLoadprotected void onBeforeLoad()Called on the EDT before the table re-loads its rows
- 
itemsLoad the available items. Note that this is always called OFF the EDT so it is safe to do network access here if need be. (but it is NOT safe to interact with the UI)- Throws:
- Exception
 
- 
updateColumnspublic void updateColumns()Call this if you have altered the columns (for example, changing visibility)
- 
updatepublic void update()Call this when the item list has changed and needs to be reloaded
- 
updateModelpublic void updateModel()Rebuilds the columns and the model.
- 
handleLoadingErrorCalled on the EDT if items() throws an exception
- 
setRowHeightpublic void setRowHeight(int height) Sets the height of the rows of the child table
- 
getTableGetter for the internalJTable- Returns:
- The internal JTable
 
 
-