From: Lukas P. <pe...@us...> - 2002-08-31 08:39:44
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv2426 Modified Files: Bundle.properties Added Files: ShowTable.java Log Message: action Show Table --- NEW FILE: ShowTable.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.util.actions.NodeAction; import org.openide.util.HelpCtx; import org.openide.nodes.Node; import java.awt.BorderLayout; import org.openide.TopManager; import org.openide.explorer.ExplorerPanel; import org.openide.explorer.view.ListTableView; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import java.util.ResourceBundle; import org.openide.util.NbBundle; public class ShowTable extends NodeAction { private static ResourceBundle bundle=NbBundle.getBundle(ShowTable.class); protected boolean enable(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return false; int type=((PSelectorNode) activatedNodes[0]).getType(); return InterfaceRepository.hasAlloc(type) || InterfaceRepository.hasCPU(type)||InterfaceRepository.hasMon(type); } protected void performAction(Node[] activatedNodes) { if (activatedNodes.length!=1 || !(activatedNodes[0] instanceof PSelectorNode)) return; final int type=((PSelectorNode) activatedNodes[0]).getType(); class DataTable extends ExplorerPanel { DataTable() { ListTableView view=new ListTableView(); add(view, BorderLayout.CENTER); Sheet.Set set=new Sheet.Set(); if (InterfaceRepository.hasAlloc(type)) AllocStatProperty.addProperties(set, null); if (InterfaceRepository.hasCPU(type)) CPUStatProperty.addProperties(set, null); if (InterfaceRepository.hasMon(type)) MonStatProperty.addProperties(set, null); view.setProperties(set.getProperties()); } } ExplorerPanel panel=new DataTable(); panel.getExplorerManager().setRootContext(activatedNodes[0]); panel.open(); } public String getName() { return bundle.getString("LBL_ShowTable"); } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } } /* * $Log: ShowTable.java,v $ * Revision 1.1 2002/08/31 08:39:41 petrul * action Show Table * */ Index: Bundle.properties =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions/Bundle.properties,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Bundle.properties 23 Aug 2002 18:12:22 -0000 1.6 --- Bundle.properties 31 Aug 2002 08:39:41 -0000 1.7 *************** *** 63,64 **** --- 63,65 ---- LBL_CTAction=Open Call Tree LBL_BTAction=Open Backtrace + LBL_ShowTable=Show Table \ No newline at end of file |