|
UndoRedo V1.2 by Matthew Ford 2005/06/27 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface IHaveDescription
This interface indicates that the UndoableEdit has a long description that gives more information then the getPresentationName()
| Method Summary | |
|---|---|
void |
cancelGetDescription()
Cancels getDescription(au.com.forward.undoRedo.IDisplayText, au.com.forward.undoRedo.UndoRedoTreeNode). |
void |
getDescription(IDisplayText textDisplay,
UndoRedoTreeNode undoRedoTreeNode)
Gets the Description of the UndoableEdit. |
| Method Detail |
|---|
void getDescription(IDisplayText textDisplay,
UndoRedoTreeNode undoRedoTreeNode)
cancelGetDescription() is called when the selection
changes and the text is no longer needed.
A possiable implementation is:-
volatile Thread loadThread = null;
volatile boolean interrupted = false;
public void getDescription(IDisplayText textDisplay, boolean ) {
interrupted = false;
textDisplay.setText("Loading description...");
final IDisplayText display = textDisplay;
Thread loadThread = new Thread(new Runnable() {
public void run() {
if (interrupted) {
// got interrupt befor we could start.
// add more tests like this one to stop the thread promptly on interrupt()
return;
}
try {
// create description here checking interrupted every so often
display.setText(description);
} catch (Throwable t) {
try {
display.setText("Error getting description.\n"+t.getMessage());
} catch(Throwable tt) {
// log this serious error somewhere...
}
}
}
});
loadThread.start();
}
public void cancelGetDescription() {
interrupted = true;
if (loadThread != null) {
loadThread.interrupt();
}
}
void cancelGetDescription()
getDescription(au.com.forward.undoRedo.IDisplayText, au.com.forward.undoRedo.UndoRedoTreeNode).
|
©2005, Forward Computing and Control Pty. Ltd ACN 003 669 994 NSW Australia All Rights Reserved. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||