Search in sources :

Example 1 with DialogTextNodeComment

use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment in project binnavi by google.

the class CNodeFunctions method createCommentNode.

/**
   * Attaches a comment node to a given view node.
   * 
   * @param parent Parent used for dialogs.
   * @param view The view where the new comment node is created.
   * @param node The node the new comment node is attached to.
   */
public static void createCommentNode(final JFrame parent, final INaviView view, final INaviViewNode node) {
    Preconditions.checkNotNull(parent, "IE02128: Parent argument can not be null");
    Preconditions.checkNotNull(view, "IE02129: View argument can not be null");
    Preconditions.checkNotNull(node, "IE01726: Node argument can not be null");
    // TODO (timkornau): this is just transposed from the old code
    // needs to be checked to if we still want this to be like this.
    final CTextNode source = view.getContent().createTextNode(null);
    final CNaviViewEdge edge = view.getContent().createEdge(source, node, EdgeType.TEXTNODE_EDGE);
    final DialogTextNodeComment dlg = new DialogTextNodeComment(parent, source);
    GuiHelper.centerChildToParent(parent, dlg, true);
    dlg.setVisible(true);
    final List<IComment> newComment = dlg.getComment();
    if (newComment == null) {
        view.getContent().deleteEdge(edge);
        view.getContent().deleteNode(source);
    }
}
Also used : CNaviViewEdge(com.google.security.zynamics.binnavi.disassembly.CNaviViewEdge) IComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment) CTextNode(com.google.security.zynamics.binnavi.disassembly.CTextNode) DialogTextNodeComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment)

Example 2 with DialogTextNodeComment

use of com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment in project binnavi by google.

the class CGraphDialogs method showTextNodeCommentDialog.

/**
   * Shows a dialog where the comment of a text node can be edited.
   *
   * @param parent Parent window of the dialog.
   * @param node Text node whose comment is edited.
   */
public static void showTextNodeCommentDialog(final JFrame parent, final CTextNode node) {
    final DialogTextNodeComment dlg = new DialogTextNodeComment(parent, node);
    GuiHelper.centerChildToParent(parent, dlg, true);
    dlg.setVisible(true);
}
Also used : DialogTextNodeComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment)

Aggregations

DialogTextNodeComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.TextNodeComments.DialogTextNodeComment)2 IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)1 CNaviViewEdge (com.google.security.zynamics.binnavi.disassembly.CNaviViewEdge)1 CTextNode (com.google.security.zynamics.binnavi.disassembly.CTextNode)1