|
||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defines the operation to create a new document in a rich document view. The current document is closed before the creation.
See DefaultRichDocumentView
on how to use the operation.
Method Summary | |
---|---|
RichDocumentType |
getType()
Gets the document type to be created. |
java.lang.Object |
getUNOModel()
Returns the com.sun.star.frame.XModel object when the operation is started. |
void |
setType(RichDocumentType type)
Sets the document type to be created. |
Method Detail |
public RichDocumentType getType()
RichDocumentType
public void setType(RichDocumentType type)
type
- RichDocumentType
public java.lang.Object getUNOModel()
The following example 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 |