|
||||||||||||
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
- the document's typeRichDocumentType
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();
com.sun.star.lang.XMultiServiceFactory factory = (com.sun.star.lang.XMultiServiceFactory)
UnoRuntime.queryInterface(com.sun.star.lang.XMultiServiceFactory.class, obj);
com.sun.star.text.XTextDocument textDoc = (com.sun.star.text.XTextDocument)
UnoRuntime.queryInterface(com.sun.star.text.XTextDocument.class, obj);
obj = factory.createInstance("com.sun.star.text.TextTable");
com.sun.star.text.XTextTable table = (com.sun.star.text.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 |