|
From: Lukas P. <pe...@us...> - 2002-08-23 18:12:25
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv18965 Modified Files: Bundle.properties Added Files: OpenBacktrace.java Log Message: added cpu backtrace view --- NEW FILE: OpenBacktrace.java --- /* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"); you may not use this file except * in compliance with the License. A copy of the License is available * at http://www.sun.com/ * * The Original Code is the Java Profiler module. The Initial Developers * of the Original Code are Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. * * Portions created by Jan Stola are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Pavel Vacha are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Michal Pise are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Petr Luner are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Lukas Petru are Copyright (C) 2000-2001. * All Rights Reserved. * * Portions created by Marek Przeczek are Copyright (C) 2000-2001. * All Rights Reserved. * * Contributors: Jan Stola, Pavel Vacha, Michal Pise, Petr Luner, * Lukas Petru and Marek Przeczek. */ package net.sourceforge.javaprofiler.module.actions; import org.openide.TopManager; import org.openide.util.actions.NodeAction; import org.openide.util.HelpCtx; import org.openide.nodes.Node; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import net.sourceforge.javaprofiler.module.nodes.CallTreeNode; import net.sourceforge.javaprofiler.module.nodes.BacktraceChildren; import net.sourceforge.javaprofiler.module.nodes.SnapshotNode; import net.sourceforge.javaprofiler.jpi.Snapshot; import java.util.ResourceBundle; import org.openide.util.NbBundle; /** Opens a new window with backtrace. It should be attached to a <code>Snapshot * </code> node. The view contains CPUTraces which expand from the last called * method to caller methods. * @author Lukas Petru */ public class OpenBacktrace extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(OpenBacktrace .class); protected boolean enable(Node[] activatedNodes) { return (activatedNodes.length==1); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1) return; Snapshot sn=((SnapshotNode) activatedNodes[0]).getSnapshot().getSnapshot (); AbstractNode node=new CallTreeNode(new BacktraceChildren(sn .getCPUTraces(), 1)); node.setName("Backtrace"); String snName=activatedNodes[0].getDisplayName(); if (snName.length()==0) snName="(unnamed)"; node.setDisplayName("Backtrace of " + snName); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/BacktraceIcon"); TopManager.getDefault().getNodeOperation().explore(node); } public String getName() { return bundle.getString("LBL_BTAction"); } public HelpCtx getHelpCtx() { return new HelpCtx(OpenBacktrace.class); } } /* * $Log: OpenBacktrace.java,v $ * Revision 1.1 2002/08/23 18:12:22 petrul * added cpu backtrace view * */ Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Bundle.properties 20 Aug 2002 19:11:57 -0000 1.5 --- Bundle.properties 23 Aug 2002 18:12:22 -0000 1.6 *************** *** 61,63 **** LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_CTAction=Open Call Tree \ No newline at end of file --- 61,64 ---- LBL_terminateAction=Terminate HINT_terminateAction=Terminates listening for the connection from the profiled process. ! LBL_CTAction=Open Call Tree ! LBL_BTAction=Open Backtrace |