public class GEntryFileName extends GContainer implements GDisplay, GReadWrite, GListener, GClear
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GEntryFileName()
Constructor by default.
|
GEntryFileName(String widgetId,
boolean isRelative,
String label,
String iniVal,
String varName,
int width,
String titleFileChooser,
String description,
String suffix)
Constructor
|
GEntryFileName(String label,
String value)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
after(GEvent e)
Called after the event is processed.
|
void |
before(GEvent e)
Called before the event is processed.
|
void |
clear()
Called when the element is to be cleared, so it can perform the actions required to return to the last
saved/loaded values.
|
static String |
correctFileName(String iniName,
String iniLocalDir)
Method to extract the relative name with "/" rather than "\" and to test also if the file exists !
|
static String |
correctFileName(String iniName,
String iniLocalDir,
boolean testExist)
Method to extract the relative name with "/" rather than "\" and to test also if the file exists !
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
void |
generic()
The prototype of the generic function that shall exist in all the descendants.
|
File |
getFile()
Method to get the selected file.
|
String |
getFileName()
Method to get the selected file name.
|
GIntervalAbstract.GStatus |
getStatus()
Get the status of the widget.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
void |
read()
Implementaion of the routines that allow the component to be loaded from a configuration file.
|
static File |
selectFileWithChooser(int type,
String iniPath,
boolean blockDir,
String title,
String tooltipTex,
String description,
String suffix)
Opens a JFileChooser to select a file.
|
void |
setForcedStatus(GIntervalAbstract.GStatus status)
Set the status of the widget.
|
void |
setLabel(String label)
Method to change the label.
|
void |
updateStatus()
Update the status of the field applying the defined file name.
|
void |
write()
Implementaion of the routines that allow the component to be saved to a configuration file.
|
put
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GEntryFileName(String widgetId, boolean isRelative, String label, String iniVal, String varName, int width, String titleFileChooser, String description, String suffix)
widgetId
- Identifier of the widgetisRelative
- Relative name if true (absolute else)label
- labeliniVal
- initial valuevarName
- variable name in the XML filewidth
- entry area widthtitleFileChooser
- title of the file chooser paneldescription
- description of the type of files to searchsuffix
- suffix of the filespublic GEntryFileName()
public void display() throws GException
GDisplay
display
in interface GDisplay
GException
- in case of problem while reading the value from file.public void generic() throws GException
GContainer
generic
in class GContainer
GException
- In case of problem.public void read() throws GException
GReadWrite
read
in interface GReadWrite
GException
- in case of problem while reading the value from file.public void write() throws GException
GReadWrite
write
in interface GReadWrite
GException
- in case of problem while writing the value to file.public void before(GEvent e) throws GException
GListener
before
in interface GListener
e
- event to processed.GException
- in case there is a problem managing the event.public void after(GEvent e) throws GException
GListener
after
in interface GListener
e
- processed event.GException
- in case there is a problem managing the event.public void updateStatus()
public void setForcedStatus(GIntervalAbstract.GStatus status)
setForcedStatus
in class GComponent
status
- the new status of the widget.public void setLabel(String label)
label
- the new labelpublic GIntervalAbstract.GStatus getStatus()
getStatus
in class GComponent
public void clear() throws GException
GClear
clear
in interface GClear
GException
- in case of problem while clearing the values.public static File selectFileWithChooser(int type, String iniPath, boolean blockDir, String title, String tooltipTex, String description, String suffix)
type
- JFileChooser typeiniPath
- initial directory pathblockDir
- block inside the directory path if truetitle
- sub window titletooltipTex
- tooltip textdescription
- descriptionsuffix
- file suffix (may be null)public static String correctFileName(String iniName, String iniLocalDir)
iniName
- initial file full nameiniLocalDir
- local directory pathpublic static String correctFileName(String iniName, String iniLocalDir, boolean testExist)
iniName
- initial file full nameiniLocalDir
- local directory pathtestExist
- test if the file exists if truepublic String getFileName()
public File getFile()
public GComponent getSubComponent(int position) throws GComponentException
getSubComponent
in class GComponent
position
- position of the requested component.GComponentException
- in case the position argument is invalid.Copyright © 2024. All rights reserved.