Class FileDialog
java.lang.Object
vaadinx.awt.Component
vaadinx.awt.Container
vaadinx.awt.Window
vaadinx.awt.Dialog
vaadinx.awt.FileDialog
- All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Emulator for
FileDialog. Thin shell over the modal
Dialog machinery; LOAD bridges the java.io.File
semantic gap via a browser Upload staged to a per-session temp file.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Dialog
Dialog.ModalityType -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThis FileDialog is for reading a file (browser upload).static final intThis FileDialog is for writing a file (browser download).Fields inherited from class Dialog
DEFAULT_MODALITY_TYPEFields inherited from class Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, FILL_CHROME, FILL_DEFAULT, LEFT_ALIGNMENT, listenerList, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
ConstructorsConstructorDescriptionFileDialog(Dialog parent) FileDialog(Dialog parent, String title) FileDialog(Dialog parent, String title, int mode) FileDialog(Frame parent) FileDialog(Frame parent, String title) FileDialog(Frame parent, String title, int mode) -
Method Summary
Modifier and TypeMethodDescriptiongetFile()File[]getFiles()intgetMode()booleanvoidsetDirectory(String dir) The picker is the browser's and starts wherever the browser decides, so the directory is a hint nothing reads — it is the peer push that drops (R_decline_effect_only).voidvoidsetFilenameFilter(FilenameFilter filter) voidsetMode(int mode) voidsetMultipleMode(boolean multipleMode) voidsetVisible(boolean b) Populate the modal dialog with mode-appropriate content (LOAD: a browserUpload+ OK/Cancel; SAVE: a filenameTextField+ Save/Cancel), then delegate toDialog.setVisible(boolean)— which, since FileDialog is always modal, parks the calling virtual thread until a button handler or a peer-originated close disposes the dialog.Methods inherited from class Dialog
blocksAfterVisibilityChange, dispose, getAccessibleContext, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, paramString, processWindowEvent, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, showMethods inherited from class Window
addNotify, addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, applyVisibleToPeer, applyVisibleToPeerImpl, createBufferStrategy, createBufferStrategy, disposePeer, fireWindowEvent, fireWindowFocusEvent, fireWindowStateEvent, getBackground, getBounds, getBounds, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getHeight, getIconImages, getInputContext, getLayout, getLocale, getLocation, getLocation, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getSize, getSize, getToolkit, getWarningString, getWidth, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, getX, getY, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLayout, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setSize, setSize, toBack, toFrontMethods inherited from class Container
add, add, add, add, add, addContainerListener, addImpl, addSlotChild, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, fireHierarchyEvent, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, peerContentElement, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeSlotChild, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusDownCycle, update, validate, validateTreeMethods inherited from class Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, applyBackgroundToPeer, awtListeners, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, defaultFillCssClass, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, fireComponentEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isThemeDefault, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, suppressMouseBridge, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, withPeer, withPeerOnLiveUI
-
Field Details
-
LOAD
public static final int LOADThis FileDialog is for reading a file (browser upload).- See Also:
-
SAVE
public static final int SAVEThis FileDialog is for writing a file (browser download).- See Also:
-
-
Constructor Details
-
FileDialog
-
FileDialog
-
FileDialog
-
FileDialog
-
FileDialog
-
FileDialog
-
-
Method Details
-
getMode
public int getMode() -
setMode
public void setMode(int mode) -
getFile
-
setFile
-
getFiles
-
getDirectory
-
setDirectory
The picker is the browser's and starts wherever the browser decides, so the directory is a hint nothing reads — it is the peer push that drops (R_decline_effect_only). It also holds only until the next show: the field is the onegetDirectory()answers, and a completed LOAD overwrites it with the per-show temp dir, which is AWT's shape too — there the peer writes back the directory the user actually browsed to.- Parameters:
dir-""is stored asnull, as AWT's own body normalises it
-
isMultipleMode
public boolean isMultipleMode() -
setMultipleMode
public void setMultipleMode(boolean multipleMode) -
getFilenameFilter
-
setFilenameFilter
-
setVisible
public void setVisible(boolean b) Populate the modal dialog with mode-appropriate content (LOAD: a browserUpload+ OK/Cancel; SAVE: a filenameTextField+ Save/Cancel), then delegate toDialog.setVisible(boolean)— which, since FileDialog is always modal, parks the calling virtual thread until a button handler or a peer-originated close disposes the dialog. After the park unwinds,finalizeResult()promotes the outcome to the result fields (and, for SAVE, opens the synthetic download dialog). Requires a virtual-thread (EHelper.callSwing) context per the inherited modal-park contract.The blocking applies to the name pick only, not to writing: SAVE returns as soon as the user clicks Save, so the app can write the file (synchronously or on a background thread) with no park in the way — the user pulls the bytes from the separate, non-modal download dialog whenever the write is done. See the class header for why a "block until written" SAVE would deadlock.
- Overrides:
setVisiblein classDialog
-