final class DataSourceComboBox extends JComboBox<DataSourceComboBox.DataSourceItem> implements PropertyChangeListener, ActionListener
This component is not directly connected to an event loop, so it must catch changes to the configuration via property change events and then update its state accordingly.
Only a single "global" ET item is kept in the list, and it is updated as changes are made to the configuration model.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
DataSourceComboBox.DataSourceItem
This class represents a data source item in the combo box, which has a name for display, a full path to the file,
and an implicit type (EVIO, LCIO or ET).
|
JComboBox.AccessibleJComboBox, JComboBox.KeySelectionManager
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
private ConfigurationModel |
configurationModel
The backing configuration model.
|
private static int |
PREFERRED_WIDTH
The preferred width of this component in pixels.
|
actionCommand, dataModel, editor, isEditable, keySelectionManager, lightWeightPopupEnabled, maximumRowCount, renderer, selectedItemReminder
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
DataSourceComboBox(ConfigurationModel configurationModel,
ConnectionStatusModel connectionModel)
Create a new data source combo box.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt)
Handle action events.
|
(package private) DataSourceComboBox.DataSourceItem |
addDataSourceItem(String path,
DataSourceType type)
Add a data source item with a specific type and path.
|
void |
addItem(DataSourceComboBox.DataSourceItem item)
Add a data source item.
|
(package private) boolean |
containsItem(DataSourceComboBox.DataSourceItem item)
Return true if the (exact) given item exists in the combo box model.
|
(package private) DataSourceComboBox.DataSourceItem |
findEtItem()
Find the single data source item for the ET configuration in the items.
|
(package private) DataSourceComboBox.DataSourceItem |
findItem(String path)
Find an item by its path.
|
void |
propertyChange(PropertyChangeEvent evt)
Handle property change events which is used to update the GUI from changes to the global configuration model.
|
void |
setSelectedItem(Object object)
Set the currently selected item.
|
(package private) void |
updateEtItem()
Update the path value of the current ET item from the current global configuration.
|
actionPropertyChanged, addActionListener, addItemListener, addPopupMenuListener, configureEditor, configurePropertiesFromAction, contentsChanged, createActionPropertyChangeListener, createDefaultKeySelectionManager, fireActionEvent, fireItemStateChanged, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getAction, getActionCommand, getActionListeners, getEditor, getItemAt, getItemCount, getItemListeners, getKeySelectionManager, getMaximumRowCount, getModel, getPopupMenuListeners, getPrototypeDisplayValue, getRenderer, getSelectedIndex, getSelectedItem, getSelectedObjects, getUI, getUIClassID, hidePopup, insertItemAt, installAncestorListener, intervalAdded, intervalRemoved, isEditable, isLightWeightPopupEnabled, isPopupVisible, paramString, processKeyBinding, processKeyEvent, removeActionListener, removeAllItems, removeItem, removeItemAt, removeItemListener, removePopupMenuListener, selectedItemChanged, selectWithKeyChar, setAction, setActionCommand, setEditable, setEditor, setEnabled, setKeySelectionManager, setLightWeightPopupEnabled, setMaximumRowCount, setModel, setPopupVisible, setPrototypeDisplayValue, setRenderer, setSelectedIndex, setUI, showPopup, 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, 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, setFont, 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
private static final int PREFERRED_WIDTH
private ConfigurationModel configurationModel
DataSourceComboBox(ConfigurationModel configurationModel, ConnectionStatusModel connectionModel)
configurationModel
- the underlying configuration data modelconnectionModel
- the underlying connection status data modelpublic void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
actionPerformed
in class JComboBox<DataSourceComboBox.DataSourceItem>
evt
- the ActionEvent
to handleDataSourceComboBox.DataSourceItem addDataSourceItem(String path, DataSourceType type)
path
- the data source pathtype
- the data source typepublic void addItem(DataSourceComboBox.DataSourceItem item)
addItem
in class JComboBox<DataSourceComboBox.DataSourceItem>
boolean containsItem(DataSourceComboBox.DataSourceItem item)
item
- the data source itemtrue
if data source item exists in the modelDataSourceComboBox.DataSourceItem findEtItem()
null
if does not existDataSourceComboBox.DataSourceItem findItem(String path)
path
- the path of the itemnull
if does not existpublic void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
evt
- the property change eventpublic void setSelectedItem(Object object)
setSelectedItem
in class JComboBox<DataSourceComboBox.DataSourceItem>
object
- the currently selected item (should be an instance of this class)void updateEtItem()
Copyright © 2019. All rights reserved.