From: Jan S. <st...@us...> - 2002-01-27 23:20:02
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions In directory usw-pr-cvs1:/tmp/cvs-serv8499 Added Files: DisableGCSessionAction.java DisableGCAction.java Log Message: DisableGC action. --- NEW FILE: DisableGCSessionAction.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 disables GC in the selected sessions. * * @author Jan Stola */ public class DisableGCSessionAction 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.disableGC(); } } public String getName() { return NbBundle.getMessage(DisableGCSessionAction.class, "LBL_disableGCSessionAction"); } protected String iconResource() { return "/net/sourceforge/javaprofiler/module/resources/DisableGCSessionActionIcon.gif"; } public HelpCtx getHelpCtx() { return new HelpCtx(DisableGCSessionAction.class); } protected void initialize() { super.initialize(); putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DisableGCSessionAction.class, "HINT_disableGCSessionAction")); } } /* * $Log: DisableGCSessionAction.java,v $ * Revision 1.1 2002/01/27 23:19:58 stolis * DisableGC action. * */ --- NEW FILE: DisableGCAction.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 disables GC in the current session. * * @author Jan Stola */ public class DisableGCAction extends CallableSystemAction { public void performAction () { Session session=ProfilerData.getData().currentSession(); if (session!=null) { session.getVM().enableGC(false); } } public String getName () { return NbBundle.getMessage(DisableGCAction.class, "LBL_disableGCAction"); } protected String iconResource () { return "/net/sourceforge/javaprofiler/module/resources/DisableGCActionIcon.gif"; } public HelpCtx getHelpCtx () { return new HelpCtx(DisableGCAction.class); } protected void initialize () { super.initialize(); putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DisableGCAction.class, "HINT_disableGCAction")); } } /* * $Log: DisableGCAction.java,v $ * Revision 1.1 2002/01/27 23:19:58 stolis * DisableGC action. * */ |