public class PropositionTreeUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DOC_NEW_DATAOBJECT_PATH |
static String |
EDIT_TREE_NEW_COLLECTION_LINE |
Constructor and Description |
---|
PropositionTreeUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cancelNewProp(PropositionEditor proposition) |
static String |
configureLogicExpression(PropositionEditor proposition)
Builds a logical string expression from the proposition tree.
|
static PropositionEditor |
createCompoundPropositionBoStub(PropositionEditor existing,
boolean addNewChild,
Class<? extends PropositionEditor> propClass) |
static PropositionEditor |
createCompoundPropositionBoStub(PropositionEditor existing,
Class<? extends PropositionEditor> propClass) |
static List<PropositionParameterEditor> |
createParameterList() |
static PropositionEditor |
createSimplePropositionBoStub(PropositionEditor sibling,
Class<? extends PropositionEditor> propClass)
This method creates a partially populated Simple PropositionBo with
three parameters: a term type paramter (value not assigned)
a operation parameter
a constant parameter (value set to empty string)
The returned PropositionBo has an generatedId.
|
static Node<RuleEditorTreeNode,String> |
findEditedProposition(Node<RuleEditorTreeNode,String> node)
Find and return the node containing the proposition that is in currently in edit mode
|
static Node<RuleEditorTreeNode,String> |
findParentPropositionNode(Node<RuleEditorTreeNode,String> currentNode,
String selectedPropKey) |
static PropositionEditor |
findProposition(Node<RuleEditorTreeNode,String> currentNode,
String selectedPropKey) |
static String |
getBindingPath(PropositionEditor proposition,
String propertyName) |
static String |
getBindingPrefix(PropositionEditor proposition) |
static PropositionParameterEditor |
getConstantParameter(List<PropositionParameterEditor> parameters)
Returns the first parameter of type constant in the list.
|
static String |
getLabelForOperator(String opCode)
Returns a label based on the operator code.
|
static PropositionParameterEditor |
getOperatorParameter(List<PropositionParameterEditor> parameters)
Returns the first parameter of type operator in the list.
|
static PropositionParameterEditor |
getParameterForType(List<PropositionParameterEditor> parameters,
PropositionParameterType type)
Returns the first parameter of the given type in the list.
|
static PropositionEditor |
getProposition(RuleEditor ruleEditor) |
static PropositionParameterEditor |
getTermParameter(List<PropositionParameterEditor> parameters)
Returns the first parameter of type term in the list.
|
static boolean |
isSimpleCompounds(PropositionEditor propositionEditor) |
static void |
removeCompoundProp(PropositionEditor proposition)
This method walks through the proposition tree and remove all parent compound propositions
that only have one child.
|
static void |
removeCompoundProp(RuleEditor rule)
This method walks through the proposition tree including the root node on the tree
and remove all parent compounde propositions that only have one child.
|
static boolean |
resetEditModeOnPropositionTree(PropositionEditor proposition)
disable edit mode for all Nodes beneath and including the passed in Node
|
static void |
resetNewProp(PropositionEditor proposition) |
public static final String DOC_NEW_DATAOBJECT_PATH
public static final String EDIT_TREE_NEW_COLLECTION_LINE
public PropositionTreeUtil()
public static String getBindingPath(PropositionEditor proposition, String propertyName)
public static String getBindingPrefix(PropositionEditor proposition)
public static Node<RuleEditorTreeNode,String> findParentPropositionNode(Node<RuleEditorTreeNode,String> currentNode, String selectedPropKey)
public static PropositionEditor getProposition(RuleEditor ruleEditor)
PropositionBo
from the formpublic static PropositionEditor findProposition(Node<RuleEditorTreeNode,String> currentNode, String selectedPropKey)
public static Node<RuleEditorTreeNode,String> findEditedProposition(Node<RuleEditorTreeNode,String> node)
node
- the node to start searching from (typically the root)public static boolean resetEditModeOnPropositionTree(PropositionEditor proposition)
proposition
- public static String configureLogicExpression(PropositionEditor proposition)
proposition
- public static PropositionEditor createSimplePropositionBoStub(PropositionEditor sibling, Class<? extends PropositionEditor> propClass) throws IllegalAccessException, InstantiationException
sibling
- -IllegalAccessException
InstantiationException
public static List<PropositionParameterEditor> createParameterList()
public static PropositionEditor createCompoundPropositionBoStub(PropositionEditor existing, boolean addNewChild, Class<? extends PropositionEditor> propClass) throws InstantiationException, IllegalAccessException
public static PropositionEditor createCompoundPropositionBoStub(PropositionEditor existing, Class<? extends PropositionEditor> propClass) throws IllegalAccessException, InstantiationException
public static void cancelNewProp(PropositionEditor proposition)
public static void removeCompoundProp(RuleEditor rule)
rule
- public static void removeCompoundProp(PropositionEditor proposition)
proposition
- public static void resetNewProp(PropositionEditor proposition)
public static PropositionParameterEditor getTermParameter(List<PropositionParameterEditor> parameters)
parameters
- public static PropositionParameterEditor getConstantParameter(List<PropositionParameterEditor> parameters)
parameters
- public static PropositionParameterEditor getOperatorParameter(List<PropositionParameterEditor> parameters)
parameters
- public static PropositionParameterEditor getParameterForType(List<PropositionParameterEditor> parameters, PropositionParameterType type)
parameters
- type
- public static String getLabelForOperator(String opCode)
opCode
- public static boolean isSimpleCompounds(PropositionEditor propositionEditor)
Copyright © 2004-2013 The Kuali Foundation. All Rights Reserved.