From: Jan S. <st...@us...> - 2002-01-27 23:19:31
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv8404 Added Files: EnableGCSessionAction.java EnableGCAction.java Log Message: EnableGC action. --- NEW FILE: EnableGCSessionAction.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 javax.swing.Action; import org.openide.nodes.Node; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CookieAction; /** * Action that enables GC in the selected sessions. * * @author Jan Stola */ public class EnableGCSessionAction extends CookieAction { protected Class[] cookieClasses() { return new Class[]{SessionCookie.class}; } protected int mode() { return MODE_ALL; } protected void performAction(Node[] nodes) { for (int i=0; i<nodes.length; i++) { SessionCookie cookie=(SessionCookie)nodes[i].getCookie(SessionCookie.class); cookie.enableGC(); } } public String getName() { return NbBundle.getMessage(EnableGCSessionAction.class, "LBL_enableGCSessionAction"); } protected String iconResource() { return "/net/sourceforge/javaprofiler/module/resources/EnableGCSessionActionIcon.gif"; } public HelpCtx getHelpCtx() { return new HelpCtx(EnableGCSessionAction.class); } protected void initialize() { super.initialize(); putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(EnableGCSessionAction.class, "HINT_enableGCSessionAction")); } } /* * $Log: EnableGCSessionAction.java,v $ * Revision 1.1 2002/01/27 23:19:28 stolis * EnableGC action. * */ --- NEW FILE: EnableGCAction.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 javax.swing.Action; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.CallableSystemAction; import net.sourceforge.javaprofiler.module.data.Session; import net.sourceforge.javaprofiler.module.data.ProfilerData; /** * Action that enables GC in the current session. * * @author Jan Stola */ public class EnableGCAction extends CallableSystemAction { public void performAction () { Session session=ProfilerData.getData().currentSession(); if (session!=null) { session.getVM().enableGC(true); } } public String getName () { return NbBundle.getMessage(EnableGCAction.class, "LBL_enableGCAction"); } protected String iconResource () { return "/net/sourceforge/javaprofiler/module/resources/EnableGCActionIcon.gif"; } public HelpCtx getHelpCtx () { return new HelpCtx(EnableGCAction.class); } protected void initialize () { super.initialize(); putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(EnableGCAction.class, "HINT_enableGCAction")); } } /* * $Log: EnableGCAction.java,v $ * Revision 1.1 2002/01/27 23:19:28 stolis * EnableGC action. * */ |