Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/actions
In directory usw-pr-cvs1:/tmp/cvs-serv13775
Added Files:
DetachAction.java
Log Message:
new detach action
--- NEW FILE: DetachAction.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 deteaches current session.
*
* @author Jan Stola, Pavel
*/
public class DetachAction extends CallableSystemAction {
public void performAction () {
ProfilerData data=ProfilerData.getData();
Session session=data.currentSession();
if (session!=null) {
session.getVM().dispose();
data.removeSession(session);
}
}
public String getName () {
return NbBundle.getMessage(DetachAction.class, "LBL_detachAction");
}
protected String iconResource () {
return "/net/sourceforge/javaprofiler/module/resources/DetachActionIcon.gif";
}
public HelpCtx getHelpCtx () {
return new HelpCtx(DetachAction.class);
}
protected void initialize () {
super.initialize();
putProperty(Action.SHORT_DESCRIPTION, NbBundle.getMessage(DetachAction.class, "HINT_detachAction"));
}
}
/*
* $Log: DetachAction.java,v $
* Revision 1.1 2002/09/06 19:16:51 vachis
* new detach action
*
*/
|