public class WebFileChooser extends JFileChooser implements Styleable, LanguageMethods, LanguageEventMethods, SettingsMethods, FontMethods<WebFileChooser>, SizeMethods<WebFileChooser>
JFileChooser
extension class.
It contains various useful methods to simplify core component usage.
This component should never be used with a non-Web UIs as it might cause an unexpected behavior.
You could still use that component even if WebLaF is not your application LaF as this component will use Web-UI in any case.JFileChooser
,
WebFileChooserUI
,
FileChooserPainter
,
Serialized FormJFileChooser.AccessibleJFileChooser
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
Modifier and Type | Field and Description |
---|---|
protected List<Image> |
customIcons
Custom icons for file chooser dialog.
|
ACCEPT_ALL_FILE_FILTER_USED_CHANGED_PROPERTY, accessibleContext, ACCESSORY_CHANGED_PROPERTY, APPROVE_BUTTON_MNEMONIC_CHANGED_PROPERTY, APPROVE_BUTTON_TEXT_CHANGED_PROPERTY, APPROVE_BUTTON_TOOL_TIP_TEXT_CHANGED_PROPERTY, APPROVE_OPTION, APPROVE_SELECTION, CANCEL_OPTION, CANCEL_SELECTION, CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY, CONTROL_BUTTONS_ARE_SHOWN_CHANGED_PROPERTY, CUSTOM_DIALOG, DIALOG_TITLE_CHANGED_PROPERTY, DIALOG_TYPE_CHANGED_PROPERTY, DIRECTORIES_ONLY, DIRECTORY_CHANGED_PROPERTY, ERROR_OPTION, FILE_FILTER_CHANGED_PROPERTY, FILE_HIDING_CHANGED_PROPERTY, FILE_SELECTION_MODE_CHANGED_PROPERTY, FILE_SYSTEM_VIEW_CHANGED_PROPERTY, FILE_VIEW_CHANGED_PROPERTY, FILES_AND_DIRECTORIES, FILES_ONLY, MULTI_SELECTION_ENABLED_CHANGED_PROPERTY, OPEN_DIALOG, SAVE_DIALOG, SELECTED_FILE_CHANGED_PROPERTY, SELECTED_FILES_CHANGED_PROPERTY
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
UNDEFINED
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WebFileChooser()
Constructs a WebFileChooser pointing to the user's default directory.
|
WebFileChooser(File dir)
Constructs a WebFileChooser using the given File as the path.
|
WebFileChooser(File dir,
FileSystemView fsv)
Constructs a WebFileChooser using the given current directory and FileSystemView.
|
WebFileChooser(FileSystemView fsv)
Constructs a WebFileChooser using the given FileSystemView.
|
WebFileChooser(String dirPath)
Constructs a WebFileChooser using the given path.
|
WebFileChooser(String dirPath,
FileSystemView fsv)
Constructs a WebFileChooser using the given current directory path and FileSystemView.
|
WebFileChooser(StyleId id)
Constructs a WebFileChooser pointing to the user's default directory.
|
WebFileChooser(StyleId id,
File dir)
Constructs a WebFileChooser using the given File as the path.
|
WebFileChooser(StyleId id,
File dir,
FileSystemView fsv)
Constructs a WebFileChooser using the given current directory and FileSystemView.
|
WebFileChooser(StyleId id,
FileSystemView fsv)
Constructs a WebFileChooser using the given FileSystemView.
|
WebFileChooser(StyleId id,
String dirPath)
Constructs a WebFileChooser using the given path.
|
WebFileChooser(StyleId id,
String dirPath,
FileSystemView fsv)
Constructs a WebFileChooser using the given current directory path and FileSystemView.
|
Modifier and Type | Method and Description |
---|---|
void |
addDictionaryListener(DictionaryListener listener)
Adds new
DictionaryListener tied to the JComponent implementing this interface. |
void |
addLanguageListener(LanguageListener listener)
Adds new
LanguageListener tied to the JComponent implementing this interface. |
void |
addStyleListener(StyleListener listener)
Adds
StyleListener . |
WebFileChooser |
changeFontSize(int change)
Changes font size of the specified component.
|
protected JDialog |
createDialog(Component parent) |
Painter |
getCustomPainter()
Returns custom
Painter used for implementing JComponent . |
StyleId |
getDefaultStyleId()
Returns default component
StyleId . |
Image |
getDialogIcon()
Returns custom dialog icon.
|
List<Image> |
getDialogIcons()
Returns custom dialog icons.
|
WebFileChooserPanel |
getFileChooserPanel()
Returns file chooser panel.
|
String |
getFontName()
Returns component font name.
|
int |
getFontSize()
Returns component font size.
|
String |
getLanguage()
Returns language key which was used to register specified component in
LanguageManager . |
Insets |
getMargin()
Returns current margin.
|
int |
getMaximumHeight()
Returns
JComponent maximum height set in SizeMethods.setMaximumHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getMaximumSize()
Returns
JComponent maximum size. |
int |
getMaximumWidth()
|
int |
getMinimumHeight()
Returns
JComponent minimum height set in SizeMethods.setMinimumHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getMinimumSize()
Returns
JComponent minimum size. |
int |
getMinimumWidth()
|
Dimension |
getOriginalMaximumSize()
Returns original
JComponent maximum size before any adjustments. |
Dimension |
getOriginalMinimumSize()
Returns original
JComponent minimum size before any adjustments. |
Dimension |
getOriginalPreferredSize()
Returns original
JComponent preferred size before any adjustments. |
Insets |
getPadding()
Returns current padding.
|
Shape |
getPainterShape()
|
int |
getPreferredHeight()
Returns
JComponent preferred height set in SizeMethods.setPreferredHeight(int) or SizeMethods.UNDEFINED . |
Dimension |
getPreferredSize()
Returns
JComponent preferred size. |
int |
getPreferredWidth()
Returns
JComponent preferred width set in SizeMethods.setPreferredWidth(int) or SizeMethods.UNDEFINED . |
Skin |
getSkin()
Returns skin currently applied to this component.
|
StyleId |
getStyleId()
Returns component
StyleId . |
WFileChooserUI |
getUI()
Returns the look and feel (LaF) object that renders this component.
|
String |
getUIClassID() |
boolean |
isBoldFont()
Returns whether component font is bold or not.
|
boolean |
isItalicFont()
Returns whether component font is italic or not.
|
boolean |
isLanguageSet()
Returns whether this component registered in
LanguageManager or not. |
boolean |
isPlainFont()
Returns whether component font is plain or not.
|
boolean |
isShapeDetectionEnabled()
Returns whether or not component's custom
Shape is used for better mouse events detection. |
void |
loadSettings()
Loads previously saved settings for the specified
JComponent if it is registered. |
void |
registerSettings(Configuration configuration)
Registers
JComponent for settings auto-save. |
void |
registerSettings(SettingsProcessor processor)
Registers
JComponent for settings auto-save. |
void |
removeDictionaryListener(DictionaryListener listener)
Removes
DictionaryListener tied to the JComponent implementing this interface. |
void |
removeDictionaryListeners()
Removes all
DictionaryListener s tied to the JComponent implementing this interface. |
void |
removeLanguage()
Unregisters component from
LanguageManager . |
void |
removeLanguageListener(LanguageListener listener)
Removes
LanguageListener tied to the JComponent implementing this interface. |
void |
removeLanguageListeners()
Removes all
LanguageListener s tied to the JComponent implementing this interface. |
void |
removeLanguageUpdater()
Unregisters custom component
LanguageUpdater . |
void |
removeStyleListener(StyleListener listener)
Removes
StyleListener . |
boolean |
resetCustomPainter()
Resets custom
Painter for implementing JComponent to default one. |
Skin |
resetSkin()
Resets skin for this component and all of its children linked via
StyleId . |
StyleId |
resetStyleId()
Resets
StyleId to default value. |
void |
saveSettings()
Saves settings for the specified
JComponent if it is registered. |
WebFileChooser |
setBoldFont()
Sets bold font for the component.
|
WebFileChooser |
setBoldFont(boolean apply)
Sets bold font for the component.
|
void |
setCurrentDirectory(String path)
Sets currently displayed directory.
|
Painter |
setCustomPainter(Painter painter)
Sets custom
Painter for implementing JComponent . |
void |
setDialogIcon(Icon icon)
Sets custom dialog icon.
|
void |
setDialogIcons(List<? extends Icon> customIcons)
Sets custom dialog icons.
|
void |
setDialogImage(Image icon)
Sets custom dialog icon.
|
void |
setDialogImages(List<? extends Image> customIcons)
Sets custom dialog icons.
|
void |
setDialogTitleKey(String dialogTitle)
Sets dialog title language key.
|
WebFileChooser |
setFontName(String fontName)
Sets component font name.
|
WebFileChooser |
setFontSize(int fontSize)
Sets component font size.
|
WebFileChooser |
setFontSizeAndStyle(int fontSize,
boolean bold,
boolean italic)
Sets font size and style for the specified component.
|
WebFileChooser |
setFontSizeAndStyle(int fontSize,
int style)
Sets font size and style for the specified component.
|
WebFileChooser |
setFontStyle(boolean bold,
boolean italic)
Sets component font style.
|
WebFileChooser |
setFontStyle(int style)
Sets component font style.
|
WebFileChooser |
setItalicFont()
Sets italic or plain font for the component.
|
WebFileChooser |
setItalicFont(boolean apply)
Sets italic or plain font for the component.
|
void |
setLanguage(String key,
Object... data)
Registers component in
LanguageManager under specified key and with specified formatting data. |
void |
setLanguageUpdater(LanguageUpdater updater)
Registers custom language updater for this component.
|
void |
setMargin(Insets margin)
Sets new margin.
|
void |
setMargin(int margin)
Sets new margin.
|
void |
setMargin(int top,
int left,
int bottom,
int right)
Sets new margin.
|
WebFileChooser |
setMaximumHeight(int maximumHeight)
Sets
JComponent maximum height. |
WebFileChooser |
setMaximumSize(int width,
int height)
Sets
JComponent maximum size. |
WebFileChooser |
setMaximumWidth(int maximumWidth)
Sets
JComponent maximum width. |
WebFileChooser |
setMinimumHeight(int minimumHeight)
Sets
JComponent minimum height. |
WebFileChooser |
setMinimumSize(int width,
int height)
Sets
JComponent minimum size. |
WebFileChooser |
setMinimumWidth(int minimumWidth)
Sets
JComponent minimum width. |
void |
setPadding(Insets padding)
Sets new padding.
|
void |
setPadding(int padding)
Sets new padding.
|
void |
setPadding(int top,
int left,
int bottom,
int right)
Sets new padding.
|
WebFileChooser |
setPlainFont()
Sets plain font for the component.
|
WebFileChooser |
setPlainFont(boolean apply)
Sets plain font for the component.
|
WebFileChooser |
setPreferredHeight(int preferredHeight)
Sets
JComponent preferred height. |
WebFileChooser |
setPreferredSize(int width,
int height)
Sets
JComponent preferred size. |
WebFileChooser |
setPreferredWidth(int preferredWidth)
Sets
JComponent preferred width. |
void |
setSelectedFile(String path)
Sets currently selected file.
|
void |
setShapeDetectionEnabled(boolean enabled)
Sets whether or not component's custom
Shape should be used for better mouse events detection. |
Skin |
setSkin(Skin skin)
Applies specified custom skin to the styleable component and all of its children linked via
StyleId . |
Skin |
setSkin(Skin skin,
boolean recursively)
Applies specified custom skin to the styleable component and all of its children linked via
StyleId . |
StyleId |
setStyleId(StyleId id)
Sets new component
StyleId . |
void |
setUI(WFileChooserUI ui)
Sets the LaF object that renders this component.
|
static List<File> |
showMultiOpenDialog()
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static List<File> |
showMultiOpenDialog(Component parent,
Customizer<WebFileChooser> customizer)
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static List<File> |
showMultiOpenDialog(Component parent,
String currentDirectory)
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static List<File> |
showMultiOpenDialog(Component parent,
String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static List<File> |
showMultiOpenDialog(Customizer<WebFileChooser> customizer)
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static List<File> |
showMultiOpenDialog(String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays multiple files open dialog and returns selected files list as a result.
|
static File |
showOpenDialog()
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showOpenDialog(Component parent,
Customizer<WebFileChooser> customizer)
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showOpenDialog(Component parent,
String currentDirectory)
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showOpenDialog(Component parent,
String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showOpenDialog(Customizer<WebFileChooser> customizer)
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showOpenDialog(String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays file open dialog and returns selected file as a result.
|
static File |
showSaveDialog()
Constructs and displays file save dialog and returns selected file as a result.
|
static File |
showSaveDialog(Component parent,
Customizer<WebFileChooser> customizer)
Constructs and displays file save dialog and returns selected file as a result.
|
static File |
showSaveDialog(Component parent,
String currentDirectory)
Constructs and displays file save dialog and returns selected file as a result.
|
static File |
showSaveDialog(Component parent,
String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays file save dialog and returns selected file as a result.
|
static File |
showSaveDialog(Customizer<WebFileChooser> customizer)
Constructs and displays file save dialog and returns selected file as a result.
|
static File |
showSaveDialog(String currentDirectory,
Customizer<WebFileChooser> customizer)
Constructs and displays file save dialog and returns selected file as a result.
|
void |
unregisterSettings()
Unregisters
JComponent from settings auto-save. |
void |
updateLanguage(Object... data)
Updates component language and formatting data.
|
void |
updateLanguage(String key,
Object... data)
Changes component language key and updates its language and formatting data.
|
void |
updateUI() |
protected void |
updateWindowIcons()
Updates icons on
JDialog . |
accept, addActionListener, addChoosableFileFilter, approveSelection, cancelSelection, changeToParentDirectory, ensureFileIsVisible, fireActionPerformed, getAcceptAllFileFilter, getAccessibleContext, getAccessory, getActionListeners, getApproveButtonMnemonic, getApproveButtonText, getApproveButtonToolTipText, getChoosableFileFilters, getControlButtonsAreShown, getCurrentDirectory, getDescription, getDialogTitle, getDialogType, getDragEnabled, getFileFilter, getFileSelectionMode, getFileSystemView, getFileView, getIcon, getName, getSelectedFile, getSelectedFiles, getTypeDescription, isAcceptAllFileFilterUsed, isDirectorySelectionEnabled, isFileHidingEnabled, isFileSelectionEnabled, isMultiSelectionEnabled, isTraversable, paramString, removeActionListener, removeChoosableFileFilter, rescanCurrentDirectory, resetChoosableFileFilters, setAcceptAllFileFilterUsed, setAccessory, setApproveButtonMnemonic, setApproveButtonMnemonic, setApproveButtonText, setApproveButtonToolTipText, setControlButtonsAreShown, setCurrentDirectory, setDialogTitle, setDialogType, setDragEnabled, setFileFilter, setFileHidingEnabled, setFileSelectionMode, setFileSystemView, setFileView, setMultiSelectionEnabled, setSelectedFile, setSelectedFiles, setup, showDialog, showOpenDialog, showSaveDialog
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, 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, 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
public WebFileChooser()
public WebFileChooser(String dirPath)
dirPath
- a String giving the path to a file or directorypublic WebFileChooser(File dir)
dir
- a File object specifying the path to a file or directorypublic WebFileChooser(FileSystemView fsv)
fsv
- file system viewpublic WebFileChooser(File dir, FileSystemView fsv)
dir
- a File object specifying the path to a file or directoryfsv
- file system viewpublic WebFileChooser(String dirPath, FileSystemView fsv)
dirPath
- a String giving the path to a file or directoryfsv
- file system viewpublic WebFileChooser(StyleId id)
id
- StyleId
public WebFileChooser(StyleId id, String dirPath)
id
- StyleId
dirPath
- a String giving the path to a file or directorypublic WebFileChooser(StyleId id, File dir)
id
- StyleId
dir
- a File object specifying the path to a file or directorypublic WebFileChooser(StyleId id, FileSystemView fsv)
id
- StyleId
fsv
- file system viewpublic WebFileChooser(StyleId id, File dir, FileSystemView fsv)
id
- StyleId
dir
- a File object specifying the path to a file or directoryfsv
- file system viewpublic WebFileChooser(StyleId id, String dirPath, FileSystemView fsv)
id
- StyleId
dirPath
- a String giving the path to a file or directoryfsv
- file system viewprotected JDialog createDialog(Component parent) throws HeadlessException
createDialog
in class JFileChooser
HeadlessException
@Nullable public Image getDialogIcon()
@Nullable public List<Image> getDialogIcons()
public void setDialogIcon(@Nullable Icon icon)
icon
- new custom dialog iconpublic void setDialogImage(@Nullable Image icon)
icon
- new custom dialog iconpublic void setDialogIcons(@NotNull List<? extends Icon> customIcons)
customIcons
- new custom dialog iconspublic void setDialogImages(@NotNull List<? extends Image> customIcons)
customIcons
- new custom dialog iconsprotected void updateWindowIcons()
JDialog
.public void setDialogTitleKey(String dialogTitle)
dialogTitle
- title language keypublic void setCurrentDirectory(String path)
path
- directory to displaypublic void setSelectedFile(String path)
path
- file to selectpublic WebFileChooserPanel getFileChooserPanel()
@NotNull public StyleId getDefaultStyleId()
Styleable
StyleId
.
This method is asked when initial component StyleId
have to be provided.getDefaultStyleId
in interface Styleable
StyleId
@NotNull public StyleId getStyleId()
Styleable
StyleId
.getStyleId
in interface Styleable
StyleId
@NotNull public StyleId setStyleId(@NotNull StyleId id)
Styleable
StyleId
.
If style for the specified ID cannot be found in skin then its default style will be used instead.setStyleId
in interface Styleable
id
- custom component StyleId
StyleId
@NotNull public StyleId resetStyleId()
Styleable
StyleId
to default value.resetStyleId
in interface Styleable
StyleId
@NotNull public Skin getSkin()
Styleable
@Nullable public Skin setSkin(@NotNull Skin skin)
Styleable
@Nullable public Skin setSkin(@NotNull Skin skin, boolean recursively)
Styleable
public void addStyleListener(@NotNull StyleListener listener)
Styleable
StyleListener
.addStyleListener
in interface Styleable
listener
- StyleListener
to addpublic void removeStyleListener(@NotNull StyleListener listener)
Styleable
StyleListener
.removeStyleListener
in interface Styleable
listener
- StyleListener
to remove@Nullable public Painter getCustomPainter()
Styleable
Painter
used for implementing JComponent
.getCustomPainter
in interface Styleable
Painter
used for implementing JComponent
@Nullable public Painter setCustomPainter(@NotNull Painter painter)
Styleable
Painter
for implementing JComponent
.setCustomPainter
in interface Styleable
painter
- custom Painter
Painter
previously used for implementing JComponent
public boolean resetCustomPainter()
Styleable
Painter
for implementing JComponent
to default one.resetCustomPainter
in interface Styleable
true
if custom Painter
was successfully resetted, false
otherwise@NotNull public Shape getPainterShape()
Styleable
Painter
Shape
.
This method is not named getShape ()
to avoid clashing with JDK7+ method in Window
ancestors.getPainterShape
in interface Styleable
Painter
Shape
public boolean isShapeDetectionEnabled()
Styleable
Shape
is used for better mouse events detection.
If it wasn't explicitly specified - WebLookAndFeel.isShapeDetectionEnabled()
is used as result.isShapeDetectionEnabled
in interface Styleable
true
if component's custom Shape
is used for better mouse events detection, false
otherwisepublic void setShapeDetectionEnabled(boolean enabled)
Styleable
Shape
should be used for better mouse events detection.
It can be enabled globally through WebLookAndFeel.setShapeDetectionEnabled(boolean)
.setShapeDetectionEnabled
in interface Styleable
enabled
- whether or not component's custom Shape
should be used for better mouse events detection@Nullable public Insets getMargin()
Styleable
null
which is basically the same as an empty [0,0,0,0] margin.public void setMargin(int margin)
Styleable
public void setMargin(int top, int left, int bottom, int right)
Styleable
public void setMargin(@Nullable Insets margin)
Styleable
null
can be provided to set an empty [0,0,0,0] margin.@Nullable public Insets getPadding()
Styleable
null
which is basically the same as an empty [0,0,0,0] padding.getPadding
in interface Styleable
public void setPadding(int padding)
Styleable
setPadding
in interface Styleable
padding
- new paddingpublic void setPadding(int top, int left, int bottom, int right)
Styleable
setPadding
in interface Styleable
top
- new top paddingleft
- new left paddingbottom
- new bottom paddingright
- new right paddingpublic void setPadding(@Nullable Insets padding)
Styleable
null
can be provided to set an empty [0,0,0,0] padding.setPadding
in interface Styleable
padding
- new padding@Nullable public String getLanguage()
LanguageMethods
LanguageManager
.getLanguage
in interface LanguageMethods
LanguageManager
public void setLanguage(@NotNull String key, @Nullable Object... data)
LanguageMethods
LanguageManager
under specified key and with specified formatting data.setLanguage
in interface LanguageMethods
key
- language record keydata
- formatting datapublic void updateLanguage(@Nullable Object... data)
LanguageMethods
updateLanguage
in interface LanguageMethods
data
- new formatting datapublic void updateLanguage(@NotNull String key, @Nullable Object... data)
LanguageMethods
updateLanguage
in interface LanguageMethods
key
- new language keydata
- new formatting datapublic void removeLanguage()
LanguageMethods
LanguageManager
.
This method will not change current component settings that came from latest applied translation.removeLanguage
in interface LanguageMethods
public boolean isLanguageSet()
LanguageMethods
LanguageManager
or not.isLanguageSet
in interface LanguageMethods
LanguageManager
, false otherwisepublic void setLanguageUpdater(@NotNull LanguageUpdater updater)
LanguageMethods
setLanguageUpdater
in interface LanguageMethods
updater
- LanguageUpdater
for the componentpublic void removeLanguageUpdater()
LanguageMethods
LanguageUpdater
.removeLanguageUpdater
in interface LanguageMethods
public void addLanguageListener(@NotNull LanguageListener listener)
LanguageEventMethods
LanguageListener
tied to the JComponent
implementing this interface.
Unlike LanguageManager.addLanguageListener(LanguageListener)
using this method will not store hard references
to the LanguageListener
outside of the JComponent
to avoid any mermory leaks. So if specified JComponent
will for instance be destroyed provided LanguageListener
will also be destroyed.addLanguageListener
in interface LanguageEventMethods
listener
- LanguageListener
to addpublic void removeLanguageListener(@NotNull LanguageListener listener)
LanguageEventMethods
LanguageListener
tied to the JComponent
implementing this interface.removeLanguageListener
in interface LanguageEventMethods
listener
- LanguageListener
to removepublic void removeLanguageListeners()
LanguageEventMethods
LanguageListener
s tied to the JComponent
implementing this interface.removeLanguageListeners
in interface LanguageEventMethods
public void addDictionaryListener(@NotNull DictionaryListener listener)
LanguageEventMethods
DictionaryListener
tied to the JComponent
implementing this interface.
Unlike LanguageManager.addDictionaryListener(DictionaryListener)
using this method will not store hard references
to the DictionaryListener
outside of the JComponent
to avoid any mermory leaks. So if specified JComponent
will for instance be destroyed provided DictionaryListener
will also be destroyed.addDictionaryListener
in interface LanguageEventMethods
listener
- DictionaryListener
to addpublic void removeDictionaryListener(@NotNull DictionaryListener listener)
LanguageEventMethods
DictionaryListener
tied to the JComponent
implementing this interface.removeDictionaryListener
in interface LanguageEventMethods
listener
- DictionaryListener
to removepublic void removeDictionaryListeners()
LanguageEventMethods
DictionaryListener
s tied to the JComponent
implementing this interface.removeDictionaryListeners
in interface LanguageEventMethods
public void registerSettings(Configuration configuration)
SettingsMethods
JComponent
for settings auto-save.
Registered JComponent
will be:
- tracked for settings changes (depends on SettingsProcessor
) to save them when requested
- automatically updated with any loaded settings for that key if requested
- automatically updated with any changes made in its settings if requestedregisterSettings
in interface SettingsMethods
configuration
- Configuration
public void registerSettings(SettingsProcessor processor)
SettingsMethods
JComponent
for settings auto-save.
Registered JComponent
will be:
- tracked for settings changes (depends on SettingsProcessor
) to save them when requested
- automatically updated with any loaded settings for that key if requested
- automatically updated with any changes made in its settings if requestedregisterSettings
in interface SettingsMethods
processor
- SettingsProcessor
public void unregisterSettings()
SettingsMethods
JComponent
from settings auto-save.unregisterSettings
in interface SettingsMethods
public void loadSettings()
SettingsMethods
JComponent
if it is registered.loadSettings
in interface SettingsMethods
public void saveSettings()
SettingsMethods
JComponent
if it is registered.saveSettings
in interface SettingsMethods
public WebFileChooser setPlainFont()
FontMethods
setPlainFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setPlainFont(boolean apply)
FontMethods
setPlainFont
in interface FontMethods<WebFileChooser>
apply
- whether to apply font changes or notpublic boolean isPlainFont()
FontMethods
isPlainFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setBoldFont()
FontMethods
setBoldFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setBoldFont(boolean apply)
FontMethods
setBoldFont
in interface FontMethods<WebFileChooser>
apply
- whether to apply font changes or notpublic boolean isBoldFont()
FontMethods
isBoldFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setItalicFont()
FontMethods
setItalicFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setItalicFont(boolean apply)
FontMethods
setItalicFont
in interface FontMethods<WebFileChooser>
apply
- whether to apply font changes or notpublic boolean isItalicFont()
FontMethods
isItalicFont
in interface FontMethods<WebFileChooser>
public WebFileChooser setFontStyle(boolean bold, boolean italic)
FontMethods
setFontStyle
in interface FontMethods<WebFileChooser>
bold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebFileChooser setFontStyle(int style)
FontMethods
setFontStyle
in interface FontMethods<WebFileChooser>
style
- new stylepublic WebFileChooser setFontSize(int fontSize)
FontMethods
setFontSize
in interface FontMethods<WebFileChooser>
fontSize
- font sizepublic WebFileChooser changeFontSize(int change)
FontMethods
changeFontSize
in interface FontMethods<WebFileChooser>
change
- font size change amountpublic int getFontSize()
FontMethods
getFontSize
in interface FontMethods<WebFileChooser>
public WebFileChooser setFontSizeAndStyle(int fontSize, boolean bold, boolean italic)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebFileChooser>
fontSize
- new font sizebold
- whether should set bold font or notitalic
- whether should set italic font or notpublic WebFileChooser setFontSizeAndStyle(int fontSize, int style)
FontMethods
setFontSizeAndStyle
in interface FontMethods<WebFileChooser>
fontSize
- new font sizestyle
- new stylepublic WebFileChooser setFontName(String fontName)
FontMethods
setFontName
in interface FontMethods<WebFileChooser>
fontName
- new font namepublic String getFontName()
FontMethods
getFontName
in interface FontMethods<WebFileChooser>
public int getPreferredWidth()
SizeMethods
JComponent
preferred width set in SizeMethods.setPreferredWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
preferred width use SizeMethods.getPreferredSize()
method instead.getPreferredWidth
in interface SizeMethods<WebFileChooser>
JComponent
preferred width set in SizeMethods.setPreferredWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setPreferredWidth(int preferredWidth)
SizeMethods
JComponent
preferred width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred width on its own.setPreferredWidth
in interface SizeMethods<WebFileChooser>
preferredWidth
- new JComponent
preferred widthJComponent
public int getPreferredHeight()
SizeMethods
JComponent
preferred height set in SizeMethods.setPreferredHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
preferred height use SizeMethods.getPreferredSize()
method instead.getPreferredHeight
in interface SizeMethods<WebFileChooser>
JComponent
preferred height set in SizeMethods.setPreferredHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setPreferredHeight(int preferredHeight)
SizeMethods
JComponent
preferred height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose preferred height on its own.setPreferredHeight
in interface SizeMethods<WebFileChooser>
preferredHeight
- new JComponent
preferred heightJComponent
@NotNull public Dimension getPreferredSize()
SizeMethods
JComponent
preferred size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalPreferredSize()
method to retrieve original JComponent
preferred size.getPreferredSize
in interface SizeMethods<WebFileChooser>
getPreferredSize
in class JComponent
JComponent
preferred size@NotNull public Dimension getOriginalPreferredSize()
SizeMethods
JComponent
preferred size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalPreferredSize
in interface SizeMethods<WebFileChooser>
JComponent
preferred size before any adjustments@NotNull public WebFileChooser setPreferredSize(int width, int height)
SizeMethods
JComponent
preferred size.
This method is a simple bridge for JComponent.setPreferredSize(Dimension)
method.setPreferredSize
in interface SizeMethods<WebFileChooser>
width
- JComponent
preferred widthheight
- JComponent
preferred heightJComponent
public int getMaximumWidth()
SizeMethods
JComponent
maximum width set in SizeMethods.setMaximumWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
maximum width use SizeMethods.getMaximumSize()
method instead.getMaximumWidth
in interface SizeMethods<WebFileChooser>
JComponent
maximum width set in SizeMethods.setMaximumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setMaximumWidth(int maximumWidth)
SizeMethods
JComponent
maximum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum width on its own.setMaximumWidth
in interface SizeMethods<WebFileChooser>
maximumWidth
- new JComponent
maximum widthJComponent
public int getMaximumHeight()
SizeMethods
JComponent
maximum height set in SizeMethods.setMaximumHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
maximum height use SizeMethods.getMaximumSize()
method instead.getMaximumHeight
in interface SizeMethods<WebFileChooser>
JComponent
maximum height set in SizeMethods.setMaximumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setMaximumHeight(int maximumHeight)
SizeMethods
JComponent
maximum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose maximum height on its own.setMaximumHeight
in interface SizeMethods<WebFileChooser>
maximumHeight
- new JComponent
maximum heightJComponent
@NotNull public Dimension getMaximumSize()
SizeMethods
JComponent
maximum size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalMaximumSize()
method to retrieve original JComponent
maximum size.getMaximumSize
in interface SizeMethods<WebFileChooser>
getMaximumSize
in class JComponent
JComponent
maximum size@NotNull public Dimension getOriginalMaximumSize()
SizeMethods
JComponent
maximum size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalMaximumSize
in interface SizeMethods<WebFileChooser>
JComponent
maximum size before any adjustments@NotNull public WebFileChooser setMaximumSize(int width, int height)
SizeMethods
JComponent
maximum size.
This method is a simple bridge for JComponent.setMaximumSize(Dimension)
method.setMaximumSize
in interface SizeMethods<WebFileChooser>
width
- JComponent
maximum widthheight
- JComponent
maximum heightJComponent
public int getMinimumWidth()
SizeMethods
JComponent
minimum width set in SizeMethods.setMinimumWidth(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
minimum width use SizeMethods.getMinimumSize()
method instead.getMinimumWidth
in interface SizeMethods<WebFileChooser>
JComponent
minimum width set in SizeMethods.setMinimumWidth(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setMinimumWidth(int minimumWidth)
SizeMethods
JComponent
minimum width.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum width on its own.setMinimumWidth
in interface SizeMethods<WebFileChooser>
minimumWidth
- new JComponent
minimum widthJComponent
public int getMinimumHeight()
SizeMethods
JComponent
minimum height set in SizeMethods.setMinimumHeight(int)
or SizeMethods.UNDEFINED
.
To retrieve actual JComponent
minimum height use SizeMethods.getMinimumSize()
method instead.getMinimumHeight
in interface SizeMethods<WebFileChooser>
JComponent
minimum height set in SizeMethods.setMinimumHeight(int)
or SizeMethods.UNDEFINED
@NotNull public WebFileChooser setMinimumHeight(int minimumHeight)
SizeMethods
JComponent
minimum height.
Pass SizeMethods.UNDEFINED
to let JComponent
choose minimum height on its own.setMinimumHeight
in interface SizeMethods<WebFileChooser>
minimumHeight
- new JComponent
minimum heightJComponent
@NotNull public Dimension getMinimumSize()
SizeMethods
JComponent
minimum size.
This size is already adjusted according to min/max width and height settings.
Use SizeMethods.getOriginalMinimumSize()
method to retrieve original JComponent
minimum size.getMinimumSize
in interface SizeMethods<WebFileChooser>
getMinimumSize
in class JComponent
JComponent
minimum size@NotNull public Dimension getOriginalMinimumSize()
SizeMethods
JComponent
minimum size before any adjustments.
This might be useful for various calculations involving JComponent
size.
In most cases this is the size provided by UI implementation of the JComponent
.getOriginalMinimumSize
in interface SizeMethods<WebFileChooser>
JComponent
minimum size before any adjustments@NotNull public WebFileChooser setMinimumSize(int width, int height)
SizeMethods
JComponent
minimum size.
This method is a simple bridge for JComponent.setMinimumSize(Dimension)
method.setMinimumSize
in interface SizeMethods<WebFileChooser>
width
- JComponent
minimum widthheight
- JComponent
minimum heightJComponent
public WFileChooserUI getUI()
getUI
in class JFileChooser
WFileChooserUI
object that renders this componentpublic void setUI(WFileChooserUI ui)
ui
- WFileChooserUI
public void updateUI()
updateUI
in class JFileChooser
public String getUIClassID()
getUIClassID
in class JFileChooser
public static File showOpenDialog()
public static File showOpenDialog(Customizer<WebFileChooser> customizer)
customizer
- file chooser customizerpublic static File showOpenDialog(Component parent, Customizer<WebFileChooser> customizer)
parent
- parent componentcustomizer
- file chooser customizerpublic static File showOpenDialog(String currentDirectory, Customizer<WebFileChooser> customizer)
currentDirectory
- current file chooser directorycustomizer
- file chooser customizerpublic static File showOpenDialog(Component parent, String currentDirectory)
parent
- parent componentcurrentDirectory
- current file chooser directorypublic static File showOpenDialog(Component parent, String currentDirectory, Customizer<WebFileChooser> customizer)
parent
- parent componentcurrentDirectory
- current file chooser directorycustomizer
- file chooser customizerpublic static List<File> showMultiOpenDialog()
public static List<File> showMultiOpenDialog(Customizer<WebFileChooser> customizer)
customizer
- file chooser customizerpublic static List<File> showMultiOpenDialog(Component parent, Customizer<WebFileChooser> customizer)
parent
- parent componentcustomizer
- file chooser customizerpublic static List<File> showMultiOpenDialog(String currentDirectory, Customizer<WebFileChooser> customizer)
currentDirectory
- current file chooser directorycustomizer
- file chooser customizerpublic static List<File> showMultiOpenDialog(Component parent, String currentDirectory)
parent
- parent componentcurrentDirectory
- current file chooser directorypublic static List<File> showMultiOpenDialog(Component parent, String currentDirectory, Customizer<WebFileChooser> customizer)
parent
- parent componentcurrentDirectory
- current file chooser directorycustomizer
- file chooser customizerpublic static File showSaveDialog()
public static File showSaveDialog(Customizer<WebFileChooser> customizer)
customizer
- file chooser customizerpublic static File showSaveDialog(Component parent, Customizer<WebFileChooser> customizer)
parent
- parent componentcustomizer
- file chooser customizerpublic static File showSaveDialog(String currentDirectory, Customizer<WebFileChooser> customizer)
currentDirectory
- current file chooser directorycustomizer
- file chooser customizerpublic static File showSaveDialog(Component parent, String currentDirectory)
parent
- parent componentcurrentDirectory
- current file chooser directorypublic static File showSaveDialog(Component parent, String currentDirectory, Customizer<WebFileChooser> customizer)
parent
- parent componentcurrentDirectory
- current file chooser directorycustomizer
- file chooser customizerCopyright © 2020. All rights reserved.