|
What this is
Other links
The source code/* * 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 NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.modules.vcscore.runtime; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.lang.ref.Reference; import java.lang.ref.WeakReference; import org.netbeans.modules.vcscore.commands.VcsCommandExecutor; import org.openide.nodes.Node; import org.openide.nodes.Sheet; import org.openide.util.actions.SystemAction; /** * An abstract class that encapsulates the module dependant features that are needed * when creating a runtime tab node for a command. * If your module is using the CommandsPool and VcsCommandExecutor classes form vcscore, * you don't have to do anything and your commands will be automatically added. * You need an subclasses' instance when creating the RuntimeCommandNode. * See VcsRuntimeCommand for default implementation. * @author Milos Kleint */ public abstract class RuntimeCommand implements Node.Cookie { /** * Constant that means a command was successfully exited. * It should be returned by the getExitStatus() method. * */ public static final int SUCCEEDED = VcsCommandExecutor.SUCCEEDED; /** * Constant that means a command failed. * It should be returned by the getExitStatus() method. * */ public static final int FAILED = VcsCommandExecutor.FAILED; /** * Constant that means a command was interrupted. * It should be returned by the getExitStatus() method. * */ public static final int INTERRUPTED = VcsCommandExecutor.INTERRUPTED; public static final int STATE_WAITING = RuntimeCommandNode.STATE_WAITING; public static final int STATE_RUNNING = RuntimeCommandNode.STATE_RUNNING; public static final int STATE_DONE = RuntimeCommandNode.STATE_DONE; public static final int STATE_CANCELLED = RuntimeCommandNode.STATE_CANCELLED; public static final int STATE_KILLED_BUT_RUNNING = RuntimeCommandNode.STATE_KILLED_BUT_RUNNING; public static final String PROP_STATE = "state"; public static final String PROP_DISPLAY_NAME = "displayName"; private Reference nodeDelegate = new WeakReference(null); private PropertyChangeSupport changeSupport; /** Creates new RuntimeCommand */ public RuntimeCommand() { changeSupport = new PropertyChangeSupport(this); } /** * Subclasses should return a name of the command. */ public abstract String getName(); /** * Subclasses should return a display name of the command. * If not defined, the getName()'s result is used instead. */ public abstract String getDisplayName(); /** * When the command finishes this method should return the exit atatus of the vcs command. * See constants in this class. */ public abstract int getExitStatus(); /** * this method returns the set of actions that should be available for the runtime tab node of the command. */ public abstract SystemAction[] getActions(); /** * this method returns the default action that should be available on the runtime tab node of the command. */ public abstract SystemAction getDefaultAction(); /** * If you returned the CommandOutputViewAction among the other actions in getActions() method, * you should implement this method and when |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.