Search in sources :

Example 1 with CTagNode

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode in project binnavi by google.

the class CTagSortingHandler method drop.

@Override
public void drop(final DNDTree target, final DefaultMutableTreeNode parentNode, final DefaultMutableTreeNode draggedNode) {
    final ITagManager tagManager = ((CTagNode) parentNode).getTagManager();
    final TreeNode<CTag> parentNodeNode = ((CTagNode) parentNode).getObject();
    final TreeNode<CTag> draggedNodeNode = ((CTagNode) draggedNode).getObject();
    try {
        tagManager.moveTag(parentNodeNode, draggedNodeNode);
        CNodeExpander.expandNode(target, parentNodeNode);
    } catch (final CouldntSaveDataException e) {
        // TODO: Improve this
        CUtilityFunctions.logException(e);
    }
}
Also used : ITagManager(com.google.security.zynamics.binnavi.Tagging.ITagManager) CouldntSaveDataException(com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) CTagNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode)

Example 2 with CTagNode

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode in project binnavi by google.

the class CViewsToTagHandler method canHandle.

@SuppressWarnings("unchecked")
@Override
public boolean canHandle(final DefaultMutableTreeNode parentNode, final Object data) {
    if (parentNode instanceof CTagNode) {
        final List<INaviView> views = (List<INaviView>) data;
        final CTag tag = ((CTagNode) parentNode).getObject().getObject();
        for (final INaviView view : views) {
            if (!view.getConfiguration().isTagged(tag) && view.inSameDatabase(tag)) {
                return true;
            }
        }
        return false;
    }
    return false;
}
Also used : INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) CTagNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode) List(java.util.List)

Example 3 with CTagNode

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode in project binnavi by google.

the class CTagContainerNode method createChildren.

@Override
protected void createChildren() {
    if (m_database.isLoaded()) {
        final List<? extends ITreeNode<CTag>> children = m_rootTag.getChildren();
        Collections.sort(children, new TagComparator());
        for (final ITreeNode<CTag> tag : children) {
            add(new CTagNode(getProjectTree(), m_database, (TreeNode<CTag>) tag));
        }
    }
}
Also used : CProjectTreeNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.CProjectTreeNode) TreeNode(com.google.security.zynamics.zylib.types.trees.TreeNode) ITreeNode(com.google.security.zynamics.zylib.types.trees.ITreeNode) CTag(com.google.security.zynamics.binnavi.Tagging.CTag) CTagNode(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode) TagComparator(com.google.security.zynamics.binnavi.Tagging.TagComparator)

Aggregations

CTagNode (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Tag.CTagNode)3 CTag (com.google.security.zynamics.binnavi.Tagging.CTag)3 CouldntSaveDataException (com.google.security.zynamics.binnavi.Database.Exceptions.CouldntSaveDataException)1 CProjectTreeNode (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.CProjectTreeNode)1 ITagManager (com.google.security.zynamics.binnavi.Tagging.ITagManager)1 TagComparator (com.google.security.zynamics.binnavi.Tagging.TagComparator)1 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)1 ITreeNode (com.google.security.zynamics.zylib.types.trees.ITreeNode)1 TreeNode (com.google.security.zynamics.zylib.types.trees.TreeNode)1 List (java.util.List)1