Search in sources :

Example 1 with CCriteriumWrapper

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);
            }
        }
    }
}
Also used : TreePath(javax.swing.tree.TreePath) ICriterium(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.ICriterium) JCriteriumTreeNode(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionTree.JCriteriumTreeNode) CCriteriumWrapper(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.CCriteriumWrapper) CCriteriumTreeNode(com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCriteriumTreeNode)

Aggregations

CCriteriumWrapper (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.CCriteriumWrapper)1 ICriterium (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.Conditions.ICriterium)1 CCriteriumTreeNode (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionModel.CCriteriumTreeNode)1 JCriteriumTreeNode (com.google.security.zynamics.binnavi.Gui.CriteriaDialog.ExpressionTree.JCriteriumTreeNode)1 TreePath (javax.swing.tree.TreePath)1