|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines a view to manipulate rich documents. A default implementation is provided
as DefaultRichDocumentView
. The view is used to start supported
rich document operations. It allows adding listeners into the view which
are notified when an operation is started.
DefaultRichDocumentView
. Use
the interface to access the view, instead of using the DefaultRichDocumentView
class directly.
DefaultRichDocumentView
,
Operation
,
OperationListener
Method Summary | |
---|---|
void |
addOperationListener(OperationListener listener)
Adds an OperationListener into the view. |
void |
executeOperation(Operation operation)
Starts the operation in the view. |
java.lang.Object |
getUNOModel()
Returns the com.sun.star.frame.XModel object when the operation is started. |
void |
removeOperationListener(OperationListener listener)
Removes a registered OperationListener from the view. |
Method Detail |
public void executeOperation(Operation operation) throws java.lang.UnsupportedOperationException
operation
- - The operation to be started
java.lang.UnsupportedOperationException
- - If an error occurs while running the operation.Operation
public void addOperationListener(OperationListener listener)
OperationListener
into the view. If an operation is invoked,
the listener is notified.
listener
- - A listener to be notified when an operation is started.OperationListener
public void removeOperationListener(OperationListener listener)
OperationListener
from the view.
listener
- - The listener to be removedOperationListener
public java.lang.Object getUNOModel()
The following code demonstrates how to use the UNO model:
private void createTable( ) throws Exception {
NewOperation operation = ...;
Object obj = operation.getUNOModel();
XMultiServiceFactory factory = (XMultiServiceFactory) UnoRuntime
.queryInterface(XMultiServiceFactory.class, obj);
XTextDocument textDoc = (XTextDocument) UnoRuntime.queryInterface(
XTextDocument.class, obj);
obj = factory.createInstance("com.sun.star.text.TextTable");
XTextTable table = (XTextTable) UnoRuntime.queryInterface(
XTextTable.class, obj);
table.initialize(10, 10);
textDoc.getText().insertTextContent(textDoc.getText().getStart(),
table, false);
}
|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |