public abstract class AbstractBookmarksPanel extends BasePanel
JFileChooser.
You can customize the panel by implementing the newFactory()
method, returning a custom factory class instance.
JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy| Modifier and Type | Field and Description |
|---|---|
protected JButton |
m_ButtonAdd
the button for adding a bookmark.
|
protected JButton |
m_ButtonCopy
the button for copying the current directory.
|
protected JButton |
m_ButtonMoveDown
the button for moving a bookmark down.
|
protected JButton |
m_ButtonMoveUp
the button for moving a bookmark up.
|
protected JButton |
m_ButtonPaste
the button for pasting the directory from the clipboard.
|
protected JButton |
m_ButtonRemove
the button for remove a bookmark.
|
protected PropertyChangeListener |
m_DirChangeListener
the listener for directory changes.
|
protected AbstractFactory |
m_Factory
the factor to use.
|
protected AbstractIconLoader |
m_IconLoader
the icon loader to use.
|
protected BaseList |
m_ListBookmarks
the list of bookmarks.
|
protected DefaultListModel |
m_ModelBookmarks
the list model with the bookmarks.
|
protected Communication |
m_Owner
the owner.
|
protected JPanel |
m_PanelButtons
the panel for the buttons.
|
protected boolean |
m_SkipDirectoryChanges
whether to skip changes to current directory.
|
static int |
MAX_PATH_LENGTH
the maximum length of string to inspect.
|
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
AbstractBookmarksPanel() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBookmark()
Adds a bookmark, if possible.
|
protected void |
copyCurrentDirToClipboard()
Copies the current directory to the clipboard.
|
protected Bookmark |
createUniqueBookmark(Bookmark bookmark,
DefaultListModel model)
Ensures that the bookmark has a unique name in the model.
|
AbstractBookmarksManager |
getBookmarksManger()
Returns the bookmarks manager to use.
|
Communication |
getOwner()
Returns the owner.
|
protected JPopupMenu |
getPopupMenu(MouseEvent e)
Creates a popup menu for the
BaseList. |
Dimension |
getPreferredSize()
Returns the preferred size.
|
protected void |
initGUI()
Initializes the widgets.
|
protected void |
initialize()
Initializes the members.
|
protected boolean |
isValidPath(String dirStr)
Checks whether the string represents a valid directory.
|
protected DefaultListModel |
loadBookmarks()
Loads all the bookmarks that are currently stored in the properties.
|
protected abstract AbstractFactory |
newFactory()
Creates a new instance of the factory.
|
protected void |
pasteCurrentDirFromClipboard()
Pastes the current directory from the clipboard.
|
void |
reload()
Reloads the bookmarks.
|
protected void |
removeBookmark(int[] indices)
Removes one or more bookmarks.
|
protected void |
renameBookmark(int index)
Renames the bookmark.
|
protected boolean |
saveBookmarks(DefaultListModel model)
Saves all the bookmarks in the properties.
|
void |
setOwner(Communication value)
Sets the owner.
|
void |
setOwner(JFileChooser value)
Sets the owner.
|
void |
updateButtons()
Updates the enabled state of the buttons.
|
afterHide, afterShow, beforeHide, beforeShow, closeParent, finishInit, getParentDialog, getParentFrame, getParentInternalFrame, getParentTitle, main, printErrorMessage, printException, setParentTitle, setVisiblegetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIaddAncestorListener, 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, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, 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, validateTreeaction, 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, transferFocusUpCyclepublic static final int MAX_PATH_LENGTH
protected Communication m_Owner
protected BaseList m_ListBookmarks
protected DefaultListModel m_ModelBookmarks
protected JPanel m_PanelButtons
protected JButton m_ButtonAdd
protected JButton m_ButtonRemove
protected JButton m_ButtonMoveUp
protected JButton m_ButtonMoveDown
protected JButton m_ButtonCopy
protected JButton m_ButtonPaste
protected PropertyChangeListener m_DirChangeListener
protected boolean m_SkipDirectoryChanges
protected AbstractFactory m_Factory
protected AbstractIconLoader m_IconLoader
protected void initialize()
initialize in class BasePanelpublic void setOwner(JFileChooser value)
value - the new ownerpublic void setOwner(Communication value)
value - the new ownerpublic Communication getOwner()
protected JPopupMenu getPopupMenu(MouseEvent e)
BaseList.e - the event that triggered the menuprotected Bookmark createUniqueBookmark(Bookmark bookmark, DefaultListModel model)
bookmark - the initial bookmarkmodel - the model with bookmarksprotected void addBookmark()
protected void removeBookmark(int[] indices)
indices - the indices to removeprotected void renameBookmark(int index)
index - the index of the bookmark to renameprotected DefaultListModel loadBookmarks()
protected boolean saveBookmarks(DefaultListModel model)
model - the current bookmarksprotected void copyCurrentDirToClipboard()
protected boolean isValidPath(String dirStr)
dirStr - the string to testprotected void pasteCurrentDirFromClipboard()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void updateButtons()
public void reload()
protected abstract AbstractFactory newFactory()
public AbstractBookmarksManager getBookmarksManger()
Copyright © 2022. All rights reserved.