public abstract class DeployCommand extends Command implements Element
| Modifier and Type | Class and Description |
|---|---|
static interface |
DeployCommand.Callback
An object that can inspect the DeployShell at various stages.
|
static class |
DeployCommand.CommandInstantiationException |
static class |
DeployCommand.DefaultCallback
A No-op implementation of Callback for use as a base-class.
|
static class |
DeployCommand.Status |
| Constructor and Description |
|---|
DeployCommand(HashStructure hash) |
DeployCommand(int cmdId,
int type,
int sequenceId) |
| Modifier and Type | Method and Description |
|---|---|
static DeployCommand |
create(HashStructure hash)
Deprecated.
|
Runnable |
createRunnable() |
protected void |
deploy(DeployShell shell) |
int |
doit()
Executes the actions associated with a specific command.
|
protected void |
exception(java.lang.Exception e,
DeployShell shell)
Called when an exception is thrown from deployment.
|
protected void |
finished(DeployShell shell)
Called after deployment has finished running.
|
Attributes |
getAttributes()
This method returns an
Attributes object that encodes the
attributes of the Element. |
java.util.Iterator<Element> |
getChildren()
This method is part of the
Element interface to
provide a convenient way of getting an Iterator over any
contained child Elements without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type. |
<T extends DeploymentOptions> |
getDeploymentOptions(java.lang.Class<T> optionsClass) |
protected DeployShellFactory |
getDeployShellFactory() |
javax.swing.Icon |
getIcon()
Returns an
Icon that can be shown in association with this
Displayable. |
java.lang.String |
getLongLabel()
Returns a long label that can be displayed to the user.
|
Platform |
getPlatform() |
int |
getSequenceId() |
abstract java.lang.String |
getShortLabel()
Returns a short label that can be displayed to the user.
|
DeployCommandState |
getState() |
protected abstract java.lang.Class<? extends DeployCommandState> |
getStateClass() |
DeployCommand.Status |
getStatus() |
java.lang.String |
getToolTipText()
Returns the tool tip text to show when the mouse pointer pauses
over a UI component that represents this
Displayable. |
protected abstract boolean |
isReady() |
boolean |
isSynchronous()
Will calling {code doIt()} run on current thread or another thread.
|
boolean |
mayHaveChildren()
This method is part of the
Element interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type. |
protected DeployCommandState |
newState() |
protected DeployCommandState |
newState(HashStructure hash) |
protected void |
prepare(DeployShell shell)
Prepares for deployment.
|
void |
setCallback(DeployCommand.Callback callback) |
void |
setContext(Context originalContext)
Sets context associated with command.
|
<T extends DeploymentOptions> |
setDeploymentOptions(T options) |
void |
setPlatform(Platform platform) |
void |
setState(DeployCommandState state) |
protected void |
setStatus(DeployCommand.Status status) |
void |
setSynchronous(boolean sync) |
protected DeployCommandState |
state() |
protected void |
updateStatus() |
enableConfirmation, getAffectedNodes, getContext, getData, getId, getName, getProgressHandle, getType, isGlobal, setData, setTaskInfo, undoclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoStringpublic DeployCommand(int cmdId,
int type,
int sequenceId)
public DeployCommand(HashStructure hash)
public boolean mayHaveChildren()
ElementElement interface to
provide a convenient way of determining whether an object may
have children without having to test the object's type with the
instanceof operator or having to downcast to a
more specific type.
An implementation of Element that represents a leaf
in a tree structure should return false from this
method. An implementation of Element that could
represent a non-leaf in a tree structure should return
true from this method, even if it does not currently
contain any children.
mayHaveChildren in interface Elementtrue if this Element may contain
child Elements.public java.util.Iterator<Element> getChildren()
ElementElement interface to
provide a convenient way of getting an Iterator over any
contained child Elements without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type.
An implementation of Element that represents a leaf
in a tree structure should return null from this
method. An implementation of Element that could
represent a non-leaf in a tree structure should return either an
Iterator over the child Elements or
null if there are no children.
getChildren in interface ElementIterator over any child Elements
contained by this Element. If there are no children,
null is returned.public Attributes getAttributes()
ElementAttributes object that encodes the
attributes of the Element. Changing the attribute
settings on the return object changes the element attributes.
Subclasses should use their super class attributes object to
define their own attributes. This allows subclasses to
inherit their super class attributes. If a subclass does not
wish to inherit attributes, they should first call
getAttributes().clear() and define new attributes.getAttributes in interface Elementpublic javax.swing.Icon getIcon()
DisplayableIcon that can be shown in association with this
Displayable. Typically the icon will be used in a
tree control or list control. Therefore the icon must fit
naturally within the space normally given to items within those
controls. Such icons are usually 16x16 in size or, if there is a
one-pixel transparent padding around the edge, 18x18 in size. It
is strongly recommended that icons returned by this method be
either 16x16 or 18x18 in size. If null is returned,
the control may show a default icon, or it may show no icon,
whichever is appropriate.getIcon in interface DisplayableIcon to be displayed for the
Displayable.public java.lang.String getToolTipText()
DisplayableDisplayable.
In many cases it may be appropriate for this method to return the
same value as Displayable.getLongLabel().getToolTipText in interface DisplayableDisplayable.public java.lang.String getLongLabel()
DisplayableString is considered translatable
and should therefore be placed in an appropriate resource file.
The long label differs from the short label essentially on length.
Usually the long label will only be shown on-demand and in places
where horizontal space is more available. Examples are the status
bar and tooltips.getLongLabel in interface DisplayableDisplayable that
can be shown to the user.public void setPlatform(Platform platform)
public Platform getPlatform()
public void setContext(Context originalContext)
CommandsetContext in class Commandpublic int getSequenceId()
public void setCallback(DeployCommand.Callback callback)
public DeployCommand.Status getStatus()
protected void updateStatus()
protected DeployCommandState newState()
protected DeployCommandState newState(HashStructure hash)
protected abstract java.lang.Class<? extends DeployCommandState> getStateClass()
protected void setStatus(DeployCommand.Status status)
protected abstract boolean isReady()
public int doit()
throws java.lang.Exception
Commandpublic Runnable createRunnable() throws DeployException
DeployExceptionprotected void prepare(DeployShell shell)
DeployShell. The default version transfers the Platform
if it has been set.
Use a wrapper to configure the shell.
shell - ShellAdapterprotected void deploy(DeployShell shell) throws java.lang.Exception
java.lang.Exceptionprotected void exception(java.lang.Exception e,
DeployShell shell)
e - shell - protected void finished(DeployShell shell)
shell - protected DeployShellFactory getDeployShellFactory()
protected DeployCommandState state()
public abstract java.lang.String getShortLabel()
DisplayableString is considered
translatable and should therefore be placed in an appropriate
resource file. When possible, the returned label should be
reasonably short enough to show in the navigator or explorer
windows but long enough to clearly identify and distinguish the
Displayable.getShortLabel in interface DisplayableDisplayable
that can be shown to the user.public DeployCommandState getState()
public boolean isSynchronous()
public void setSynchronous(boolean sync)
sync - set to true to run on current threadpublic void setState(DeployCommandState state)
public <T extends DeploymentOptions> T getDeploymentOptions(java.lang.Class<T> optionsClass)
public <T extends DeploymentOptions> void setDeploymentOptions(T options)
@Deprecated public static DeployCommand create(HashStructure hash)