|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mockcentral.editor.nodes.problem.NodeProblemManager
public class NodeProblemManager
Utility class used to manage a list of NodeProblem objects for a
specific MockCentralNode instance.
| Field Summary | |
|---|---|
protected java.util.List<NodeProblem> |
newProblems
|
protected java.util.List<NodeProblem> |
storedProblems
|
| Constructor Summary | |
|---|---|
NodeProblemManager(MockCentralNode node)
Creates a new instance. |
|
| Method Summary | |
|---|---|
void |
addNewProblem(NodeProblem nodeProblem)
Adds a new entry to the list storing problems encountered during validation of the MockCentralNode data. |
void |
clearDeletedNodeProblems(MockCentralNode deletedNode)
Removes any and all NodeProblem objects within the stored
list which specify the supplied MockCentralNode as the
source. |
protected void |
doUpdate(NodeProblem problem,
boolean add)
Adds or removes a NodeProblem from the current list and
propagates the changed upward through all enclosing instances. |
NodeProblem |
getIndexedNodeProblem(java.lang.String elementName,
int elementIndex)
Returns the NodeProblem associated with the given element
name, at the given index, if any. |
static java.lang.String |
getMaxSeverityLabel(MockCentralNode node)
Returns a String describing the maximum severity of any/all NodeProblem instances associated with the supplied
MockCentralNode. |
java.util.List<NodeProblem> |
getNodeProblems()
Returns the stored list of problems. |
static NodeProblem |
getSeverestNodeProblem(MockCentralNode node)
Returns the severest NodeProblem for the supplied
MockCentralNode, if any. |
static java.lang.String |
getSeverityLabel(NodeProblem nodeProblem)
Returns a String describing the severity of the supplied NodeProblem. |
boolean |
isModified()
Returns the value for whether processing the updated list of problems modified the stored list. |
boolean |
processUpdatedNodeProblems(boolean updateUI)
Processes the list used to store any problems encountered during validation of the MockCentralNode data. |
void |
resetNewProblems()
Clears the list used to store any problems encountered during validation of the MockCentralNode data. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.List<NodeProblem> storedProblems
protected java.util.List<NodeProblem> newProblems
| Constructor Detail |
|---|
public NodeProblemManager(MockCentralNode node)
node - the MockCentralNode to be updated after changes,
if any.| Method Detail |
|---|
public static java.lang.String getSeverityLabel(NodeProblem nodeProblem)
NodeProblem. The result is based on looking up the
preference for the severity for the problem's
NodeProblemCategory using the
MockCentralEditorPreferences class.
nodeProblem - the NodeProblem.
NodeProblem.public static NodeProblem getSeverestNodeProblem(MockCentralNode node)
NodeProblem for the supplied
MockCentralNode, if any. The various severity levels for
different NodeProblemCategory types are set as preferences
by the user.
node - the MockCentralNode
NodeProblem for the supplied
MockCentralNode, or null if there are no problems.public static java.lang.String getMaxSeverityLabel(MockCentralNode node)
NodeProblem instances associated with the supplied
MockCentralNode.
node - the MockCentralNode.
NodeProblem instances associated with the supplied
MockCentralNode.public void resetNewProblems()
MockCentralNode data.
public void addNewProblem(NodeProblem nodeProblem)
MockCentralNode data.
nodeProblem - the entry to add.public boolean isModified()
public boolean processUpdatedNodeProblems(boolean updateUI)
MockCentralNode data. This will update the
stored list of problems and fire any changes to the list to all
registered listeners.
public java.util.List<NodeProblem> getNodeProblems()
public NodeProblem getIndexedNodeProblem(java.lang.String elementName,
int elementIndex)
NodeProblem associated with the given element
name, at the given index, if any.
elementName - the type name of the element ("methodParam",
"expectedResult", etc).elementIndex - the index of the element within its enclosing group
(refererring to, for example, the 2nd parameter to a method, or the first
constructor argument).
NodeProblem associated with the given element
name, at the given index, if any.
protected void doUpdate(NodeProblem problem,
boolean add)
NodeProblem from the current list and
propagates the changed upward through all enclosing instances.
problem - the NodeProblem.add - whether the update represents an addition or deletion.public void clearDeletedNodeProblems(MockCentralNode deletedNode)
NodeProblem objects within the stored
list which specify the supplied MockCentralNode as the
source. Propagates the change upward through all enclosing instances.
deletedNode - the MockCentralNode.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||