Search in sources :

Example 1 with COpenInLastWindowAction

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction in project binnavi by google.

the class CEventTableMenu method addOpenFunction.

/**
   * Adds a menu item to open the selected trace.
   *
   * @param parent Parent window of the menu.
   * @param traces The selected traces.
   */
private void addOpenFunction(final Window parent, final List<ITraceEvent> traces) {
    if (traces.size() == 1) {
        final ITraceEvent trace = traces.get(0);
        final INaviModule module = trace.getOffset().getModule();
        if (module.isLoaded()) {
            final INaviFunction function = module.getContent().getFunctionContainer().getFunction(trace.getOffset().getAddress().getAddress());
            if (function != null) {
                final IViewContainer container = graphModel.getViewContainer();
                final INaviView view = container.getView(function);
                if (view != null) {
                    add(new JMenuItem(CActionProxy.proxy(new COpenInLastWindowAction(parent, container, new INaviView[] { view }))));
                    addSeparator();
                }
            }
        }
    }
}
Also used : IViewContainer(com.google.security.zynamics.binnavi.disassembly.views.IViewContainer) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) INaviModule(com.google.security.zynamics.binnavi.disassembly.INaviModule) COpenInLastWindowAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction) JMenuItem(javax.swing.JMenuItem) INaviFunction(com.google.security.zynamics.binnavi.disassembly.INaviFunction) ITraceEvent(com.google.security.zynamics.binnavi.debug.models.trace.interfaces.ITraceEvent)

Example 2 with COpenInLastWindowAction

use of com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction in project binnavi by google.

the class CViewsTable method handleDoubleClick.

@Override
protected void handleDoubleClick(final int row) {
    final Action action = CActionProxy.proxy(new COpenInLastWindowAction(getParentWindow(), viewContainer, new INaviView[] { viewsTableModel.getViews().get(row) }));
    action.actionPerformed(null);
}
Also used : Action(javax.swing.Action) COpenInLastWindowAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction) AbstractAction(javax.swing.AbstractAction) INaviView(com.google.security.zynamics.binnavi.disassembly.views.INaviView) COpenInLastWindowAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction)

Aggregations

COpenInLastWindowAction (com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Nodes.Views.Component.Actions.COpenInLastWindowAction)2 INaviView (com.google.security.zynamics.binnavi.disassembly.views.INaviView)2 ITraceEvent (com.google.security.zynamics.binnavi.debug.models.trace.interfaces.ITraceEvent)1 INaviFunction (com.google.security.zynamics.binnavi.disassembly.INaviFunction)1 INaviModule (com.google.security.zynamics.binnavi.disassembly.INaviModule)1 IViewContainer (com.google.security.zynamics.binnavi.disassembly.views.IViewContainer)1 AbstractAction (javax.swing.AbstractAction)1 Action (javax.swing.Action)1 JMenuItem (javax.swing.JMenuItem)1