edu.princeton.swing
public class PList extends javax.swing.JList implements ClipboardTarget
Modifier and Type | Class and Description |
---|---|
protected class |
PList.Listener
The Listener listenes to the selection model of this list to capture PropertyChangeEvents.
|
protected static class |
PList.PListCellRenderer
PListCellRenderer is a subclass of DefaultListCellRenderer which will correctly
render the border specified by the PList.
|
javax.swing.JList.AccessibleJList, javax.swing.JList.DropLocation
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
protected javax.swing.border.Border |
focusedCellBorder |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
PList()
Constructs a new PList.
|
PList(javax.swing.ListModel dataModel)
Constructs a new PList.
|
PList(java.lang.Object[] listData)
Constructs a new PList.
|
PList(java.util.Vector listData)
Constructs a new PList.
|
Modifier and Type | Method and Description |
---|---|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds a listener to monitor action events (enter key events) on the PTextField.
|
boolean |
canCopy()
Returns wheter or not the copy operation can be performed on this ClipboardTarget.
|
boolean |
canCut()
Returns wheter or not the cut operation can be performed on this ClipboardTarget.
|
boolean |
canPaste()
Returns wheter or not the paste operation can be performed on this ClipboardTarget.
|
boolean |
canSelectAll()
Returns wheter or not the selectAll operation can be performed on this ClipboardTarget.
|
void |
copy()
Copies the selection to the clipboard.
|
protected javax.swing.ListSelectionModel |
createSelectionModel()
Override the createSelectionModel function to use our own selectionModel function which
actually monitors the selection mode.
|
void |
cut()
Copies the selection to the clipboard and remove it from the object.
|
java.lang.String |
getActionCommand()
Returns the action command associated with the enter key being pressed.
|
javax.swing.border.Border |
getFocusedCellBorder()
Return the border that should be rendered for a focused cell.
|
javax.swing.JPopupMenu |
getPopupMenu()
Gets the popup menu for this component.
|
javax.swing.border.Border |
getUnfocusedCellBorder()
Return the border that should be rendered for an unfocused cell.
|
void |
paste()
Inserts the contents of the clipbaord into the object.
|
protected void |
processFocusEvent(java.awt.event.FocusEvent e)
Intercept FocusEvents to notify the ClipboardTargetManager of the event.
|
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
Intercept MouseEvents to activate the popupMenu at the right time.
|
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes a listener from this component.
|
void |
selectAll()
Selects everything in the object.
|
void |
setActionCommand(java.lang.String actionCommand)
Sets the action command associated with the enter key being pressed.
|
void |
setEnabled(boolean enabled)
Override the setEnabled() method to intercept any changes concerning the enabled status of
the component.
|
void |
setPopupMenu(javax.swing.JPopupMenu popupMenu)
Sets the popup menu for this component.
|
void |
setSelectionBackground(java.awt.Color selectionBackground)
Override the setSelectionBackground() method to intercept any changes concerning the
background color of the selection.
|
void |
setSelectionModel(javax.swing.ListSelectionModel selectionModel)
Override the setSelectionModel method to reject any attempt to change the selection model
to a model which does not implement PropertiedListSelectionModel.
|
addListSelectionListener, addSelectionInterval, clearSelection, ensureIndexIsVisible, fireSelectionValueChanged, getAccessibleContext, getAnchorSelectionIndex, getCellBounds, getCellRenderer, getDragEnabled, getDropLocation, getDropMode, getFirstVisibleIndex, getFixedCellHeight, getFixedCellWidth, getLastVisibleIndex, getLayoutOrientation, getLeadSelectionIndex, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getModel, getNextMatch, getPreferredScrollableViewportSize, getPrototypeCellValue, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedIndex, getSelectedIndices, getSelectedValue, getSelectedValues, getSelectionBackground, getSelectionForeground, getSelectionMode, getSelectionModel, getToolTipText, getUI, getUIClassID, getValueIsAdjusting, getVisibleRowCount, indexToLocation, isSelectedIndex, isSelectionEmpty, locationToIndex, paramString, removeListSelectionListener, removeSelectionInterval, setCellRenderer, setDragEnabled, setDropMode, setFixedCellHeight, setFixedCellWidth, setLayoutOrientation, setListData, setListData, setModel, setPrototypeCellValue, setSelectedIndex, setSelectedIndices, setSelectedValue, setSelectionForeground, setSelectionInterval, setSelectionMode, setUI, setValueIsAdjusting, setVisibleRowCount, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, 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, hide, 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, 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
public PList()
public PList(javax.swing.ListModel dataModel)
public PList(java.lang.Object[] listData)
public PList(java.util.Vector listData)
public void addActionListener(java.awt.event.ActionListener listener)
listener
- The listener to add to this document. A null value will cause a
NullPointerException.public void removeActionListener(java.awt.event.ActionListener listener)
listener
- The listener to remove from this document. A null value will cause a
NullPointerException.public java.lang.String getActionCommand()
public void setActionCommand(java.lang.String actionCommand)
actionCommand
- The action command to be associated with the enter key. If null is
passed, the text of the text field at the time of the event will be used.public boolean canCut()
canCut
in interface ClipboardTarget
public void cut()
cut
in interface ClipboardTarget
public boolean canCopy()
canCopy
in interface ClipboardTarget
public void copy()
copy
in interface ClipboardTarget
public boolean canPaste()
canPaste
in interface ClipboardTarget
public void paste()
paste
in interface ClipboardTarget
public boolean canSelectAll()
canSelectAll
in interface ClipboardTarget
public void selectAll()
selectAll
in interface ClipboardTarget
protected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class javax.swing.JComponent
public void setSelectionBackground(java.awt.Color selectionBackground)
setSelectionBackground
in class javax.swing.JList
public javax.swing.border.Border getFocusedCellBorder()
public javax.swing.border.Border getUnfocusedCellBorder()
public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
public void setSelectionModel(javax.swing.ListSelectionModel selectionModel)
setSelectionModel
in class javax.swing.JList
protected javax.swing.ListSelectionModel createSelectionModel()
createSelectionModel
in class javax.swing.JList
public javax.swing.JPopupMenu getPopupMenu()
public void setPopupMenu(javax.swing.JPopupMenu popupMenu)
popupMenu
- The popup menu for the component. A null value indicates that this
component should not have a popup menu.