ewe.filechooser
Class FileChooser

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.Canvas
                  extended byewe.ui.Panel
                      extended byewe.ui.CellPanel
                          extended byewe.ui.FormBase
                              extended byewe.ui.Form
                                  extended byewe.ui.Editor
                                      extended byewe.filechooser.FileChooserBase
                                          extended byewe.filechooser.FileChooser
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, FieldListener, HasProperties, ImageRefresher, IScroll, LayoutManager, ScrollClient, TimerProc, UIConstants
Direct Known Subclasses:
ImageFileChooser

public class FileChooser
extends FileChooserBase

The FileChooser class is used to choose files or a directory on a file system. It provides the * following features: *

* The simplest way to use a FileChooser is to construct it with the desired type and directory, and then * call one of the execute() methods. If execute() returns IDCANCEL, then the user canceled the operation. If * the user did not cancel, then you can use getChosen() or getChosenFile() to get the file chosen. *
* 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. *


Field Summary
 File afile
          This is a copy of the File model being used by the FileChooser.
 String defaultExtension
          If no extension is given then this will be appended on to the selected file.
 boolean detailMode
          Do not set this directly.
protected  CellPanel dirNavigation
           
 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.
 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.
 
Fields inherited from class ewe.filechooser.FileChooserBase
ACCEPT_ANY, allFilesMask, allowFileViewing, BROWSE, chosenDirectory, chosenFiles, computer, DESKTOP_VERSION, desktopWide, DIRECTORY_SELECT, DIRECTORY_TREE, 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_EXECUTE, NO_WRITING, OPEN, palm, QUICK_SELECT, READ_ONLY, SAVE, toolButtons, wideScreen
 
Fields inherited from class ewe.ui.Editor
coroutineStackSize, currentEvent, DoDataTransfer, fieldListeners, fieldsWillNotBeAdded, myObject, objectClass, sampleObject, transfers
 
Fields inherited from class ewe.ui.Form
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, deflt, dismantleOnClose, exitButtonDefined, exitSystemOnClose, exitValue, firstFocus, formFrame, globalIcon, handle, hasTopBar, keepFrame, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, taskbarIcon, title, titleCancel, titleControls, titleOK, topControls, untitledTitle, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
 
Fields inherited from class ewe.ui.FormBase
BACKB, CANCELB, close, cross, defaultShowOptions, 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
 
Fields inherited from class ewe.ui.CellPanel
autoSpan, equalHeights, equalWidths, layout, mySplitter, nextSplitter, quickRecalculate
 
Fields inherited from class ewe.ui.Panel
all, backgroundImage, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
 
Fields inherited from class ewe.ui.Canvas
isFullScrollClient, origin, scrollPercent, virtualSize
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, 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
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
FileChooser()
          Create a FileChooser in OPEN mode.
FileChooser(FileChooserParameters fcp)
           
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().
 
Method Summary
 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.
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 close(int value)
          This closes the form unconditionally and sets the exitValue to be exitCode.
 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)
           
 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.
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  CellPanel getViewToolBar(String iconsAndFieldsAndTips)
           
static String lengthToDisplay(int 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.
 void refresh()
          Refresh the file list.
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)
           
protected  void showError(String message, boolean execute)
           
protected  void showError(String title, String message, boolean execute)
           
 void shown()
           
static void storeApplicationHistory(String persistentHistoryKey, Vector history)
          Store the specified list of Strings as the application history.
 void switchMultiSelect(boolean on)
           
 
Methods inherited from class ewe.ui.Editor
action, addExternalField, addExternalField, addField, addField, addField, dataChanged, dataChanged, dismantle, enableScrolling, fieldChanged, findControlFor, findFields, findFieldTransfer, findFieldTransfer, findFieldTransfer, fireFieldChanged, fireFieldEvent, fireFieldEvent, formClosing, fromControls, fromControls, fromControls, fromControls, getData, getFileSaver, handleTransferError, make, modifyFields, onControlEvent, onDataChangeEvent, postEditorEvent, setData, setFields, setFileSaver, setObject, toControls, toControls, toControls, toControls, transfer, transfer
 
Methods inherited from class ewe.ui.Form
_getSetField, addButton, addTabbedPanel, addToolbar, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, checkButtons, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createWindow, defaultTitleTo, doButtons, doShowExec, exec, exec, exec, exec, exec, exec, exec, exec, exec, execute, execute, execute, filesDropped, formShown, gatherButtons, getButton, getFirstFocus, getFormFrame, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSoftKeys, makeSoftKeys, mb, menuItemSelected, modifyForSmartPhone, onEvent, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setOKCancel, setSoftKeyBarFor, setSoftKeyBarForAll, setTitle, setTopLevelTitle, setupFrame, show, show, show, show, show, show, showWait, stopFormHandle, toolsOnBottom, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilPainted
 
Methods inherited from class ewe.ui.CellPanel
calculateSizes, makeLayoutGrid, relayout, relayoutMe, removeAll, reShow, resize, resizeTo
 
Methods inherited from class ewe.ui.Panel
add, addChildListener, addDirectly, addLast, addLast, addNext, addNext, addNext, doBackground, doBorder, endRow, getControlTag, getPreferredSize, getSubControls, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setText
 
Methods inherited from class ewe.ui.Canvas
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMySize, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, containerHasFocus, dismantle, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getNextKeyFocus, gotFocus, lostFocus, repaintDataNow, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setTextSize, setToolTip, show, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testDim, ticked, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

file

public String file
Do NOT use this to variable. Use getChosen() or getChosenFile() to get the file that the user selected.


fileType

public String fileType
Do NOT use this variable. Use defaultExtension to set a default extention for a file.


defaultExtension

public String defaultExtension
If no extension is given then this will be appended on to the selected file. By default this is null. When you * set it, do not put the '.'


table

public TableControl table
This is the table (list) of files/directory being displayed.


tree

public TreeControl tree
This is the tree of directory being displayed.


files

public FileListTableModel files
This is the FileListTableModel used by the table.


time

public Time time
This is used internally.


dirNavigation

protected CellPanel dirNavigation

persistentHistoryKey

public String persistentHistoryKey
Set this to an application specific name (e.g. "Ewesoft-Jewel") to keep and * retrieve a persistent history for the FileChooser.


extraPanel

public CellPanel extraPanel
Put any extra controls in this panel.


links

public Vector links
These are links for the FileChooser - each of which must be of type FileChooserLink. It will initially be null, unless there are * links inside of globalLinks. In that case a new Vector is created and all the links inside of globalLinks will * be added to it. You can call addLink() to add links to it safely.


afile

public File afile
This is a copy of the File model being used by the FileChooser. You should not set this, but you can * reference it if you need to.


slowAccess

public boolean slowAccess
This indicates that access to the file system will be slow.


showWait

public boolean showWait
This indicates that the wait cursor should be shown when listing is being done.


listModeDefault

public static boolean listModeDefault
Set this true to initially show the FileChooser in list mode.


iconMode

public boolean iconMode
Do not set this directly.


listMode

public boolean listMode
Do not set this directly.


detailMode

public boolean detailMode
Do not set this directly.


noKeyboard

public boolean noKeyboard
Do not set this directly.


noMouse

public boolean noMouse
Do not set this directly.


goBackMenu

public MenuItem goBackMenu

goForwardMenu

public MenuItem goForwardMenu

mask

public String mask
Do not use this.


drives

public MenuItem drives

toolField

public MenuItem toolField
Constructor Detail

FileChooser

public FileChooser()
Create a FileChooser in OPEN mode.


FileChooser

public FileChooser(int type,
                   String initial)
Create a FileChooser with a certain type, in the specified initial directory.


FileChooser

public FileChooser(FileChooserParameters fcp)

FileChooser

public FileChooser(int type,
                   String initial,
                   File aFileModel)
Create a new FileChooser(). After creating it, use execute() to display it. If execute() returns Form.IDCANCEL then * the user canceled the choose operation. Otherwise you can use getChosen() or getChosenFile() to get the chosen file. *

* You can also change the title of the FileChooser by setting "title" after construction. * @param type either OPEN, SAVE, DIRECTORY_SELECT or BROWSE OR'ed with some of the other options. * @param initial The initial directory. * @param aFileModel The file mode to use.

Method Detail

getChosen

public String getChosen()
Use this to get the selected file - do NOT use the "file" variable. If multiple files are selected this will return the first one. Otherwise * it will return the full path of the selected file.


getAllChosen

public String[] getAllChosen()
Get all the chosen file names - even if only a single file was selected. Each item * in the array is the file name only, without the directory path the selected item is in. * Use getChosenDirectory() to get the directory the selected items are in.


getChosenDirectory

public File getChosenDirectory()
Get the directory the chosen file(s) is in.


getAllChosenFiles

public File[] getAllChosenFiles()
Get all chosen files, even if only one file was selected.


getChosenFile

public File getChosenFile()
Use this to get the selected file - do NOT use the "file" variable. If multiple files are selected this will return the first one. Otherwise * it will return the full path of the selected file.


addLink

public void addLink(FileChooserLink link)

associateIcon

public static void associateIcon(String extension,
                                 IImage icon)
This associates an icon with the specified file extension. Do not place the leading '.' in the * extension. e.g. associateIcon("exe",new mImage("myicon/programicon.bmp",Color.White)); * @param extension The extension WITHOUT the leading '.' * @param icon The icon to be displayed. Should be a 16x16 icon.


getIconForFile

public static IImage getIconForFile(String fileName)
Get the associated icon for a file name. * @param fileName The file. * @return The icon associated with the file.


getViewToolBar

protected CellPanel getViewToolBar(String iconsAndFieldsAndTips)

showError

protected void showError(String message,
                         boolean execute)

showError

protected void showError(String title,
                         String message,
                         boolean execute)

doHotKey

protected boolean doHotKey(Control from,
                           KeyEvent ev)
Description copied from class: Control
This method checks to see if a KeyEvent should be considered the Control's hot-key. If it is it calls doAction(ByKeyboard).

Overrides:
doHotKey in class Container

refresh

public void refresh()
Refresh the file list.


lengthToDisplay

public static String lengthToDisplay(int len)

setHistory

public void setHistory(Vector v)
This does not affect the "history" variable. This just assigns the Strings or Files * in the Vector to the history drop down box (desktop layout only).


setOptions

public void setOptions(FileChooserOptions options)

addMask

public void addMask(String mask)
Use this to add a file mask to the chooser's mask list. The mask should be a string with a set of masks (e.g. *.bmp) separated by commas (no spaces in between) followed by a space and then any descriptive name.

For example: "*.bmp,*.png - Image files." * @param mask The mask to add.


getMaskList

public Vector getMaskList()
This returns the list of masks currently set for the file chooser. You can add, remove masks * as necessary, but this must be done before the chooser is shown.


masksChanged

public void masksChanged()
Use this if you have updated the Vector returned by getMaskList().


shown

public void shown()
Overrides:
shown in class Editor

retrieveApplicationHistory

public static void retrieveApplicationHistory(String persistentHistoryKey)
                                       throws IOException
Setup the static history list for FileChoosers in this application using the specified * persistentHistoryKey. Call this method at the start of your application. * @param persistentHistoryKey a unique key name for your application. * @exception ewe.io.IOException if there was an error.

Throws:
IOException

storeApplicationHistory

public static void storeApplicationHistory(String persistentHistoryKey,
                                           Vector history)
                                    throws IOException
Store the specified list of Strings as the application history. * @param persistentHistoryKey a unique key name for your application. * @param history a Vector of Strings. * @exception ewe.io.IOException

Throws:
IOException

fixMask

public String fixMask(String mask)
Do not use this.


setFile

public boolean setFile(File file)
Do not use this.


setFile

public boolean setFile(File file,
                       boolean expandTree)
Do not use this.


checkLength

public boolean checkLength(File f,
                           int warningLength)

doPaste

public static boolean doPaste(File targetDirectory,
                              FileChooser targetChooser)

askClassName

public static String askClassName(String pathToClass,
                                  StringBuffer programDir,
                                  Frame parent)

doNewShortcut

public void doNewShortcut(Editor f)

runFile

public void runFile(File file)

deletePressed

public void deletePressed(int how)

checkMenu

public void checkMenu(String menuLabel,
                      Editor f)

fieldChanged

public void fieldChanged(FieldTransfer ft,
                         Editor f)
Description copied from class: Editor
This implements the fieldChanged() method in FieldListener. If the field is of type MenuItem then action(String fieldName,Editor ed) method is called - where fieldName is set to be the "action" value for the MenuItem.

Specified by:
fieldChanged in interface FieldListener
Overrides:
fieldChanged in class Editor

newFileSelected

protected void newFileSelected(File f)
This gets called when a new file has been clicked or entered. This file * has not necessarily been accepted yet.


newFileInfo

public boolean newFileInfo(boolean isAction)

exit

public boolean exit(int value)
Description copied from class: Form
This will call the canExit() method and if it returns true, it will close the form.

Overrides:
exit in class Form

close

public void close(int value)
Description copied from class: Form
This closes the form unconditionally and sets the exitValue to be exitCode.

Overrides:
close in class Form

addToSavedHistory

public static boolean addToSavedHistory(String historyKey,
                                        File fileOrDirectory)
Add a file or directory to the saved history. * @param historyKey the name of the history key. * @param fileOrDirectory a file or directory. * @return true if it saved successfully, false if not.


canExit

public boolean canExit(int value)
Description copied from class: Form
This is called by the exit() method to see if the form can be closed. It should return true if it can be closed and false if it cannot.

Overrides:
canExit in class Editor

dirUp

public void dirUp()

action

public void action(FieldTransfer ft,
                   Editor f)
Description copied from class: Editor
This implements the action() method in FieldListener. By default it calls action(String name,Editor ed)

Specified by:
action in interface FieldListener
Overrides:
action in class Editor

switchMultiSelect

public void switchMultiSelect(boolean on)

fieldEvent

public void fieldEvent(FieldTransfer ft,
                       Editor f,
                       Object ev)
Description copied from class: Editor
This implements fieldEvent() in FieldListener. By default it does nothing.

Specified by:
fieldEvent in interface FieldListener
Overrides:
fieldEvent in class Editor

main

public static void main(String[] args)