|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.swing.visuals.util.ChangeCursorCommand
public class ChangeCursorCommand
A command for changing a component's cursor. The command may be executed any number of times with different components and supports undo, and thus provides an easy way to temporarily change the cursor for a set of components. For example,
// create command to set busy cursor
ChangeCursorCommand cmd = new ChangeCursorCommand (
Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// apply the command to our container and all its children
com.sas.swing.visuals.util.Util.apply (container, cmd);
// do some work
[...]
// restore the container and its children back to their original cursors
cmd.undoAll ();
CompositeCommand
,
ChangeEnabledStateCommand
,
DisableCommand
,
Util.apply(java.awt.Component, com.sas.util.ApplyInterface)
Field Summary |
---|
Fields inherited from interface com.sas.util.ApplyInterface |
---|
ABORT, CONTINUE |
Constructor Summary | |
---|---|
ChangeCursorCommand(java.awt.Cursor cursor)
Constructor. |
Method Summary | |
---|---|
int |
apply(java.lang.Object obj)
Alias for execute(obj) . |
java.lang.Object |
clone()
Clones this command. |
void |
execute(java.lang.Object obj)
Changes the cursor for a given component. |
java.awt.Cursor |
getCursor()
Returns the cursor that this command uses. |
java.lang.String |
getText()
Placeholder to satisy interface requirements. |
boolean |
isExecutable()
Returns true since this command is executable. |
boolean |
isUndoable()
Returns true since this command is undoable. |
void |
setText(java.lang.String text)
Placeholder to satisy interface requirements; does nothing. |
void |
undo()
Undoes the most recent cursor change, if any. |
void |
undoAll()
Undoes all cursor changes, if any. |
Constructor Detail |
---|
public ChangeCursorCommand(java.awt.Cursor cursor)
cursor
- the cursor to change to when executedgetCursor()
,
execute(java.lang.Object)
Method Detail |
---|
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in interface com.sas.PublicClonable
clone
in interface com.sas.util.Command
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- this class supports cloning, but a subclass may notpublic java.awt.Cursor getCursor()
public boolean isExecutable()
true
since this command is executable.
isExecutable
in interface com.sas.util.Command
true
execute(java.lang.Object)
public void execute(java.lang.Object obj)
execute
in interface com.sas.util.SimpleCommand
obj
- must be an instance of java.awt.Component
undo()
public int apply(java.lang.Object obj)
execute(obj)
.
apply
in interface com.sas.util.ApplyInterface
obj
- must be an instance of java.awt.Component
ApplyInterface.CONTINUE
execute(java.lang.Object)
public boolean isUndoable()
true
since this command is undoable.
isUndoable
in interface com.sas.util.Command
true
undo()
public void undo()
undo
in interface com.sas.util.Command
execute(java.lang.Object)
,
undoAll()
public void undoAll()
undo()
public java.lang.String getText()
getText
in interface com.sas.lang.StringDataInterface
setText(java.lang.String)
public void setText(java.lang.String text)
setText
in interface com.sas.lang.StringDataInterface
getText()
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |