From: Lukas P. <pe...@us...> - 2002-08-20 19:12:00
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv17714/actions Modified Files: Bundle.properties Added Files: OpenCallTree.java Log Message: separate call-tree window --- NEW FILE: OpenCallTree.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.CallTreeChildren; 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 call tree. It should be attached to a <code>Snapshot * </code> node. The hierarchy in the new window is Root->Thread Group->Thread * ->CallTreeItem. * @author Lukas Petru */ public class OpenCallTree extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(OpenCallTree.class); protected boolean enable(Node[] activatedNodes) { return (activatedNodes.length==1) && ((SnapshotNode) activatedNodes[0]).isCallTreeEnabled(); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1) return; Snapshot sn=((SnapshotNode) activatedNodes[0]).getSnapshot().getSnapshot (); AbstractNode node=new CallTreeNode(new CallTreeChildren(sn .getThreadGroups())); node.setName("CallTree"); String snName=activatedNodes[0].getDisplayName(); if (snName.length()==0) snName="(unnamed)"; node.setDisplayName("Call Tree of " + snName); node.setIconBase( "/net/sourceforge/javaprofiler/module/resources/CallTreeIcon"); TopManager.getDefault().getNodeOperation().explore(node); } public String getName() { return bundle.getString("LBL_CTAction"); } public HelpCtx getHelpCtx() { return new HelpCtx(OpenCallTree.class); } } Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** Bundle.properties 16 May 2002 12:15:15 -0000 1.4 --- Bundle.properties 20 Aug 2002 19:11:57 -0000 1.5 *************** *** 37,86 **** LBL_pauseAction=Pause LBL_finishAction=Finish - HINT_GCAction=Forces GC in the currently profiled session. - LBL_GCAction=GC - HINT_snapshotAction=Creates snapshot of the currently profiled session. - LBL_snapshotAction=Create Snapshot - LBL_enableGCAction=Enable GC - LBL_disableGCAction=Disable GC - HINT_enableGCAction=Enables GC in the currently profiled session. - HINT_disableGCAction=Disables GC in the currently profiled session. - LBL_GCSessionAction=GC - LBL_enableGCSessionAction=Enable GC - LBL_disableGCSessionAction=Disable GC - LBL_snapshotSessionAction=Create Snapshot - HINT_disableGCSessionAction=Disables GC in the selected sessions. - HINT_enableGCSessionAction=Enables GC in the selected sessions. - HINT_GCSessionAction=Forces GC in the selected sessions. - HINT_snapshotSessionAction=Creates snapshots of the selected sessions. - LBL_closeSnapshotAction=Close - HINT_closeSnapshotAction=Closes selected snapshots. - HINT_saveSnapshotAction=Saves selected snapshot. - LBL_saveSnapshotAction=Save - LBL_listenToConnection=Listen to Connection - LBL_listenAction=Listen - LBL_terminateAction=Terminate - HINT_terminateAction=Terminates listening for the connection from the profiled process. --- 37,63 ---- LBL_pauseAction=Pause LBL_finishAction=Finish HINT_GCAction=Forces GC in the currently profiled session. LBL_GCAction=GC HINT_snapshotAction=Creates snapshot of the currently profiled session. LBL_snapshotAction=Create Snapshot LBL_enableGCAction=Enable GC LBL_disableGCAction=Disable GC HINT_enableGCAction=Enables GC in the currently profiled session. HINT_disableGCAction=Disables GC in the currently profiled session. LBL_GCSessionAction=GC LBL_enableGCSessionAction=Enable GC LBL_disableGCSessionAction=Disable GC LBL_snapshotSessionAction=Create Snapshot HINT_disableGCSessionAction=Disables GC in the selected sessions. HINT_enableGCSessionAction=Enables GC in the selected sessions. HINT_GCSessionAction=Forces GC in the selected sessions. HINT_snapshotSessionAction=Creates snapshots of the selected sessions. LBL_closeSnapshotAction=Close HINT_closeSnapshotAction=Closes selected snapshots. HINT_saveSnapshotAction=Saves selected snapshot. LBL_saveSnapshotAction=Save LBL_listenToConnection=Listen to Connection LBL_listenAction=Listen 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 |