Class DarkFilePaneUIBridge
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- com.github.weisj.darklaf.ui.filechooser.DarkFilePaneUIBridge
-
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,PropertyChangeListener
,Serializable
,EventListener
,Accessible
- Direct Known Subclasses:
DarkFilePane
public abstract class DarkFilePaneUIBridge extends JPanel implements PropertyChangeListener
WARNING: This class is an implementation detail and is only public so that it can be used by two packages. You should NOT consider this public API.This component is intended to be used in a subclass of javax.swing.plaf.basic.BasicFileChooserUI. It realies heavily on the implementation of BasicFileChooserUI, and is intended to be API compatible with earlier implementations of MetalFileChooserUI and WindowsFileChooserUI.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
DarkFilePaneUIBridge.AlignableTableHeaderRenderer
protected class
DarkFilePaneUIBridge.DelayedSelectionUpdater
class
DarkFilePaneUIBridge.DetailsTableCellRenderer
protected class
DarkFilePaneUIBridge.DetailsTableRowSorter
protected class
DarkFilePaneUIBridge.DirectoriesFirstComparatorWrapper
This class sorts directories before files, comparing directory to directory and file to file using the wrapped comparator.protected class
DarkFilePaneUIBridge.EditActionListener
static interface
DarkFilePaneUIBridge.FileChooserUIAccessor
protected class
DarkFilePaneUIBridge.Handler
protected class
DarkFilePaneUIBridge.SortableListModel
This model allows for sorting JListprotected class
DarkFilePaneUIBridge.ViewTypeAction
-
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
-
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
-
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
-
Field Summary
-
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
-
Constructor Summary
Constructors Constructor Description DarkFilePaneUIBridge(DarkFilePaneUIBridge.FileChooserUIAccessor fileChooserUIAccessor)
-
Method Summary
Modifier and Type Method Description static void
addActionsToMap(ActionMap map, Action[] actions)
protected void
applyEdit()
protected abstract void
cancelEdit()
static boolean
canWrite(File f, JFileChooser chooser)
void
clearSelection()
protected void
createActionMap()
abstract JPanel
createDetailsView()
abstract JPanel
createList()
ListSelectionListener
createListSelectionListener()
Creates a selection listener for the list of files and directories.protected void
doDeselectFile(Object fileToDeselect)
protected void
doDirectoryChanged(PropertyChangeEvent e)
protected void
doFileSelectionModeChanged(PropertyChangeEvent e)
protected void
doFilterChanged(PropertyChangeEvent e)
protected void
doMultiSelectionChanged(PropertyChangeEvent e)
protected void
doSelectedFileChanged(PropertyChangeEvent e)
protected void
doSelectedFilesChanged(PropertyChangeEvent e)
protected void
doSelectFile(File fileToSelect)
protected abstract void
editFileName(int index)
void
ensureFileIsVisible(JFileChooser fc, File f)
protected void
ensureIndexIsVisible(int i)
protected <T> T
findChildComponent(Container container, Class<T> cls)
protected void
fixNameColumnWidth(int viewWidth)
Action[]
getActions()
Fetches the command list for the FilePane.abstract JPopupMenu
getComponentPopupMenu()
protected abstract TableCellEditor
getDetailsTableCellEditor()
protected com.github.weisj.darklaf.ui.filechooser.DarkFilePaneUIBridge.DetailsTableModel
getDetailsTableModel()
protected File
getDirectory()
Property to remember the directory that is currently selected in the UI.protected int
getEditIndex()
protected JFileChooser
getFileChooser()
protected BasicDirectoryModel
getModel()
protected abstract DarkFilePaneUIBridge.Handler
getMouseHandler()
Action
getNewFolderAction()
protected DarkFilePaneUIBridge.DetailsTableRowSorter
getRowSorter()
abstract JMenu
getViewMenu()
int
getViewType()
Action
getViewTypeAction(int viewType)
protected void
installDefaults()
protected boolean
isDirectorySelected()
Property to remember whether a directory is currently selected in the UI.void
propertyChange(PropertyChangeEvent e)
protected static void
recursivelySetInheritsPopupMenu(Container container, boolean b)
void
rescanCurrentDirectory()
protected void
resetEditIndex()
protected void
setEditIndex(int i)
void
setViewType(int viewType)
void
uninstallUI()
protected void
updateDetailsColumnModel(JTable table)
protected void
updateListRowCount(JList<?> list)
protected abstract void
updateViewMenu()
static boolean
usesShellFolder(JFileChooser chooser)
Returns true if specified FileChooser should use ShellFolder-
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
-
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
-
Methods inherited from class java.awt.Container
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
-
Methods inherited from class java.awt.Component
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, 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 Detail
-
ACTION_APPROVE_SELECTION
public static final String ACTION_APPROVE_SELECTION
- See Also:
- Constant Field Values
-
ACTION_CANCEL
public static final String ACTION_CANCEL
- See Also:
- Constant Field Values
-
ACTION_EDIT_FILE_NAME
public static final String ACTION_EDIT_FILE_NAME
- See Also:
- Constant Field Values
-
ACTION_REFRESH
public static final String ACTION_REFRESH
- See Also:
- Constant Field Values
-
ACTION_CHANGE_TO_PARENT_DIRECTORY
public static final String ACTION_CHANGE_TO_PARENT_DIRECTORY
- See Also:
- Constant Field Values
-
ACTION_NEW_FOLDER
public static final String ACTION_NEW_FOLDER
- See Also:
- Constant Field Values
-
ACTION_VIEW_LIST
public static final String ACTION_VIEW_LIST
- See Also:
- Constant Field Values
-
ACTION_VIEW_DETAILS
public static final String ACTION_VIEW_DETAILS
- See Also:
- Constant Field Values
-
VIEWTYPE_LIST
public static final int VIEWTYPE_LIST
- See Also:
- Constant Field Values
-
VIEWTYPE_DETAILS
public static final int VIEWTYPE_DETAILS
- See Also:
- Constant Field Values
-
VIEWTYPE_COUNT
protected static final int VIEWTYPE_COUNT
- See Also:
- Constant Field Values
-
waitCursor
protected static final Cursor waitCursor
-
COLUMN_FILENAME
protected static final int COLUMN_FILENAME
- See Also:
- Constant Field Values
-
COLUMN_SIZE
protected static final int COLUMN_SIZE
- See Also:
- Constant Field Values
-
repaintListener
protected static final FocusListener repaintListener
-
actions
protected Action[] actions
-
viewType
protected int viewType
-
viewPanels
protected final JPanel[] viewPanels
-
currentViewPanel
protected JPanel currentViewPanel
-
viewTypeActionNames
protected String[] viewTypeActionNames
-
filesListAccessibleName
protected String filesListAccessibleName
-
filesDetailsAccessibleName
protected String filesDetailsAccessibleName
-
contextMenu
protected JPopupMenu contextMenu
-
viewMenu
protected JMenu viewMenu
-
viewMenuLabelText
protected String viewMenuLabelText
-
refreshActionLabelText
protected String refreshActionLabelText
-
newFolderActionLabelText
protected String newFolderActionLabelText
-
kiloByteString
protected String kiloByteString
-
megaByteString
protected String megaByteString
-
gigaByteString
protected String gigaByteString
-
renameErrorTitleText
protected String renameErrorTitleText
-
renameErrorText
protected String renameErrorText
-
renameErrorFileExistsText
protected String renameErrorFileExistsText
-
smallIconsView
protected final boolean smallIconsView
- See Also:
- Constant Field Values
-
listViewBorder
protected Border listViewBorder
-
listViewBackground
protected Color listViewBackground
-
listViewWindowsStyle
protected boolean listViewWindowsStyle
-
readOnly
protected boolean readOnly
-
fullRowSelection
protected boolean fullRowSelection
-
listSelectionModel
protected ListSelectionModel listSelectionModel
-
list
protected JList<?> list
-
detailsTable
protected JTable detailsTable
-
newFolderFile
protected File newFolderFile
-
fileChooserUIAccessor
protected final DarkFilePaneUIBridge.FileChooserUIAccessor fileChooserUIAccessor
-
detailsTableModel
protected com.github.weisj.darklaf.ui.filechooser.DarkFilePaneUIBridge.DetailsTableModel detailsTableModel
-
rowSorter
protected DarkFilePaneUIBridge.DetailsTableRowSorter rowSorter
-
detailsKeyListener
protected final KeyListener detailsKeyListener
-
newFolderAction
protected Action newFolderAction
-
handler
protected DarkFilePaneUIBridge.Handler handler
-
editorFocusListener
protected final FocusListener editorFocusListener
-
-
Constructor Detail
-
DarkFilePaneUIBridge
public DarkFilePaneUIBridge(DarkFilePaneUIBridge.FileChooserUIAccessor fileChooserUIAccessor)
-
-
Method Detail
-
recursivelySetInheritsPopupMenu
protected static void recursivelySetInheritsPopupMenu(Container container, boolean b)
-
canWrite
public static boolean canWrite(File f, JFileChooser chooser)
-
usesShellFolder
public static boolean usesShellFolder(JFileChooser chooser)
Returns true if specified FileChooser should use ShellFolder- Parameters:
chooser
- the chooser- Returns:
- the boolean
-
uninstallUI
public void uninstallUI()
-
getModel
protected BasicDirectoryModel getModel()
-
getViewType
public int getViewType()
-
setViewType
public void setViewType(int viewType)
-
getViewTypeAction
public Action getViewTypeAction(int viewType)
-
installDefaults
protected void installDefaults()
-
getActions
public Action[] getActions()
Fetches the command list for the FilePane. These commands are useful for binding to events, such as in a keymap.- Returns:
- the command list
-
createActionMap
protected void createActionMap()
-
updateListRowCount
protected void updateListRowCount(JList<?> list)
-
createList
public abstract JPanel createList()
-
getDetailsTableModel
protected com.github.weisj.darklaf.ui.filechooser.DarkFilePaneUIBridge.DetailsTableModel getDetailsTableModel()
-
updateDetailsColumnModel
protected void updateDetailsColumnModel(JTable table)
-
getDetailsTableCellEditor
protected abstract TableCellEditor getDetailsTableCellEditor()
-
createDetailsView
public abstract JPanel createDetailsView()
-
fixNameColumnWidth
protected void fixNameColumnWidth(int viewWidth)
-
createListSelectionListener
public ListSelectionListener createListSelectionListener()
Creates a selection listener for the list of files and directories.- Returns:
- a
ListSelectionListener
-
getEditIndex
protected int getEditIndex()
-
setEditIndex
protected void setEditIndex(int i)
-
resetEditIndex
protected void resetEditIndex()
-
cancelEdit
protected abstract void cancelEdit()
-
editFileName
protected abstract void editFileName(int index)
- Parameters:
index
- visual index of the file to be edited
-
applyEdit
protected void applyEdit()
-
getNewFolderAction
public Action getNewFolderAction()
-
doSelectFile
protected void doSelectFile(File fileToSelect)
-
doDeselectFile
protected void doDeselectFile(Object fileToDeselect)
-
doSelectedFileChanged
protected void doSelectedFileChanged(PropertyChangeEvent e)
-
doSelectedFilesChanged
protected void doSelectedFilesChanged(PropertyChangeEvent e)
-
doDirectoryChanged
protected void doDirectoryChanged(PropertyChangeEvent e)
-
doFilterChanged
protected void doFilterChanged(PropertyChangeEvent e)
-
doFileSelectionModeChanged
protected void doFileSelectionModeChanged(PropertyChangeEvent e)
-
doMultiSelectionChanged
protected void doMultiSelectionChanged(PropertyChangeEvent e)
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
ensureFileIsVisible
public void ensureFileIsVisible(JFileChooser fc, File f)
-
ensureIndexIsVisible
protected void ensureIndexIsVisible(int i)
-
getRowSorter
protected DarkFilePaneUIBridge.DetailsTableRowSorter getRowSorter()
-
rescanCurrentDirectory
public void rescanCurrentDirectory()
-
clearSelection
public void clearSelection()
-
getComponentPopupMenu
public abstract JPopupMenu getComponentPopupMenu()
- Overrides:
getComponentPopupMenu
in classJComponent
-
getFileChooser
protected JFileChooser getFileChooser()
-
getViewMenu
public abstract JMenu getViewMenu()
-
updateViewMenu
protected abstract void updateViewMenu()
-
getMouseHandler
protected abstract DarkFilePaneUIBridge.Handler getMouseHandler()
-
isDirectorySelected
protected boolean isDirectorySelected()
Property to remember whether a directory is currently selected in the UI.- Returns:
true
iff a directory is currently selected.
-
getDirectory
protected File getDirectory()
Property to remember the directory that is currently selected in the UI.- Returns:
- the value of the
directory
property
-
-