public abstract class ControllerBase extends java.lang.Object implements Controller, NamedObject
NamedObject.NameType
Constructor and Description |
---|
ControllerBase() |
Modifier and Type | Method and Description |
---|---|
static void |
adjustName(Controller controller) |
protected void |
clearEditor()
This method allows subclasses to clear out our cached editor instance, if there is one.
|
boolean |
confirmDelete()
You can question/challenge/prevent deletes
|
java.lang.String |
createUniqueName(java.util.Collection<?> current,
java.lang.String aName) |
java.lang.String |
createUniqueName(java.lang.String aName)
This method ensures the uniqueness of the input name.
|
static Controller |
defaultMakeNewOne(com.itko.lisa.editor.Intersections ints,
java.awt.Component owner,
java.lang.String title,
TestCaseInfo tc,
TestNodeInfo node) |
void |
destroy()
When we're shutting down the whole thing, we'll want to clean up model and viewer.
|
static void |
destroy(java.util.List<? extends Controller> list)
This is a helper method for destroying the controlers given in the specified list.
|
void |
exportAssets() |
void |
gatherStepConnections(java.util.Collection<com.itko.lisa.test.StepConnection> stepConnections)
This method is used for gathering information used in graphing and realizing who's
talking to whom.
|
java.lang.String |
generateName()
Get an default name for the element.
|
static java.lang.String |
getBaseCalculatedNameFromUniqueName(java.lang.String aName) |
java.lang.String |
getDisplayName()
Fashion for us a short name for use in trees and lists
|
CustomEditor |
getEditor() |
abstract java.lang.String |
getEditorName()
Tell us the title of the window to use when creating dialogs and etc.
|
java.lang.String |
getElementName()
If renaming is allowed, then the framework might call this method to fetch the name.
|
java.lang.String |
getLastErrorMessage()
Used by the GUI to display a better message.
|
java.lang.String |
getName()
On object that implement this interface, this method is called to fetch
the name of the object
|
NamedObject.NameType |
getNameType()
Returns the type of Element Name.
|
static java.lang.String |
getNewName(java.util.Collection<?> current,
java.lang.String baseName) |
abstract TestCaseInfo |
getTestCaseInfo() |
abstract TestNodeInfo |
getTestNode()
So that your subclasses and editors know the node you are related to
|
boolean |
hasChanged()
The framework is asking if you or your editor have changed the data inside (typically called
when the user is moving focus away from your editor)
|
boolean |
isEditorCompact()
The framework uses this method to determine whether the editor for this controller is
designed to fit in the narrow inspector (
true ) or if it requires more real
estate (false ). |
java.lang.String |
isEditorValid()
We expect you to inspect the editor and your internal data if appropriate, and return a human
readable string of an error that should be addressed, or null if there is no problem.
|
boolean |
isGeneratedName(java.lang.String name) |
boolean |
isInInvalidState()
This is basically just a boolean version of isEditorValid
|
boolean |
isRenamingAllowed()
Can be renamed?
|
abstract CustomEditor |
makeEditor()
You are responsible for telling us what UI editor to use, so please give it
here.
|
abstract void |
migrate(java.lang.Object testCaseObj)
If the test case object that you are going to maintain already existed in an existing test,
then we need you to migrate the state of that exsiting element into your state here.
|
void |
objectDeleted()
This method is called when the user has deleted this controller (and the object it
represents) from the containing model.
|
void |
refreshEditor()
This method allows the editor for this controller to be refreshed if the editor has been
created.
|
void |
renameElement(java.lang.String newName)
Here is how you can rename the element from the framework level
|
void |
save()
We are asking you to persist from your editor into your state, this is usually called after
the user is done if your editor, and we have called hasChanged() and isEditorValid() w/o issues.
|
abstract void |
setEditorTarget(TestCaseInfo tc,
TestNodeInfo node)
Called on this object by the framework to let you know what test case
you are scoped into and the test node.
|
protected void |
setLastErrorMessage(java.lang.String message) |
void |
setName(java.lang.String name)
This method is called to set the name of the object
|
static void |
setNameType(Controller ctrl) |
void |
setNameType(NamedObject.NameType type)
Sets the element name-type.
|
CustomEditor |
showEditor()
When the framework needs to actually put the editor on screen, you'll get called here.
|
abstract void |
writeXML(java.io.PrintWriter pw)
When it's time for you to stream your XML representation to the output stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getControllerFactory, getIntersections, getPropertiesReferenced, getPropertiesSet, setType
public static Controller defaultMakeNewOne(com.itko.lisa.editor.Intersections ints, java.awt.Component owner, java.lang.String title, TestCaseInfo tc, TestNodeInfo node)
public abstract void setEditorTarget(TestCaseInfo tc, TestNodeInfo node)
Controller
setEditorTarget
in interface Controller
public abstract TestNodeInfo getTestNode()
Controller
getTestNode
in interface Controller
public abstract TestCaseInfo getTestCaseInfo()
public abstract void migrate(java.lang.Object testCaseObj)
Controller
migrate
in interface Controller
testCaseObj
- the object to migrate (like the TestNode, FilterInterface, etc.)public abstract void writeXML(java.io.PrintWriter pw)
Controller
writeXML
in interface Controller
writeXML
in interface com.itko.lisa.model.IWriteXML
pw
- the output writer to push your data intopublic abstract java.lang.String getEditorName()
Controller
getEditorName
in interface Controller
public boolean isRenamingAllowed()
isRenamingAllowed
in interface Controller
public java.lang.String getElementName()
getElementName
in interface Controller
public void renameElement(java.lang.String newName)
renameElement
in interface Controller
public java.lang.String getDisplayName()
Controller
getDisplayName
in interface Controller
public java.lang.String getName()
getName
in interface NamedObject
public void setName(java.lang.String name)
setName
in interface NamedObject
public java.lang.String generateName()
generateName
in interface com.itko.lisa.test.NameGenerator
public boolean isGeneratedName(java.lang.String name)
isGeneratedName
in interface com.itko.lisa.test.NameGenerator
public NamedObject.NameType getNameType()
getNameType
in interface NamedObject
public void setNameType(NamedObject.NameType type)
setNameType
in interface NamedObject
type
- public java.lang.String createUniqueName(java.lang.String aName)
NamedObject
createUniqueName
in interface NamedObject
public java.lang.String createUniqueName(java.util.Collection<?> current, java.lang.String aName)
public abstract CustomEditor makeEditor()
Controller
makeEditor
in interface Controller
public final CustomEditor getEditor()
public final CustomEditor showEditor()
Controller
showEditor
in interface Controller
public final void refreshEditor()
protected final void clearEditor()
public boolean isEditorCompact()
true
) or if it requires more real
estate (false
). At this level, we return false
. If a subclass uses a
small enough editor, they should override this and return true
.isEditorCompact
in interface Controller
true
if the controller's editor will fit in the model editor object
inspector or false
if not.public boolean isInInvalidState()
Controller
isInInvalidState
in interface Controller
public boolean hasChanged()
Controller
hasChanged
in interface Controller
public java.lang.String isEditorValid()
Controller
isEditorValid
in interface Controller
public java.lang.String getLastErrorMessage()
Controller
getLastErrorMessage
in interface Controller
protected void setLastErrorMessage(java.lang.String message)
public void save()
Controller
save
in interface Controller
public boolean confirmDelete()
Controller
confirmDelete
in interface Controller
public void objectDeleted()
objectDeleted
in interface Controller
public void destroy()
super.destroy()
or you'll cause resource
leakage. So behave!destroy
in interface Controller
public static void destroy(java.util.List<? extends Controller> list)
list
- the list of controllers to destroy.public void gatherStepConnections(java.util.Collection<com.itko.lisa.test.StepConnection> stepConnections)
gatherStepConnections
in interface Controller
stepConnections
- the collection to add all the step connections this editor knows
about as StepConnection
objects to.StepConnection
public static java.lang.String getNewName(java.util.Collection<?> current, java.lang.String baseName)
public static void setNameType(Controller ctrl)
public static java.lang.String getBaseCalculatedNameFromUniqueName(java.lang.String aName)
public static void adjustName(Controller controller)
public void exportAssets()
exportAssets
in interface Controller
Copyright © 1998-2014 CA, Inc. All Rights Reserved.