From: Lukas P. <pe...@us...> - 2002-08-31 08:44:20
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv3557 Added Files: PSelectorNode.java Log Message: added context action Show Table --- NEW FILE: PSelectorNode.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.nodes; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.Sheet; import org.openide.util.HelpCtx; import org.openide.actions.PropertiesAction; import org.openide.util.actions.SystemAction; import net.sourceforge.javaprofiler.module.sheets.SheetFactory; import net.sourceforge.javaprofiler.module.actions.ShowTable; /** An enhancement to <code>AbstractNode</code> adding support for <code> * SheetFactory</code>. It disables copy action. Instance holds a reference to * some JPI object to enable comparison using the JPI object data. * @author Lukas Petru */ public class PSelectorNode extends AbstractNode { private SheetFactory sheet; private final int type; public PSelectorNode(Children children, SheetFactory shFactory, int childType) { super(children); sheet=shFactory; type=childType; } public Sheet createSheet() { Sheet res=(sheet!=null) ? sheet.create() : super.createSheet(); sheet=null; return res; } public boolean canCopy() { return false; } public HelpCtx getHelpCtx() { return new HelpCtx(getClass()); } protected SystemAction[] createActions() { return new SystemAction[] { SystemAction.get(ShowTable.class), SystemAction.get(PropertiesAction.class) }; } public int getType() { return type; } } /* * $Log: PSelectorNode.java,v $ * Revision 1.1 2002/08/31 08:44:17 petrul * added context action Show Table * */ |