Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/sheets
In directory usw-pr-cvs1:/tmp/cvs-serv4438
Added Files:
TraceSheet.java
Log Message:
added Frames property
--- NEW FILE: TraceSheet.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.*;
import java.lang.reflect.InvocationTargetException;
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.jpi.TraceRef;
import net.sourceforge.javaprofiler.jpi.AllocStat;
import net.sourceforge.javaprofiler.jpi.CPUStat;
import net.sourceforge.javaprofiler.jpi.MonStat;
import net.sourceforge.javaprofiler.module.nodes.*;
public class TraceSheet implements SheetFactory {
private final TraceRef ref;
public TraceSheet(TraceRef 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(this,
String.class, "getFramesString", null);
pr.setName("Frames");
pr.setDisplayName(bundle.getString("LBL_Frames"));
set.put(pr);
if (ref instanceof AllocStat)
AllocStatProperty.addProperties(set, (AllocStat) ref);
if (ref instanceof CPUStat)
CPUStatProperty.addProperties(set, (CPUStat) ref);
if (ref instanceof MonStat)
MonStatProperty.addProperties(set, (MonStat) ref);
} catch (NoSuchMethodException e) {
TopManager.getDefault().notifyException(e);
}
sh.put(set);
return sh;
}
public String getFramesString() {
StringBuffer buff=new StringBuffer();
Iterator it=ref.getFrames().iterator();
while (it.hasNext()) {
Object o=it.next();
buff.append(o.toString());
buff.append("\n");
}
return buff.toString();
}
}
/*
* $Log: TraceSheet.java,v $
* Revision 1.1 2002/08/31 08:47:36 petrul
* added Frames property
*
*/
|