use of com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.CCriteriumWrapper in project binnavi by google.
the class CCriteriumFunctions method appendCriterium.
/**
* Appends a criterium to the criterium tree. The criterium is selected through the given combo
* box.
*
* @param jtree Visible criteria tree.
* @param ctree Backs the visible criteria tree.
* @param conditionBox Provides the criterium to add.
*/
public static void appendCriterium(final JCriteriumTree jtree, final CCriteriumTree ctree, final CConditionBox conditionBox) {
final TreePath path = jtree.getSelectionPath();
if (path != null) {
final JCriteriumTreeNode criteriumTreeNode = (JCriteriumTreeNode) path.getLastPathComponent();
final CCriteriumTreeNode parent = CCriteriumFunctions.findNode(ctree.getRoot(), criteriumTreeNode.getCriterium());
final CCriteriumWrapper selectedItem = (CCriteriumWrapper) conditionBox.getSelectedItem();
if (selectedItem != null) {
final ICriterium criterium = selectedItem.getObject().createCriterium();
if (criterium != null) {
appendCriterium(ctree, parent, criterium);
}
}
}
}
Aggregations