|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
ewe.ui.Container
ewe.ui.Canvas
ewe.ui.Panel
ewe.ui.CellPanel
ewe.ui.FormBase
ewe.ui.Form
ewe.ui.Editor
ewe.filechooser.FileChooserBase
ewe.filechooser.FileChooser
The FileChooser class is used to choose files or a directory on a file system. It provides the * following features: *
* 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.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.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 java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Methods inherited from interface ewe.ui.ScrollClient |
getServer, setServer |
| Field Detail |
public String file
public String fileType
public String defaultExtension
public TableControl table
public TreeControl tree
public FileListTableModel files
public Time time
protected CellPanel dirNavigation
public String persistentHistoryKey
public CellPanel extraPanel
public Vector links
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
public String mask
public MenuItem drives
public MenuItem toolField
| Constructor Detail |
public FileChooser()
public FileChooser(int type,
String initial)
public FileChooser(FileChooserParameters fcp)
public FileChooser(int type,
String initial,
File aFileModel)
* 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 |
public String getChosen()
public String[] getAllChosen()
public File getChosenDirectory()
public File[] getAllChosenFiles()
public File getChosenFile()
public void addLink(FileChooserLink link)
public static void associateIcon(String extension,
IImage icon)
public static IImage getIconForFile(String fileName)
protected CellPanel getViewToolBar(String iconsAndFieldsAndTips)
protected void showError(String message,
boolean execute)
protected void showError(String title,
String message,
boolean execute)
protected boolean doHotKey(Control from,
KeyEvent ev)
Control
doHotKey in class Containerpublic void refresh()
public static String lengthToDisplay(int len)
public void setHistory(Vector v)
public void setOptions(FileChooserOptions options)
public void addMask(String mask)
For example: "*.bmp,*.png - Image files." * @param mask The mask to add.
public Vector getMaskList()
public void masksChanged()
public void shown()
shown in class Editor
public static void retrieveApplicationHistory(String persistentHistoryKey)
throws IOException
IOException
public static void storeApplicationHistory(String persistentHistoryKey,
Vector history)
throws IOException
IOExceptionpublic String fixMask(String mask)
public boolean setFile(File file)
public boolean setFile(File file,
boolean expandTree)
public boolean checkLength(File f,
int warningLength)
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)
public void checkMenu(String menuLabel,
Editor f)
public void fieldChanged(FieldTransfer ft,
Editor f)
Editor
fieldChanged in interface FieldListenerfieldChanged in class Editorprotected void newFileSelected(File f)
public boolean newFileInfo(boolean isAction)
public boolean exit(int value)
Form
exit in class Formpublic void close(int value)
Form
close in class Form
public static boolean addToSavedHistory(String historyKey,
File fileOrDirectory)
public boolean canExit(int value)
Form
canExit in class Editorpublic void dirUp()
public void action(FieldTransfer ft,
Editor f)
Editor
action in interface FieldListeneraction in class Editorpublic void switchMultiSelect(boolean on)
public void fieldEvent(FieldTransfer ft,
Editor f,
Object ev)
Editor
fieldEvent in interface FieldListenerfieldEvent in class Editorpublic static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||