|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This is the class that is notified when an operation is invoked in a
RichDocumentView
.
A user can implement a listener and add it into a RichDocumentView
.
NewOperation
, LoadOperation
and CloseOperation
won't be fired by RichDocumentView
. Those events are be provided by the
com.ibm.productivity.tools.ui.views.listener extension point.
The following code demonstrates how to monitor the start of an operation.
private void monitorLoading()
{
RichDocumentView view = this;
OperationListener listener = new OperationListener()
{
public void afterExecute(Operation operation, RichDocumentView view) {
if( operation instanceof LoadOperation )
{
System.out.println( "document is loaded:"
+ ( (LoadOperation)operation ).getFileName());
}
}
public void beforeExecute(Operation operation, RichDocumentView view) {
if( operation instanceof LoadOperation )
System.out.println( "document is about to be loaded:"
+ ( (LoadOperation)operation ).getFileName());
}
};
view.addOperationListener( listener );
}
RichDocumentView.addOperationListener(OperationListener)
,
RichDocumentView.removeOperationListener(OperationListener)
,
Operation
Method Summary | |
---|---|
void |
afterExecute(Operation operation,
RichDocumentView view)
The method is called after the operation is started. |
void |
beforeExecute(Operation operation,
RichDocumentView view)
The method is called before the operation is started. |
Method Detail |
public void beforeExecute(Operation operation, RichDocumentView view)
SaveOperation
and SaveAsOperation
never fire
this event.
operation
- the operation to be started.view
- the rich document view to start the operation.RichDocumentView
public void afterExecute(Operation operation, RichDocumentView view)
operation
- the operation is started.view
- the rich document view that started the operation.
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |