From: Lukas P. <pe...@us...> - 2002-08-28 18:06:30
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets In directory usw-pr-cvs1:/tmp/cvs-serv6044 Added Files: AllocSheet.java BacktraceItemSheet.java CallTreeItemSheet.java ClassSheet.java CPUSheet.java FieldSheet.java MethodSheet.java MonSheet.java SheetFactory.java ThreadgroupSheet.java ThreadSheet.java TypeSheet.java Log Message: property sheets for nodes ver 2 --- NEW FILE: AllocSheet.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.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.AllocStat; public class AllocSheet implements SheetFactory { private AllocStat ref; public AllocSheet(AllocStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); AllocStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: AllocSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: BacktraceItemSheet.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.sheets; import java.util.List; import org.openide.TopManager; import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.jpi.FrameRef; import net.sourceforge.javaprofiler.module.data.BacktraceSupport; import net.sourceforge.javaprofiler.module.nodes.CPUStatProperty; import net.sourceforge.javaprofiler.jpi.CPUStat; /** Serves for creation of PropertySheet for call backtrace item. * @author Lukas Petru */ public class BacktraceItemSheet implements SheetFactory { private FrameRef frRef; private List traces; /** Constructs a sheet from the given data. * @param ref Data of method and line number. * @param list List of <code>CPUStat</code> */ public BacktraceItemSheet(FrameRef ref, List list) { frRef=ref; traces=list; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(BacktraceItemSheet.class); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr=new PropertySupport.Reflection(frRef.getMethod() .getParentClass(), String.class, "getName", null); pr.setName("Class"); pr.setDisplayName(bundle.getString("LBL_BTItemClass")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getName", null); pr.setName("Method"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodName")); set.put(pr); pr=new PropertySupport.Reflection(frRef.getMethod(), String.class, "getSignature", null); pr.setName("MethodSignature"); pr.setDisplayName(bundle.getString("LBL_BTItemMethodSignature")); set.put(pr); pr=new PropertySupport.Reflection(frRef, int.class, "getLineNo", null); pr.setName("LineNumber"); pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); set.put(pr); CPUStat stat=BacktraceSupport.getSumOfCPUStat(traces); CPUStatProperty.addProperties(set, stat); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: BacktraceItemSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: CallTreeItemSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.CallTreeRef; /** Serves for creation of PropertySheet for call tree item. * @author Lukas Petru */ public class CallTreeItemSheet implements SheetFactory { private CallTreeRef ctRef; public CallTreeItemSheet(CallTreeRef ref) { ctRef=ref; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(CallTreeItemSheet.class); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr=new PropertySupport.Reflection(ctRef.getFrame() .getMethod(), String.class, "toString", null); pr.setName("Method"); pr.setDisplayName(bundle.getString("LBL_CTItemMethod")); set.put(pr); pr=new PropertySupport.Reflection(ctRef.getFrame(), int.class, "getLineNo", null); pr.setName("LineNumber"); pr.setDisplayName(bundle.getString("LBL_CTItemLineNo")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUCumulativeTime", null); pr.setName("CumulativeTime"); pr.setDisplayName(bundle.getString("LBL_CTItemCumulativeTime")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUPureTime", null); pr.setName("PureTime"); pr.setDisplayName(bundle.getString("LBL_CTItemPureTime")); set.put(pr); pr=new PropertySupport.Reflection(ctRef, int.class, "getCPUHitsCount", null); pr.setName("HitsCount"); pr.setDisplayName(bundle.getString("LBL_CTItemHits")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: CallTreeItemSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ClassSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.ClassRef; public class ClassSheet implements SheetFactory { private ClassRef ref; public ClassSheet(ClassRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSourceFileName", null); pr.setName("SourceFile"); pr.setDisplayName(bundle.getString("LBL_SourceFile")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ClassSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: CPUSheet.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.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.CPUStat; public class CPUSheet implements SheetFactory { private CPUStat ref; public CPUSheet(CPUStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); CPUStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: CPUSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: FieldSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.FieldRef; public class FieldSheet implements SheetFactory { private FieldRef ref; public FieldSheet(FieldRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref.getParentClass(), String.class, "toString", null); pr.setName("ParentClass"); pr.setDisplayName(bundle.getString("LBL_ParentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSignature", null); pr.setName("Signature"); pr.setDisplayName(bundle.getString("LBL_Signature")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isStatic", null); pr.setName("isStatic"); pr.setDisplayName(bundle.getString("LBL_isStatic")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: FieldSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: MethodSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.MethodRef; public class MethodSheet implements SheetFactory { private MethodRef ref; public MethodSheet(MethodRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref.getParentClass(), String.class, "toString", null); pr.setName("ParentClass"); pr.setDisplayName(bundle.getString("LBL_ParentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); pr=new PropertySupport.Reflection(ref, String.class, "getSignature", null); pr.setName("Signature"); pr.setDisplayName(bundle.getString("LBL_Signature")); set.put(pr); pr=new PropertySupport.Reflection(ref, int.class, "getStartLineNo", null); pr.setName("StartLineNo"); pr.setDisplayName(bundle.getString("LBL_StartLineNo")); set.put(pr); pr=new PropertySupport.Reflection(ref, int.class, "getEndLineNo", null); pr.setName("EndLineNo"); pr.setDisplayName(bundle.getString("LBL_EndLineNo")); set.put(pr); AllocStatProperty.addProperties(set, ref); CPUStatProperty.addProperties(set, ref); MonStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: MethodSheet.java,v $ * Revision 1.1 2002/08/28 18:06:27 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: MonSheet.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.sheets; import org.openide.nodes.Sheet; import net.sourceforge.javaprofiler.module.nodes.*; import net.sourceforge.javaprofiler.jpi.MonStat; public class MonSheet implements SheetFactory { private MonStat ref; public MonSheet(MonStat reference) { ref=reference; } public Sheet create() { Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); MonStatProperty.addProperties(set, ref); sh.put(set); return sh; } } /* * $Log: MonSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: SheetFactory.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.sheets; import org.openide.nodes.Sheet; /** SheetFactory enables lazy creation of a property sheet for some <code>Node * <code>. To be used from <code>AbstractNode.createSheet()</code> method. * @author Lukas Petru */ public interface SheetFactory { public Sheet create(); } /* * $Log: SheetFactory.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ThreadgroupSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import java.util.Date; import net.sourceforge.javaprofiler.jpi.ThreadGroupRef; public class ThreadgroupSheet implements SheetFactory { private ThreadGroupRef ref; public ThreadgroupSheet(ThreadGroupRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ThreadgroupSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: ThreadSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import java.util.Date; import net.sourceforge.javaprofiler.jpi.ThreadRef; public class ThreadSheet implements SheetFactory { private ThreadRef ref; public ThreadSheet(ThreadRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); if (ref.getParentThread() != null) { pr=new PropertySupport.Reflection(ref.getParentThread(), String.class, "getName", null); } else { pr=new PropertySupport.ReadOnly("", String.class, "", "") { public Object getValue() throws IllegalAccessException, InvocationTargetException {return "null";} }; } pr.setName("ParentThread"); pr.setDisplayName(bundle.getString("LBL_ParentThread")); set.put(pr); pr=new PropertySupport.Reflection(ref.getStartTime(), String.class, "toString", null); pr.setName("StartTime"); pr.setDisplayName(bundle.getString("LBL_StartTime")); set.put(pr); pr=new PropertySupport.Reflection(ref.getEndTime(), String.class, "toString", null); pr.setName("EndTime"); pr.setDisplayName(bundle.getString("LBL_EndTime")); set.put(pr); // currently, only AllocStat AllocStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: ThreadSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ --- NEW FILE: TypeSheet.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.sheets; import org.openide.TopManager; import org.openide.nodes.Sheet; import org.openide.nodes.Node; import org.openide.nodes.PropertySupport; import java.util.ResourceBundle; import org.openide.util.NbBundle; import net.sourceforge.javaprofiler.module.nodes.*; import java.lang.reflect.InvocationTargetException; import net.sourceforge.javaprofiler.jpi.TypeRef; public class TypeSheet implements SheetFactory { private TypeRef ref; public TypeSheet(TypeRef reference) { ref=reference; } public Sheet create() { ResourceBundle bundle=NbBundle.getBundle(getClass()); Sheet sh=new Sheet(); Sheet.Set set=Sheet.createPropertiesSet(); try { Node.Property pr; pr=new PropertySupport.Reflection(ref, String.class, "getName", null); pr.setName("Name"); pr.setDisplayName(bundle.getString("LBL_Name")); set.put(pr); if (ref.getComponentClass() != null) { pr=new PropertySupport.Reflection(ref.getComponentClass(), String.class, "toString", null); } else { pr=new PropertySupport.ReadOnly("", String.class, "", "") { public Object getValue() throws IllegalAccessException, InvocationTargetException {return "null";} }; } pr.setName("ComponentClass"); pr.setDisplayName(bundle.getString("LBL_ComponentClass")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isArray", null); pr.setName("isArray"); pr.setDisplayName(bundle.getString("LBL_isArray")); set.put(pr); pr=new PropertySupport.Reflection(ref, boolean.class, "isArrayOfPrimitives", null); pr.setName("isArrayOfPrimitives"); pr.setDisplayName(bundle.getString("LBL_isArrayOfPrimitives")); set.put(pr); AllocStatProperty.addProperties(set, ref); } catch (NoSuchMethodException e) { TopManager.getDefault().notifyException(e); } sh.put(set); return sh; } } /* * $Log: TypeSheet.java,v $ * Revision 1.1 2002/08/28 18:06:28 petrul * property sheets for nodes ver 2 * */ |