public class FileChooser extends FileChooserBase
FileChooser fc = new FileChooser(FileChooser.SAVE,null); fc.title = "Save Your Data Please..."; if (fc.execute() == fc.IDCANCEL) return null; File toSaveTo = fc.getChosenFile(); return toSaveTo;You can also allow MULTI_SELECT with the OPEN type to allow multiple file selection. In this case, you should use the chosenFiles Vector variable along with the chosenDirectory variable after execute() returns to determine the files chosen.
Form.FormMaker, Form.ToolsOrSoftKey, Form.ValidateBeforeExit
Modifier and Type | Field and Description |
---|---|
File |
afile
This is a copy of the File model being used by the FileChooser.
|
protected static String |
baseDir |
String |
defaultExtension
If no extension is given then this will be appended on to the selected file.
|
boolean |
detailMode
Do not set this directly.
|
MenuItem |
drives |
CellPanel |
extraPanel
Put any extra controls in this panel.
|
String |
file
Do NOT use this to variable.
|
FileListTableModel |
files
This is the FileListTableModel used by the table.
|
String |
fileType
Do NOT use this variable.
|
MenuItem |
goBackMenu |
MenuItem |
goForwardMenu |
boolean |
iconMode
Do not set this directly.
|
Vector |
links
These are links for the FileChooser - each of which must be of type FileChooserLink.
|
boolean |
listMode
Do not set this directly.
|
static boolean |
listModeDefault
Set this true to initially show the FileChooser in list mode.
|
String |
mask
Do not use this.
|
protected Hashtable |
maskNameToFilter |
boolean |
noKeyboard
Do not set this directly.
|
boolean |
noMouse
Do not set this directly.
|
String |
persistentHistoryKey
Set this to an application specific name (e.g.
|
boolean |
showWait
This indicates that the wait cursor should be shown when listing is being done.
|
boolean |
slowAccess
This indicates that access to the file system will be slow.
|
TableControl |
table
This is the table (list) of files/directory being displayed.
|
Time |
time
This is used internally.
|
MenuItem |
toolField |
TreeControl |
tree
This is the tree of directory being displayed.
|
boolean |
usePersistentHistoryAsStartLocation
If this is true and persistentHistoryKey is not null, then the most recently opened directory
will be used as the start location.
|
ACCEPT_ANY, allFilesMask, allowFileViewing, alwaysUsePopupInputs, BROWSE, chosenDirectory, chosenFiles, computer, DESKTOP_VERSION, desktopWide, DIRECTORY_SELECT, DIRECTORY_TREE, dirNavigation, DONT_SHOW_FILE_EXTENSION, drive, EMBEDDED, EXPLORER_TYPE, EXTRA_CONTROL, FILE_MUST_EXIST, folderUp, globalLinks, handHeld, history, historyDirectoriesOnly, historySize, INSTALL_SELECT, lastOptions, LAUNCHER_TYPE, MULTI_SELECT, NO_CONFIRM_OVERWRITE, NO_DIRECTORY_CHANGE, NO_DIRECTORY_TREE, NO_EXECUTE, NO_WRITING, OPEN, palm, QUICK_SELECT, READ_ONLY, SAVE, SECTION_BAR, SHOW_DIRECTORIES_WITH_TREE, SHOW_FILES_IN_DIRECTORY_SELECT, wideScreen
autoRefreshControls, coroutineStackSize, currentEvent, DoDataTransfer, dontAddSoftkeysAsActions, fieldListeners, fieldsWillNotBeAdded, myObject, objectClass, sampleObject, transferOnAdding, transfers
acceptsDroppedFiles, apply, buttons, BUTTONS_TO_SOFT_KEY_FIRST_BUTTON_SEPARATE, BUTTONS_TO_SOFT_KEY_MENU_ALWAYS, BUTTONS_TO_SOFT_KEY_USE_FIRST_SOFT_KEY, buttonsPanel, buttonsPerRow, cancel, CLOSING_FLAG, deflt, dismantleOnClose, dontAddSIPFiller, exitButtonDefined, EXITING_FLAG, exitSystemOnClose, exitValue, firstFocus, formFrame, frameAlpha, handle, hasTitle, hasTopBar, hideSoftKeyBarIfNotFound, inheritSoftKeys, isAutoScrolling, isMainAppletForm, keepFrame, minimumShowTime, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, shadowed, SHOWN_FLAG, shownTime, softkeyBars, title, titleCancel, titleControls, titleOK, topControls, WINDOW_TITLE_DONT_CHANGE, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
BACKB, CANCELB, checkIcon, close, cross, crossIcon, DEFCANCELB, DEFOKB, EXIT_IDBACK, EXIT_IDCANCEL, EXIT_IDNO, EXIT_IDOK, EXIT_IDYES, IDBACK, IDCANCEL, IDNO, IDOK, IDYES, MBB, MBNONE, MBOK, MBOKCANCEL, MBYESNO, MBYESNOCANCEL, NOB, OKB, stop, tick, tools, YESB
autoSpan, layout, mySplitter, nextSplitter, quickRecalculate
all, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, equalHeights, equalWidths, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
isFullScrollClient, origin, scrollPercent, virtualSize
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren, FIND_FOR_MOUSE_PRESS, takeNextFocus
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Modifier | Constructor and Description |
---|---|
|
FileChooser()
Create a FileChooser in OPEN mode.
|
|
FileChooser(FileChooserParameters fcp) |
|
FileChooser(FileChooserParameters fcp,
boolean extraControl) |
protected |
FileChooser(int type,
FileChooserParameters pars) |
|
FileChooser(int type,
String initial)
Create a FileChooser with a certain type, in the specified initial directory.
|
|
FileChooser(int type,
String initial,
File aFileModel)
Create a new FileChooser().
|
Modifier and Type | Method and Description |
---|---|
void |
action(FieldTransfer ft,
Editor f)
This implements the action() method in FieldListener.
|
void |
addLink(FileChooserLink link) |
void |
addMask(String mask)
Use this to add a file mask to the chooser's mask list.
|
void |
addMask(String maskName,
FilenameFilter filter) |
static boolean |
addToSavedHistory(String historyKey,
File fileOrDirectory)
Add a file or directory to the saved history.
|
static String |
askClassName(String pathToClass,
StringBuffer programDir,
Frame parent) |
static void |
associateIcon(String extension,
IImage icon)
This associates an icon with the specified file extension.
|
boolean |
canExit(int value)
This is called by the exit() method to see if the form can be
closed.
|
boolean |
checkLength(File f,
int warningLength) |
void |
checkMenu(String menuLabel,
Editor f) |
void |
clearHistory() |
void |
clearMasks()
Clear current masks.
|
void |
close(int value)
This closes the form unconditionally and sets the exitValue to be exitCode.
|
boolean |
continueAfterError(File f,
Throwable t,
int errorType,
boolean hasMore) |
void |
deletePressed(int how) |
void |
dirUp() |
protected boolean |
doHotKey(Control from,
KeyEvent ev)
This method checks to see if a KeyEvent should be considered the Control's hot-key.
|
void |
doNewShortcut(Editor f) |
static boolean |
doPaste(File targetDirectory,
FileChooser targetChooser) |
static void |
eveMain(String[] args) |
boolean |
exit(int value)
This will call the canExit() method and if it returns true, it will
close the form.
|
void |
fieldChanged(FieldTransfer ft,
Editor f)
This implements the fieldChanged() method in FieldListener.
|
void |
fieldEvent(FieldTransfer ft,
Editor f,
Object ev)
This implements fieldEvent() in FieldListener.
|
String |
fixMask(String mask)
Do not use this.
|
String[] |
getAllChosen()
Get all the chosen file names - even if only a single file was selected.
|
File[] |
getAllChosenFiles()
Get all chosen files, even if only one file was selected.
|
String |
getChosen()
Use this to get the selected file - do NOT use the "file" variable.
|
File |
getChosenDirectory()
Get the directory the chosen file(s) is in.
|
File |
getChosenFile()
Use this to get the selected file - do NOT use the "file" variable.
|
FileClipboard |
getFileClipboard(boolean forSetting) |
protected FilenameFilter |
getFilterFor(String name) |
static IImage |
getIconForFile(String fileName)
Get the associated icon for a file name.
|
Vector |
getMaskList()
This returns the list of masks currently set for the file chooser.
|
protected File |
getNewFileName(File parent,
String base,
String ext) |
static IImage |
getPageIcon() |
protected CellPanel |
getViewToolBar(String iconsAndFieldsAndTips) |
String |
inputNewFileName(String title,
File parent,
String oldName,
String newName,
boolean isFolder) |
static String |
lengthToDisplay(long len) |
static void |
main(String[] args) |
void |
masksChanged()
Use this if you have updated the Vector returned by getMaskList().
|
boolean |
newFileInfo(boolean isAction) |
protected void |
newFileSelected(File f)
This gets called when a new file has been clicked or entered.
|
String |
newNameFor(File parent,
String base,
String ext) |
void |
refresh()
Refresh the file list.
|
protected void |
renameSelected(int sel,
Editor f) |
static void |
retrieveApplicationHistory(String persistentHistoryKey)
Setup the static history list for FileChoosers in this application using the specified
persistentHistoryKey.
|
void |
runFile(File file) |
boolean |
setFile(File file)
Do not use this.
|
boolean |
setFile(File file,
boolean expandTree)
Do not use this.
|
void |
setHistory(Vector v)
This does not affect the "history" variable.
|
void |
setOptions(FileChooserOptions options) |
FileChooser |
setTitle(String title) |
static void |
setupHistory(String key) |
protected void |
showError(String message,
boolean execute) |
protected void |
showError(String title,
String message,
boolean execute) |
void |
shown()
This is called when a Control is shown in a Window.
|
static void |
storeApplicationHistory(String persistentHistoryKey,
Vector history)
Store the specified list of Strings as the application history.
|
void |
switchMultiSelect(boolean on) |
void |
treeDirUp() |
void |
usePersistentHistory(String keyName,
boolean useMostRecentAsStart) |
action, addButtonAsAction, addExternalField, addExternalField, addField, addField, addField, addField, addMenuAsAction, addMenuItemAsAction, addSoftKeysAsActions, badField, changeField, convertData, dataChanged, dataChanged, dataObjectIsCompatible, dismantle, enableScrolling, fieldChanged, findControlFor, findControlFor, findFields, findFieldTransfer, findFieldTransfer, findFieldTransfer, fireAction, fireFieldChanged, fireFieldEvent, fireFieldEvent, focusOn, formClosing, fromControls, fromControls, fromControls, fromControls, getData, getDataControls, getDataParentObject, getEditedObject, getEditedUnder, getEditorAndFieldValue, getFieldValue, getFieldValue, getProperty, getProperty, handleException, handleTransferError, invokeFieldHandlerMethod, make, modifyControl, modifyFields, modifyPropertiesOrFields, onControlEvent, onDataChangeEvent, onSoftKey, pauseCurrentEventThread, pauseThisEventThread, postEditorEvent, postEditorEvent, removeField, resumeCurrentEventThread, resumeThisEventThread, setData, setDataControls, setEditedObject, setFields, setFields, setObject, setProperty, takeFieldFrom, toControls, toControls, toControls, toControls, transfer, transfer
_getSetField, addButton, addFieldHandler, addFormMaker, addSIPAdjustment, addTabbedPanel, addToolbar, addTools, addToolsFor, addValidateBeforeExit, addValidateBeforeExit, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, checkButtons, checkCanExit, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createSipFiller, createWindow, defaultTitleTo, doButtons, doShowExec, enableScrolling, exec, exec, exec, exec, exec, execute, execute, execute, filesDropped, fixWindowTitle, formMain, fromFields, fromFields, fullScreenOnPDA, gatherButtons, getAncestorProperty, getButton, getFileSaver, getFormFrame, getFormWithProperty, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSmall, makeSmallOnBigScreen, makeSoftKeys, makeSoftKeys, makeSoftKeys, maximizeOnPDA, menuItemSelected, modifyForSmartPhone, onEvent, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setAsMainAppletForm, setAsShown, setBelowButtonBar, setBelowButtonBars, setDefaultSize, setExitHandle, setFileSaver, setMainScrollBarPanel, setNoTitleBar, setSoftKeyBarFor, setSoftKeyBarForAll, setupFrame, show, show, showButtons, showExecCalled, showWait, showWait, startRunning, stopFormHandle, takeButtons, takeButtons, takeButtons, toFields, toFields, toolsOnBottom, validateBeforeExit, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilShown, willBeMaximized
getCross, getParentObject, getParentObject, getSizedImage, getTick, getToolsIcon, setParentObject
calculateSizes, getFloatingControls, getSubControls, hasFloatingControls, makeLayoutGrid, relayoutMe, removeAll, reShow, resize, resizeTo
add, addChildListener, addDirectly, addLast, addLast, addLast, addNext, addNext, addNext, addNext, calculatedSizes, doBorder, endRow, getControlTag, getPreferredSize, insertRow, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setAsBelowSip, setText
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMyHeight, getMySize, getMyWidth, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
add, completeAddPopupControl, containerHasFocus, dismantle, doPaint, findChild, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getFirstFocus, getNextKeyFocus, gotFocus, grayOut, hide, lostFocus, relayout, removePopupControl, repaintDataNow, setHidden, startAddPopupControl, takeFocus, takePromptControl, unhide
acceptsData, activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getFontMetricsForSizeCalculations, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onKeyEvent, onLabelPenEvent, onPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, refresh, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setTextSize, setTiledBackgroundImage, setToolTip, showHoldDownIndicator, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testInWindowThread, ticked, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateData, updateDCDuringDD, updateFrom, updateTo, verifyWantDrag, verifyWantHoldDown, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
public String file
public String fileType
public String defaultExtension
public TableControl table
public TreeControl tree
public FileListTableModel files
public Time time
public String persistentHistoryKey
public boolean usePersistentHistoryAsStartLocation
public CellPanel extraPanel
public Vector links
protected static String baseDir
public File afile
public boolean slowAccess
public boolean showWait
public static boolean listModeDefault
public boolean iconMode
public boolean listMode
public boolean detailMode
public boolean noKeyboard
public boolean noMouse
public MenuItem goBackMenu
public MenuItem goForwardMenu
protected Hashtable maskNameToFilter
public String mask
public MenuItem drives
public MenuItem toolField
public FileChooser()
public FileChooser(int type, String initial)
public FileChooser(FileChooserParameters fcp)
public FileChooser(FileChooserParameters fcp, boolean extraControl)
public FileChooser(int type, String initial, File aFileModel)
You can also change the title of the FileChooser by setting "title" after construction.
type
- either OPEN, SAVE, DIRECTORY_SELECT or BROWSE OR'ed with some of the other options.initial
- The initial directory.aFileModel
- The file mode to use.protected FileChooser(int type, FileChooserParameters pars)
public String getChosen()
public String[] getAllChosen()
public File getChosenDirectory()
public File[] getAllChosenFiles()
public File getChosenFile()
public void usePersistentHistory(String keyName, boolean useMostRecentAsStart)
public void addLink(FileChooserLink link)
public static void associateIcon(String extension, IImage icon)
extension
- The extension WITHOUT the leading '.'icon
- The icon to be displayed. Should be a 16x16 icon.public static IImage getPageIcon()
public static IImage getIconForFile(String fileName)
fileName
- The file.public FileClipboard getFileClipboard(boolean forSetting)
public FileChooser setTitle(String title)
public static void setupHistory(String key)
public void clearHistory()
protected void showError(String message, boolean execute)
protected boolean doHotKey(Control from, KeyEvent ev)
Control
public void refresh()
public static String lengthToDisplay(long len)
public void setHistory(Vector v)
public void setOptions(FileChooserOptions options)
public void addMask(String mask)
For example: "*.jpg,*.png - Image files."
mask
- The mask to add.protected FilenameFilter getFilterFor(String name)
public void addMask(String maskName, FilenameFilter filter)
public void clearMasks()
public Vector getMaskList()
public void masksChanged()
public void shown()
Control
public static void retrieveApplicationHistory(String persistentHistoryKey) throws IOException
persistentHistoryKey
- a unique key name for your application.ewe.io.IOException
- if there was an error.IOException
public static void storeApplicationHistory(String persistentHistoryKey, Vector history) throws IOException
persistentHistoryKey
- a unique key name for your application.history
- a Vector of Strings.ewe.io.IOException
IOException
public boolean setFile(File file)
public boolean setFile(File file, boolean expandTree)
public boolean checkLength(File f, int warningLength)
public boolean continueAfterError(File f, Throwable t, int errorType, boolean hasMore)
public static boolean doPaste(File targetDirectory, FileChooser targetChooser)
public static String askClassName(String pathToClass, StringBuffer programDir, Frame parent)
public void doNewShortcut(Editor f)
public void runFile(File file)
public void deletePressed(int how)
protected File getNewFileName(File parent, String base, String ext) throws IOException
IOException
protected void renameSelected(int sel, Editor f)
public void fieldChanged(FieldTransfer ft, Editor f)
Editor
fieldChanged
in interface FieldListener
fieldChanged
in class Editor
protected void newFileSelected(File f)
public boolean newFileInfo(boolean isAction)
public boolean exit(int value)
Form
public void close(int value)
Form
public static boolean addToSavedHistory(String historyKey, File fileOrDirectory)
historyKey
- the name of the history key.fileOrDirectory
- a file or directory.public boolean canExit(int value)
Form
public void treeDirUp()
public void dirUp()
public void action(FieldTransfer ft, Editor f)
Editor
action
in interface FieldListener
action
in class Editor
public String inputNewFileName(String title, File parent, String oldName, String newName, boolean isFolder)
public void switchMultiSelect(boolean on)
public void fieldEvent(FieldTransfer ft, Editor f, Object ev)
Editor
fieldEvent
in interface FieldListener
fieldEvent
in class Editor
public static void eveMain(String[] args)
public static void main(String[] args)