Package net.raumzeitfalle.fx.filechooser
Class SwingFileChooser
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javafx.embed.swing.JFXPanel
net.raumzeitfalle.fx.filechooser.SwingFileChooser
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable
public class SwingFileChooser
extends javafx.embed.swing.JFXPanel
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intReturn value if approve (yes, ok) is chosen.static final intReturn value if cancel is chosen.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_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLocations(List<Location> locations) voidstatic SwingFileChooserCreates a newFileChooserwithin a SwingJDialogwindow.static SwingFileChoosercreate(Skin skin, String title, String pathToBrowse, PathFilter... filter) Creates a newFileChooserwithin a SwingJDialogwindow.static SwingFileChoosercreate(Skin skin, String title, PathFilter... filter) Creates a newFileChooserwithin a SwingJDialogwindow.static SwingFileChoosercreate(Skin skin, PathFilter... filter) Creates a newFileChooserwithin a SwingJDialogwindow.protected voidstatic voidsetUseJavaFxDirectoryChooser(boolean toggle) intshowOpenDialog(Component parent) Methods inherited from class javafx.embed.swing.JFXPanel
addNotify, getInputMethodRequests, getPreferredSize, getScene, isOpaque, paintComponent, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeNotify, setOpaque, setSceneMethods inherited from class javax.swing.JComponent
addAncestorListener, 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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIMethods 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, validateTreeMethods 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, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, 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, 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 Details
-
CANCEL_OPTION
public static final int CANCEL_OPTIONReturn value if cancel is chosen.- See Also:
-
APPROVE_OPTION
public static final int APPROVE_OPTIONReturn value if approve (yes, ok) is chosen.- See Also:
-
-
Method Details
-
setUseJavaFxDirectoryChooser
public static void setUseJavaFxDirectoryChooser(boolean toggle) -
create
Creates a newFileChooserwithin a SwingJDialogwindow. File browsing will start in current working directory.- Parameters:
skin-SkinDefines the visual appearance of FileChooser. Defaults to dark skin.filter-PathFilterargument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.- Returns:
- A configured
SwingFileChooser.
-
create
Creates a newFileChooserwithin a SwingJDialogwindow. File browsing will start in current working directory.- Parameters:
skin-SkinDefines the visual appearance of FileChooser. Defaults to dark skin.title-Stringtitle of theFileChooserview. In case of having the JavaFX basedDirectoryChooserconfigured, the window titles for the directory and file choosers will be identical.filter-PathFilterargument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.- Returns:
- A configured
SwingFileChooser.
-
create
public static SwingFileChooser create(Skin skin, String title, String pathToBrowse, PathFilter... filter) Creates a newFileChooserwithin a SwingJDialogwindow.- Parameters:
skin-SkinDefines the visual appearance of FileChooser. Defaults to dark skin.title-Stringtitle of theFileChooserview. In case of having the JavaFX basedDirectoryChooserconfigured, the window titles for the directory and file choosers will be identical.pathToBrowse-PathLocation to start file browsing in. If the argument is null or the denoted location does not exist, the control will default to current working directory.filter-PathFilterargument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.- Returns:
- A configured
SwingFileChooser.
-
create
public static SwingFileChooser create(Skin skin, String title, String dirChooserTitle, String pathToBrowse, PathFilter... filter) Creates a newFileChooserwithin a SwingJDialogwindow.- Parameters:
skin-SkinDefines the visual appearance of FileChooser. Defaults to dark skin.title-Stringtitle of theFileChooserviewdirChooserTitle-Stringtitle of theDirectoryChooserview when enabled. By default, the same title is used as for theFileChooserview.pathToBrowse-PathLocation to start file browsing in. If the argument is null or the denoted location does not exist, the control will default to current working directory.filter-PathFilterargument of variable length, accepts all path filters as needed. In case no filter is provided, a filter accepting all files will be used.- Returns:
- A configured
SwingFileChooser.
-
showOpenDialog
-
getSelectedFile
-
closeView
public void closeView() -
addLocations
-
setTitle
-