Package com.sun.javatest.exec
Class InterviewEditor
java.lang.Object
com.sun.javatest.tool.ToolDialog
com.sun.javatest.exec.InterviewEditor
Dialog to edit InterviewParameters object.
InterviewEditor keeps reference to the main InterviewParameters object,
but never change it.
Before editing interview the main InterviewParameters object is synced
with the view object.
When view object is loaded or saved, all registered observers are notified.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
For private communication with SessionControl, not for broadcast outside of core JT.Nested classes/interfaces inherited from class com.sun.javatest.tool.ToolDialog
ToolDialog.Restorer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextManager
static final int
protected String
static final int
protected InterviewParameters
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected boolean
Deprecated.protected InterviewParameters
Fields inherited from class com.sun.javatest.tool.ToolDialog
DIALOG, FRAME, FREE, MODAL, MODAL_APPLICATION, MODAL_DOCUMENT, MODAL_TOOLKIT, parent, tool, uif
-
Constructor Summary
ConstructorsConstructorDescriptionInterviewEditor
(JComponent parent, UIFactory uif, InterviewParameters ip) InterviewEditor
(JComponent parent, UIFactory uif, InterviewParameters ip, ContextManager cm) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Registers new observerstatic File
Checks default settings relate to config file load from the default locationvoid
close()
static void
copy
(InterviewParameters from, InterviewParameters to) protected JMenu
void
dispose()
Dispose of any window system resources used by the dialog.void
doClose()
protected void
Does actual save work.void
edit
(int mode) Show dialog.static boolean
Compares two InterviewParameters objects for equivalence.protected String
Returns extension for files to be saved.int
protected String
Returns file name to store history of configuration files.protected String
getRestorerWindowKey
(boolean isFullView) protected void
initGUI()
Initialize the GUI, by calling the various setXXX methods.boolean
void
loadAndEdit
(File f) void
Show choose file dialog and then load new file.protected void
loadConfig0
(boolean ask) Show choose file dialog and then load new file.void
loadConfigFromFile
(File file) Updates viewConfig, notifies observers of the change.void
Starts editing new config.protected void
Notifies registered observers of the change happened to viewConfigprotected void
notifyObserversOfVisibility
(boolean isVisible) Notifies registered observers of setVisible() method has been called.protected void
void
Removes observer from the listvoid
revert()
void
save()
void
saveAs()
void
void
setCustomRenderers
(Map<Class<? extends Question>, com.sun.interview.wizard.QuestionRenderer> renderersMap) void
setRunPending
(boolean b) void
setVisible
(boolean isVisible) Specify whether the dialog should be made visible on the screen or not.void
show()
void
show
(int mode) void
show
(int mode, ActionListener closeListener, boolean isTemplateMode) void
show
(ActionListener closeListener) void
protected void
protected void
this method invokes in Window/JInternalFrame listener (depends on dialog variable instance).Methods inherited from class com.sun.javatest.tool.ToolDialog
disableDefaultDisposeHandler, getBody, getButtons, getDefaultButton, getDialogParent, getJMenuBar, getLocation, getRestorer, getSize, getTitle, getTool, isShowing, isVisible, pack, setBody, setButtons, setComponentListener, setDefaultCloseOperation, setHelp, setI18NTitle, setI18NTitle, setI18NTitle, setJMenuBar, setLocation, setLocation, setRestorer, setSize, setSize, setTool, setTool
-
Field Details
-
DEFAULT_MODE
public static final int DEFAULT_MODE- See Also:
-
FULL_MODE
public static final int FULL_MODE- See Also:
-
STD_MODE
public static final int STD_MODE- See Also:
-
STD_TESTS_MODE
public static final int STD_TESTS_MODE- See Also:
-
STD_EXCLUDE_LIST_MODE
public static final int STD_EXCLUDE_LIST_MODE- See Also:
-
STD_KEYWORDS_MODE
public static final int STD_KEYWORDS_MODE- See Also:
-
STD_PRIOR_STATUS_MODE
public static final int STD_PRIOR_STATUS_MODE- See Also:
-
STD_ENVIRONMENT_MODE
public static final int STD_ENVIRONMENT_MODE- See Also:
-
STD_CONCURRENCY_MODE
public static final int STD_CONCURRENCY_MODE- See Also:
-
STD_TIMEOUT_FACTOR_MODE
public static final int STD_TIMEOUT_FACTOR_MODE- See Also:
-
TEMPLATE_FULL_MODE
public static final int TEMPLATE_FULL_MODE- See Also:
-
STD_KFL_MODE
public static final int STD_KFL_MODE- See Also:
-
templateMode
Deprecated.Will be eliminated in the next release. -
contextManager
-
mainConfig
-
viewConfig
-
ext
-
-
Constructor Details
-
InterviewEditor
-
InterviewEditor
-
-
Method Details
-
equal
Compares two InterviewParameters objects for equivalence. Two interview are equivalent when they both provide the same set of questions and all corresponding questions have the same values.- Parameters:
a
- first interviewb
- second interview- Returns:
- true, iff two interviews are equivalent.
-
copy
- Throws:
Interview.Fault
-
checkLoadConfigFileDefaults
Checks default settings relate to config file load from the default location- Parameters:
cm
-ContextManager
object defining current harness' context. The following methods affect this method functionality:getDefaultConfigLoadPath()
getAllowConfigLoadOutsideDefault()
- Throws:
IllegalArgumentException
- if the following configuration errors found:-
getDefaultConfigLoadPath()
returnsnull
whengetAllowConfigLoadOutsideDefault()
returnsfalse
-
getDefaultConfigLoadPath()
returns not absolute path -
getDefaultConfigLoadPath()
returns a file (not a directory)
-
- See Also:
-
getExtention
Returns extension for files to be saved. Subclasses like TemplateEditor might override this method.- Returns:
- default extension
-
getHistoryFileName
Returns file name to store history of configuration files. This implementation returns "configHistory.jtl". Subclasses might override this method to return alternative value. -
getRestorerWindowKey
-
newConfig
public void newConfig()Starts editing new config. Supposed to be called outside. -
edit
public void edit(int mode) Show dialog. -
getFileChooserMode
public int getFileChooserMode()- Returns:
- mode that will be used by WorkDirChooseTool to select file.
-
loadConfig
public void loadConfig()Show choose file dialog and then load new file. Supposed to be invoked from outside of editor. Doesn't expect that viewConfig can be changed. -
loadConfig0
protected void loadConfig0(boolean ask) Show choose file dialog and then load new file. The dialog depends on fileChooserMode setting. It can be either simple JFileChooser or "advanced" home made file chooser.- Parameters:
ask
- if true, dialog asking whether to save changes will appear in case of unsaved changes.
-
loadAndEdit
- Parameters:
f
-
-
loadConfigFromFile
Updates viewConfig, notifies observers of the change.- Parameters:
file
- File to load.
-
save
public void save() -
saveAs
public void saveAs() -
doSave
Does actual save work. should be overridden, when needed.- Throws:
Interview.Fault
IOException
-
revert
public void revert() -
isRunPending
public boolean isRunPending() -
setRunPending
public void setRunPending(boolean b) -
show
public void show() -
updateMenu
public void updateMenu() -
show
public void show(int mode) -
show
-
show
-
setVisible
public void setVisible(boolean isVisible) Description copied from class:ToolDialog
Specify whether the dialog should be made visible on the screen or not.- Overrides:
setVisible
in classToolDialog
- Parameters:
isVisible
- True if the dialog should be made visible, false if is should be made invisible.- See Also:
-
close
public void close() -
doClose
public void doClose() -
windowClosingAction
Description copied from class:ToolDialog
this method invokes in Window/JInternalFrame listener (depends on dialog variable instance). Should be overwritten in subclass if you want to handle window closing event. You may need to change default close operation first for this event to be fired- Overrides:
windowClosingAction
in classToolDialog
-
setCheckExcludeListListener
-
addObserver
Registers new observer- Parameters:
o
- - observer to be added to the list
-
removeObserver
Removes observer from the list- Parameters:
o
- - observer to be removed from the list
-
notifyObservers
protected void notifyObservers()Notifies registered observers of the change happened to viewConfig -
notifyObserversOfVisibility
protected void notifyObserversOfVisibility(boolean isVisible) Notifies registered observers of setVisible() method has been called. -
dispose
public void dispose()Description copied from class:ToolDialog
Dispose of any window system resources used by the dialog. The client-supplied components (menu bar, body, buttons) are not disposed, meaning the dialog can be made visible again, if desired. To dispose the client components, subtype this method.- Overrides:
dispose
in classToolDialog
-
initGUI
protected void initGUI()Description copied from class:ToolDialog
Initialize the GUI, by calling the various setXXX methods.- Specified by:
initGUI
in classToolDialog
-
createFileMenu
-
updateTitle
protected void updateTitle() -
perform
-
setCustomRenderers
-