|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.exec.ContextManager
public class ContextManager
The context manager provides an interface for customization of the user
interface and control over certain parameters of harness operation. It only
needs to be customized if the test suite wishes to override default behaviors.
All methods will have an implementation, allowing for easy subclassing to
make only what change the test suite architect wishes.
The test manager (exec tool) will create an instance of the test suite's context
manager near the beginning of initialization. Throughout the lifecycle of
that tool instance, the context manager instance will be reused when
appropriate. For proper operation the context manager must be changed if
the test suite changes, in which case the current manager will be disposed,
although this is not a typical case, since a new tool is normally created in
this circumstance (in current implementation). After a test suite is loaded
into a exec tool instance, the associate context manager object will be reused.
The implementation of that manager can learn of changes in workdir association
by monitoring the setWorkDirectory()
method (be sure to call the
superclass implementation if overriding.
When the exec tool is itself disposed, the dispose()
method of
the associated context manager object will be invoked. If the exec tool were
to diassociate a context manager object from itself (not usually done),
dispose()
would be invoked.
Nested Class Summary | |
---|---|
static class |
ContextManager.TestManagerDialog
Special class for creating dialogs which should be attached to the context of this test manager. |
Field Summary | |
---|---|
protected boolean |
configLoadOutside
|
protected java.io.File |
configLoadPath
|
protected boolean |
configSaveOutside
|
protected java.io.File |
configSavePath
|
protected InterviewParameters |
currentConfig
|
protected InterviewParameters |
currentTemplate
|
protected FeatureManager |
featureManager
|
protected boolean |
templateLoadOutside
|
protected java.io.File |
templateLoadPath
|
protected boolean |
templateSaveOutside
|
protected java.io.File |
templateSavePath
|
protected java.io.File |
wdPath
|
Constructor Summary | |
---|---|
ContextManager()
|
Method Summary | |
---|---|
boolean |
canSaveTemplate(java.io.File file)
This method is invoked each time before saving template. |
void |
dispose()
Called when the associated ExecTool instance is being destroyed. |
boolean |
getAllowConfigLoadOutsideDefault()
Get ability to load config outside default directory |
boolean |
getAllowConfigSaveOutsideDefault()
Get ability to load config outside default directory |
boolean |
getAllowTemplateLoadOutsideDefault()
Get ability to load templates outside default directory |
boolean |
getAllowTemplateSaveOutsideDefault()
Get ability to save templates outside default directory |
JavaTestContextMenu[] |
getContextMenus()
Get the context (popup) custom menus to be added in the GUI. |
InterviewParameters |
getCurrentInterview()
Returns an InterviewParameters instance filled with the current interview values, or null if the interview is not loaded. |
InterviewParameters |
getCurrentTemplate()
Returns an InterviewParameters instance filled with the current template values, or null if the template is not loaded. |
java.util.Map |
getCustomRenderersMap()
|
CustomReport[] |
getCustomReports()
Get custom report types. |
CustomTestResultViewer[] |
getCustomResultViewers()
Get the context custom test result viewers to be added in the GUI. |
java.io.File |
getDefaultConfigLoadPath()
Get the default path from which configuration files are loaded. |
java.io.File |
getDefaultConfigSavePath()
Get the default path from which configuration files are loaded. |
java.io.File |
getDefaultTemplateLoadPath()
Get the default path from which template files are loaded. |
java.io.File |
getDefaultTemplateSavePath()
Get the default path to which template files are saved. |
java.io.File |
getDefaultWorkDirPath()
Get the default path for work directory. |
ET_ControlFactory |
getExecToolControlFactory(ExecTool et,
UIFactory uif)
|
FeatureManager |
getFeatureManager()
Get feature manager from this ContextManager instance. |
InterviewParameters |
getInterview()
Get the permanent instance of the interview object used as a holder for both the configuration and the template. |
JavaTestMenuManager |
getMenuManager()
Get the custom menu manager for this Test Manager instance. |
InterviewParameters |
getTemplate()
Get the active template. |
TestSuite |
getTestSuite()
Get the active test suite. |
ToolBarManager |
getToolBarManager()
|
WorkDirectory |
getWorkDirectory()
Get the active work directory. |
void |
loadConfiguration(java.io.File file)
|
protected void |
openTree(WorkDirectory wd)
|
int |
order()
BasicSession.OrderedObserver interface method. |
void |
refreshTests()
Request that the harness reload the test suite structure from the test suite. |
protected void |
registerCustomQuestionRenderer(java.lang.Class<? extends Question> question,
com.sun.interview.wizard.QuestionRenderer renderer)
Register custom config editor's question renderer for specified question class. |
void |
setAllowConfigLoadOutsideDefault(boolean state)
Set ability to load config outside default directory. |
void |
setAllowConfigSaveOutsideDefault(boolean state)
Set ability to save config outside default directory. |
void |
setAllowTemplateLoadOutsideDefault(boolean state)
Set ability to load templates outside default directory. |
void |
setAllowTemplateSaveOutsideDefault(boolean state)
Set ability to save templates outside default directory. |
void |
setDefaultConfigLoadPath(java.io.File dir)
Set the default path from which configuration files are loaded. |
void |
setDefaultConfigSavePath(java.io.File dir)
Set the default path to which configuration files are saved. |
void |
setDefaultTemplateLoadPath(java.io.File dir)
Set the default path from which template files are loaded. |
void |
setDefaultTemplateSavePath(java.io.File dir)
Set the default path to which template files are saved. |
void |
setDefaultWorkDirPath(java.io.File dir)
Default path presented to user when they are prompted to create a work directory. |
void |
setFeatureManager(FeatureManager featureManager)
Set given feature manager for this ContextManager instance. |
protected void |
setTestSuite(TestSuite ts)
|
protected void |
setWorkDir(WorkDirectory w)
Deprecated. use #setWorkDirectory(WorkDirectory) instead |
protected void |
setWorkDirectory(WorkDirectory w)
|
void |
syncInterview()
Write the active interview to disk if possible. |
void |
updated(Session.Event ev)
Invoked when session has been changed. |
protected void |
updatedCurrentConfig(InterviewParameters ip)
Invoked when the value of the current configuration has been modified. |
protected void |
updatedCurrentTemplate(InterviewParameters ip)
Invoked when the value of the current template has been modified. |
protected void |
updatedWorkDirectory(WorkDirectory wd)
Invoked when the value of the work directory has been modified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.io.File configLoadPath
protected java.io.File configSavePath
protected boolean configLoadOutside
protected boolean configSaveOutside
protected java.io.File templateLoadPath
protected java.io.File templateSavePath
protected boolean templateLoadOutside
protected boolean templateSaveOutside
protected java.io.File wdPath
protected FeatureManager featureManager
protected InterviewParameters currentConfig
protected InterviewParameters currentTemplate
Constructor Detail |
---|
public ContextManager()
Method Detail |
---|
public JavaTestMenuManager getMenuManager()
public ToolBarManager getToolBarManager()
public void dispose()
public JavaTestContextMenu[] getContextMenus()
JavaTestContextMenu
public CustomReport[] getCustomReports()
getCustomReports
in interface Report.CustomReportManager
public CustomTestResultViewer[] getCustomResultViewers()
CustomTestResultViewer
public TestSuite getTestSuite()
public WorkDirectory getWorkDirectory()
public InterviewParameters getInterview()
public InterviewParameters getTemplate() throws java.io.IOException, Interview.Fault
java.io.IOException
Interview.Fault
public InterviewParameters getCurrentInterview()
public InterviewParameters getCurrentTemplate()
public void refreshTests()
public void syncInterview()
java.lang.IllegalStateException
- if there is no interview available.public FeatureManager getFeatureManager()
public void setFeatureManager(FeatureManager featureManager)
featureManager
- new feature managerpublic boolean canSaveTemplate(java.io.File file)
canSaveTemplate
in interface InterviewParameters.TemplateManager
file
- template file
public void setDefaultWorkDirPath(java.io.File dir)
dir
- The initial directory where workdirs should be loaded/saved
to.
java.lang.NullPointerException
- if the parameter given is null.getDefaultWorkDirPath()
public java.io.File getDefaultWorkDirPath()
setDefaultWorkDirPath(File)
public void setDefaultTemplateLoadPath(java.io.File dir)
dir
- The initial directory where template files should be
loaded from.
java.lang.NullPointerException
- if the parameter given is null.getDefaultTemplateLoadPath()
,
setAllowTemplateLoadOutsideDefault(boolean)
public java.io.File getDefaultTemplateLoadPath()
setDefaultTemplateLoadPath(java.io.File)
,
setAllowTemplateLoadOutsideDefault(boolean)
public void setDefaultTemplateSavePath(java.io.File dir)
dir
- The initial directory where template should be saved
to.
java.lang.NullPointerException
- if the parameter given is null.getDefaultTemplateLoadPath()
,
setAllowTemplateLoadOutsideDefault(boolean)
public java.io.File getDefaultTemplateSavePath()
setDefaultTemplateSavePath(File)
,
setAllowTemplateSaveOutsideDefault(boolean)
public void setAllowTemplateLoadOutsideDefault(boolean state)
state
- new stategetAllowTemplateLoadOutsideDefault()
public boolean getAllowTemplateLoadOutsideDefault()
setAllowTemplateLoadOutsideDefault(boolean)
public void setAllowTemplateSaveOutsideDefault(boolean state)
state
- new stategetAllowTemplateSaveOutsideDefault()
public boolean getAllowTemplateSaveOutsideDefault()
setAllowTemplateSaveOutsideDefault(boolean)
public void setDefaultConfigLoadPath(java.io.File dir)
dir
- The initial directory where configuration files should be
loaded from.
java.lang.NullPointerException
- if the parameter given is null.getDefaultConfigLoadPath()
,
setAllowConfigLoadOutsideDefault(boolean)
public java.io.File getDefaultConfigLoadPath()
setDefaultConfigLoadPath(java.io.File)
,
setAllowConfigLoadOutsideDefault(boolean)
public void setDefaultConfigSavePath(java.io.File dir)
dir
- The initial directory where workdirs should be saved
to.
java.lang.NullPointerException
- if the parameter given is null.getDefaultConfigLoadPath()
,
setAllowConfigLoadOutsideDefault(boolean)
public java.io.File getDefaultConfigSavePath()
setDefaultConfigSavePath(File)
,
setAllowConfigSaveOutsideDefault(boolean)
public void setAllowConfigLoadOutsideDefault(boolean state)
state
- new stategetAllowConfigLoadOutsideDefault()
public boolean getAllowConfigLoadOutsideDefault()
setAllowConfigLoadOutsideDefault(boolean)
public void setAllowConfigSaveOutsideDefault(boolean state)
state
- new stategetAllowConfigSaveOutsideDefault()
public boolean getAllowConfigSaveOutsideDefault()
setAllowConfigLoadOutsideDefault(boolean)
public void loadConfiguration(java.io.File file)
protected void setWorkDir(WorkDirectory w)
setWorkDirectory(WorkDirectory)
protected void setWorkDirectory(WorkDirectory w)
protected void openTree(WorkDirectory wd)
protected void setTestSuite(TestSuite ts)
public java.util.Map getCustomRenderersMap()
protected void registerCustomQuestionRenderer(java.lang.Class<? extends Question> question, com.sun.interview.wizard.QuestionRenderer renderer)
question
- Question's classrenderer
- Custom question renderer fot this questionpublic ET_ControlFactory getExecToolControlFactory(ExecTool et, UIFactory uif)
public void updated(Session.Event ev)
updated
in interface Session.Observer
ev
- public int order()
order
in interface BasicSession.OrderedObserver
protected void updatedWorkDirectory(WorkDirectory wd)
wd
- protected void updatedCurrentConfig(InterviewParameters ip)
ip
- - InterviewParameters object with new valuesprotected void updatedCurrentTemplate(InterviewParameters ip)
ip
- - InterviewParameters object with new values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |