|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.izforge.izpack.installer.gui.IzPanel
com.izforge.izpack.panels.path.PathInputPanel
public class PathInputPanel
Base class for panels which asks for paths to directories. FIXME Uses un-mockable static calls to PathInputBase FIXME Injecting an instance of PathInputBase would solve testing issues
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.izforge.izpack.installer.gui.IzPanel |
|---|
IzPanel.Filler |
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected String |
emptyTargetMsg
|
protected String[] |
existFiles
Files which should be exist |
protected boolean |
mustExist
Flag whether the choosen path must exist or not |
protected PathSelectionPanel |
pathSelectionPanel
The path selection sub panel |
protected String |
warnMsg
|
| Fields inherited from class com.izforge.izpack.installer.gui.IzPanel |
|---|
DELIMITER, HEADLINE, headLineLabel, initialFocus, installData, layoutHelper, parent |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.izforge.izpack.api.handler.AbstractUIHandler |
|---|
ANSWER_CANCEL, ANSWER_NO, ANSWER_YES, CHOICES_YES_NO |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PathInputPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
Resources resources,
Log log)
Constructs a PathInputPanel. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Actions-handling method. |
protected boolean |
checkCreateDirectory(File dir)
Determines if the specified directory can be created. |
protected boolean |
checkEmptyPath()
Determines if an empty path is allowed. |
protected boolean |
checkExists(File file)
Verifies that the specified file exists. |
protected boolean |
checkInstallationInformation(File path)
Verifies that installation information exists in the specified path. |
protected boolean |
checkOverwrite(File dir)
Determines if an existing directory can be written to. |
protected boolean |
checkRequiredFilesExist(String path)
Determines if required files exist relative to the specified path |
void |
createLayoutBottom()
This method does nothing. |
String[] |
getExistFiles()
Returns the array of strings which are described the files which must exist. |
String |
getPath()
Returns the selected path. |
boolean |
isMustExist()
Returns the must exist state. |
boolean |
isValidated()
Indicates whether the panel has been validated or not. |
protected boolean |
isWritable(File path)
Encapsulates the static call to PathInputBase.isWritable(File). |
protected boolean |
modifyInstallation()
Determines if an existing installation is being modified. |
void |
panelActivate()
This method is called when the panel becomes active. |
protected boolean |
pathIsValid()
Same as calling pathIsValid(false). |
protected boolean |
pathIsValid(boolean notifyUserIfInvalid)
Returns whether the chosen path is valid or not. |
void |
setExistFiles(String[] strings)
Sets the paths of files which must exist under the chosen path. |
void |
setMustExist(boolean mustExist)
Sets the must exist state. |
| Methods inherited from class com.izforge.izpack.installer.gui.IzPanel |
|---|
askQuestion, askQuestion, askWarningQuestion, canShowHelp, createInstallationRecord, createLabel, createMultiLineLabel, createMultiLineLabelLang, emitError, emitNotification, emitNotificationFeedback, emitWarning, getControlTextFont, getI18nStringForClass, getI18nStringForClass, getImageIcon, getInitialFocus, getInstallerFrame, getLAF, getLayoutHelper, getMetadata, getResources, getString, getSummaryBody, getSummaryCaption, initLayoutHelper, panelDeactivate, panelValidated, parseText, saveData, setHelpUrl, setInitialFocus, showHelp, toString |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected boolean mustExist
protected String[] existFiles
protected final PathSelectionPanel pathSelectionPanel
protected final String emptyTargetMsg
protected final String warnMsg
| Constructor Detail |
|---|
public PathInputPanel(Panel panel,
InstallerFrame parent,
GUIInstallData installData,
Resources resources,
Log log)
panel - the panel meta-dataparent - the parent windowinstallData - the installation dataresources - the resourceslog - the log| Method Detail |
|---|
public String getPath()
public void createLayoutBottom()
public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenere - The event.public boolean isValidated()
isValidated in class IzPanelpublic void panelActivate()
panelActivate in class IzPanelpublic boolean isMustExist()
public void setMustExist(boolean mustExist)
mustExist - must exist statepublic String[] getExistFiles()
public void setExistFiles(String[] strings)
strings - paths of files which must exist under the chosen pathprotected boolean checkExists(File file)
file - the file to check
true if the file exists, otherwise falseprotected boolean checkEmptyPath()
true if an empty path is allowed, otherwise falseprotected boolean checkInstallationInformation(File path)
path - the path
true if installation information exists, otherwise falseprotected boolean checkRequiredFilesExist(String path)
true if no files are required, or they existprotected boolean checkCreateDirectory(File dir)
dir - the directory
true if the directory may be created, otherwise falseprotected boolean checkOverwrite(File dir)
dir - the directory
true if the directory can be written to, otherwise falseprotected boolean isWritable(File path)
PathInputBase.isWritable(File).
This method was re-added so that it can be overwritten by test helpers since a directory which is not writable cannot be easily created.
path - The path which is to be checked.
True, if the given path is writable.protected boolean modifyInstallation()
true if an installation is being modified, otherwise falseprotected boolean pathIsValid()
pathIsValid(false).
protected boolean pathIsValid(boolean notifyUserIfInvalid)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||