|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.netbeans.lib.cvsclient.command.Command
public abstract class Command
All commands must extend this class. A command is essentially a
collection of requests that make up what is logically known as a CVS
command (from a user's perspective). Commands correspond to operations the
user can perform with CVS, for example checkout a module or perform a
diff on two file versions.
Commands are automatically added as CVS event listeners. They can act
on particular events and perhaps fire new events.
Field Summary | |
---|---|
protected java.lang.String |
localDirectory
The local directory from which the command is being run. |
Constructor Summary | |
---|---|
Command()
|
Method Summary | |
---|---|
java.lang.Object |
clone()
This method just calls the Object.clone() and makes it public. |
void |
commandTerminated(TerminationEvent e)
Called when server responses with "ok" or "error", (when the command finishes). |
void |
execute(ClientServices client,
EventManager eventManager)
Execute this command. |
void |
fileAdded(FileAddedEvent e)
Called when a file has been added. |
void |
fileInfoGenerated(FileInfoEvent e)
Called when file status information has been received. |
void |
fileRemoved(FileRemovedEvent e)
Called when a file is removed. |
void |
fileToRemove(FileToRemoveEvent e)
Called when a file is going to be removed. |
void |
fileUpdated(FileUpdatedEvent e)
Called when a file has been updated. |
abstract java.lang.String |
getCVSArguments()
Returns the arguments of the command in the command-line style. |
abstract java.lang.String |
getCVSCommand()
This method returns how the command would looklike when typed on the command line. |
java.lang.String |
getDisplayName()
Returns localized name describing command purpose or null . |
GlobalOptions |
getGlobalOptions()
Get the global options. |
java.lang.String |
getLocalDirectory()
Returns the local path the command is associated with. |
java.lang.String |
getLocalPath()
Deprecated. Please use the getLocalDirectory() method instead. |
abstract java.lang.String |
getOptString()
Returns a String that defines which options are available for this particular command. |
java.lang.String |
getRelativeToLocalPathInUnixStyle(java.io.File file)
Returns the relative path of the specified file (relative to the set local path). |
protected static java.lang.String |
getTrimmedString(java.lang.String s)
Returns the trimmed version of the specified String s. |
boolean |
hasFailed()
|
void |
messageSent(BinaryMessageEvent e)
Called when the server wants to send a binary message to be displayed to the user. |
void |
messageSent(MessageEvent e)
Called when the server wants to send a message to be displayed to the user. |
void |
moduleExpanded(ModuleExpansionEvent e)
This is called when the servers has responded to an expand-modules request. |
abstract void |
resetCVSCommand()
Resets all switches in the command to the default behaviour. |
abstract boolean |
setCVSCommand(char opt,
java.lang.String optArg)
Takes the arguments and sets the command. |
void |
setDisplayName(java.lang.String name)
Defines prefered display name or null . |
protected void |
setLocalDirectory(java.lang.String localDirectory)
Sets the local directory for the command. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String localDirectory
Constructor Detail |
---|
public Command()
Method Detail |
---|
public void execute(ClientServices client, EventManager eventManager) throws CommandException, CommandAbortedException, AuthenticationException
client
- the client services object that provides any necessary
services to this command, including the ability to actually
process all the requestse
- the event manager. The command can use this to fire events
if necessary - for example, while parsing status responses.
CommandException
CommandAbortedException
AuthenticationException
public abstract java.lang.String getCVSCommand()
public abstract java.lang.String getCVSArguments()
public abstract boolean setCVSCommand(char opt, java.lang.String optArg)
public abstract void resetCVSCommand()
public abstract java.lang.String getOptString()
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean hasFailed()
public void messageSent(MessageEvent e)
messageSent
in interface CVSListener
e
- the eventpublic void messageSent(BinaryMessageEvent e)
CVSListener
messageSent
in interface CVSListener
e
- the eventpublic void fileAdded(FileAddedEvent e)
fileAdded
in interface CVSListener
e
- the eventpublic void fileToRemove(FileToRemoveEvent e)
fileToRemove
in interface CVSListener
e
- the eventpublic void fileRemoved(FileRemovedEvent e)
fileRemoved
in interface CVSListener
e
- the eventpublic void fileUpdated(FileUpdatedEvent e)
fileUpdated
in interface CVSListener
e
- the eventpublic void fileInfoGenerated(FileInfoEvent e)
fileInfoGenerated
in interface CVSListener
public void commandTerminated(TerminationEvent e)
commandTerminated
in interface CVSListener
public void moduleExpanded(ModuleExpansionEvent e)
moduleExpanded
in interface CVSListener
public final java.lang.String getLocalDirectory()
public final java.lang.String getLocalPath()
public final GlobalOptions getGlobalOptions()
public final java.lang.String getRelativeToLocalPathInUnixStyle(java.io.File file)
protected final void setLocalDirectory(java.lang.String localDirectory)
protected static final java.lang.String getTrimmedString(java.lang.String s)
public void setDisplayName(java.lang.String name)
null
.
Localized string should highlight command purpose (use verb in gerund).
E.g. UpdateCommand
used to refresh statuses should
be named "Refreshing Status" rather than "cvs -N update",
"Updating" or "Status Refresh".
public java.lang.String getDisplayName()
null
.
getCVSCommand()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |