[api-dev] How to insert and remove annotation?

2005-05-30 Thread Liao Yu
Hi,
We can hide and show annotations in a text document via OOo 
API, but how can we insert or remove one with API?

Regards,


Yu

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-05-31 Thread Paolo Mantovani
Hi Liao Yu,

Alle 07:44, martedì 31 maggio 2005, Liao Yu ha scritto:
> We can hide and show annotations in a text document via OOo
How? can you show the code?


> API, but how can we insert or remove one with API?
Please, see the code snippet I've just sent

ciao
Paolo M

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-05-31 Thread Liao Yu
Hi Paolo,

Actually there's a service com.sun.star.text.ViewSettings, 
with boolean property ShowAnnotations, which controls the 
visibility of annotations. You can access to ViewSettings 
with com.sun.star.view.XViewSettingsSupplier.getViewSettings
(). You can refer to section 7.5 of DevelopersGuide for 
details. 

Regards,

Yu

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-05-31 Thread Andrew Douglas Pitonyak
Liao Yu wrote:

>Hi,
>We can hide and show annotations in a text document via OOo 
>API, but how can we insert or remove one with API?
>
>Regards,
>
>
>Yu
>  
>
An annotation is just a text field, you can remove it as any other text
field.

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-05-31 Thread Liao Yu
Thanks, Andrew. 
There's one thing strange that I couldn't find the package 
textfield in module com.sun.star.text of unoil.jar. Anyone 
has any idea?

Regards,

Yu
--原邮件---
Liao Yu wrote:

>Hi,
>We can hide and show annotations in a text document via 
OOo 
>API, but how can we insert or remove one with API?
>
>Regards,
>
>
>Yu
>  
>
An annotation is just a text field, you can remove it as 
any other text
field.

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.sxw
My Macro Book: http://www.hentzenwerke.com/catalog/oome.htm
Free Info:  http://www.pitonyak.org/oo.php



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-01 Thread Stephan Bergmann

Liao Yu wrote:
Thanks, Andrew. 
There's one thing strange that I couldn't find the package 
textfield in module com.sun.star.text of unoil.jar. Anyone 
has any idea?


It appears that the UNOIDL module com.sun.star.text.textfield (CVS 
module offapi) only contains old-style services (and another module, 
com.sun.star.text.textfield.docinfo, which in turn also only contains 
old-style services).  There is no representation of old-style UNOIDL 
services and of UNOIDL modules in the Java UNO langugage binding, and 
hence there is no Java package com.sun.star.text.textfield in unoil.jar.


-Stephan


Regards,

Yu

[...]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-01 Thread Liao Yu
Thanks, Stephan.
So the package com.sun.star.text.textfield is not available 
in Java. Then do we have the chance to insert an annotation 
or other textfield via Java? If we do, how? Thank you in 
advance.

Regards,

Yu
--原邮件---
Liao Yu wrote:
> Thanks, Andrew. 
> There's one thing strange that I couldn't find the 
package 
> textfield in module com.sun.star.text of unoil.jar. 
Anyone 
> has any idea?

It appears that the UNOIDL module 
com.sun.star.text.textfield (CVS 
module offapi) only contains old-style services (and 
another module, 
com.sun.star.text.textfield.docinfo, which in turn also 
only contains 
old-style services).  There is no representation of old-
style UNOIDL 
services and of UNOIDL modules in the Java UNO langugage 
binding, and 
hence there is no Java package com.sun.star.text.textfield 
in unoil.jar.

-Stephan

> Regards,
> 
> Yu
[...]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-01 Thread Stephan Bergmann

Liao Yu wrote:

Thanks, Stephan.
So the package com.sun.star.text.textfield is not available 
in Java. Then do we have the chance to insert an annotation 
or other textfield via Java? If we do, how? Thank you in 
advance.


That there is no Java package com.sun.star.text.textfield does not mean 
that the (old-style) UNO services from the UNO module 
com.sun.star.text.textfield are not available in Java.  They can be used 
just the same way as any other (old-style) UNO services---no 
corresponding Java classes are either available or necessary.


Sorry, I have no idea how code would look like that inserts an 
annotation into a document.  Hopefully, someone who knows more about the 
OOo writer API can help you.


-Stephan


Regards,

Yu
--原邮件---
Liao Yu wrote:

Thanks, Andrew. 
There's one thing strange that I couldn't find the 


package 

textfield in module com.sun.star.text of unoil.jar. 


Anyone 


has any idea?



It appears that the UNOIDL module 
com.sun.star.text.textfield (CVS 
module offapi) only contains old-style services (and 
another module, 
com.sun.star.text.textfield.docinfo, which in turn also 
only contains 
old-style services).  There is no representation of old-
style UNOIDL 
services and of UNOIDL modules in the Java UNO langugage 
binding, and 
hence there is no Java package com.sun.star.text.textfield 
in unoil.jar.


-Stephan



Regards,

Yu


[...]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-01 Thread Jürgen Schmidt

Stephan Bergmann wrote:

Liao Yu wrote:


Thanks, Stephan.
So the package com.sun.star.text.textfield is not available in Java. 
Then do we have the chance to insert an annotation or other textfield 
via Java? If we do, how? Thank you in advance.



That there is no Java package com.sun.star.text.textfield does not mean 
that the (old-style) UNO services from the UNO module 
com.sun.star.text.textfield are not available in Java.  They can be used 
just the same way as any other (old-style) UNO services---no 
corresponding Java classes are either available or necessary.


Sorry, I have no idea how code would look like that inserts an 
annotation into a document.  Hopefully, someone who knows more about the 
OOo writer API can help you.


you should take a look into the Developer's Guide, chapter "Text 
Documents" and/or the Text example in the SDK.


Juergen



-Stephan


Regards,

Yu
--原邮件---
Liao Yu wrote:

Thanks, Andrew. There's one thing strange that I couldn't find the 



package

textfield in module com.sun.star.text of unoil.jar. 



Anyone


has any idea?




It appears that the UNOIDL module com.sun.star.text.textfield (CVS 
module offapi) only contains old-style services (and another module, 
com.sun.star.text.textfield.docinfo, which in turn also only contains 
old-style services).  There is no representation of old-
style UNOIDL services and of UNOIDL modules in the Java UNO langugage 
binding, and hence there is no Java package 
com.sun.star.text.textfield in unoil.jar.


-Stephan



Regards,

Yu



[...]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-01 Thread Liao Yu
Here is the code that I wrote to insert an annotation, 
referring to the example in section 7.3.5 of Developer's 
Guide:
...
try {
com.sun.star.text.XTextField aNote= 
(com.sun.star.text.XTextField)UnoRuntime.queryInterface
(XTextField.class, xMSF.createInstance
("com.sun.star.text.textfield.Annotation"));
xText.insertTextContent(xText.getEnd(),  
aNote,  true);

}
catch(com.sun.star.uno.Exception e){
System.out.println("111");
}
...
However, what I get is no more than the 
com.sun.star.uno.Exception that createInstance() throws. 
Could anyone please tell me what's going wrong with that 
piece of code? Thank you!

Regards,

Yu

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-02 Thread Jürgen Schmidt
Hi,

which service factory do you use? Is xMSF the global service factory or
the text document factory. Not all services can be instantiated at the
global service factory (service manager). Query your text document
object for XMultiServiceFactory and use this interface to create the
text field.

Juergen

Liao Yu wrote:
> Here is the code that I wrote to insert an annotation, 
> referring to the example in section 7.3.5 of Developer's 
> Guide:
> ...
> try {
> com.sun.star.text.XTextField aNote= 
> (com.sun.star.text.XTextField)UnoRuntime.queryInterface
> (XTextField.class, xMSF.createInstance
> ("com.sun.star.text.textfield.Annotation"));
> xText.insertTextContent(xText.getEnd(),  
> aNote,  true);
> 
> }
> catch(com.sun.star.uno.Exception e){
> System.out.println("111");
> }
> ...
> However, what I get is no more than the 
> com.sun.star.uno.Exception that createInstance() throws. 
> Could anyone please tell me what's going wrong with that 
> piece of code? Thank you!
> 
> Regards,
> 
> Yu
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-05 Thread Liao Yu
Hi Juergen,
Is there any difference between a global service factory 
and a text document factory? I opened the text document 
from that xMSF multiservice factory, so I guess it's a 
global one. Would you be so kind to tell me how to query a 
text ducument object for XMultiServiceFactory  from a 
XTextDocument? Thank you!

Regards,

Yu


--原邮件---
Hi,

which service factory do you use? Is xMSF the global 
service factory or
the text document factory. Not all services can be 
instantiated at the
global service factory (service manager). Query your text 
document
object for XMultiServiceFactory and use this interface to 
create the
text field.

Juergen

Liao Yu wrote:
> Here is the code that I wrote to insert an annotation, 
> referring to the example in section 7.3.5 of Developer's 
> Guide:
> ...
> try {
> com.sun.star.text.XTextField aNote= 
> (com.sun.star.text.XTextField)UnoRuntime.queryInterface
> (XTextField.class, xMSF.createInstance
> ("com.sun.star.text.textfield.Annotation"));
> xText.insertTextContent(xText.getEnd(),  
> aNote,  true);
> 
> }
> catch(com.sun.star.uno.Exception e){
> System.out.println("111");
> }
> ...
> However, what I get is no more than the 
> com.sun.star.uno.Exception that createInstance() throws. 
> Could anyone please tell me what's going wrong with that 
> piece of code? Thank you!
> 
> Regards,
> 
> Yu
> 
> --
---
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: dev-
[EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-05 Thread Liao Yu
I got the XMultiServiceFactory of the text document with:
XMultiServiceFactory cMSF= (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, 
myDoc);
where myDoc is a XTextDocument. But this did not make any 
difference. It seems that things go wrong at 
xMSF.createInstance
("com.sun.star.text.textfield.Annotation"), where a 
com.sun.star.uno.Exception is caught. Any idea? Thank you 
in advance!

Regards,

Yu

--原邮件---
Hi,

which service factory do you use? Is xMSF the global 
service factory or
the text document factory. Not all services can be 
instantiated at the
global service factory (service manager). Query your text 
document
object for XMultiServiceFactory and use this interface to 
create the
text field.

Juergen

Liao Yu wrote:
> Here is the code that I wrote to insert an annotation, 
> referring to the example in section 7.3.5 of Developer's 
> Guide:
> ...
> try {
> com.sun.star.text.XTextField aNote= 
> (com.sun.star.text.XTextField)UnoRuntime.queryInterface
> (XTextField.class, xMSF.createInstance
> ("com.sun.star.text.textfield.Annotation"));
> xText.insertTextContent(xText.getEnd(),  
> aNote,  true);
> 
> }
> catch(com.sun.star.uno.Exception e){
> System.out.println("111");
> }
> ...
> However, what I get is no more than the 
> com.sun.star.uno.Exception that createInstance() throws. 
> Could anyone please tell me what's going wrong with that 
> piece of code? Thank you!
> 
> Regards,
> 
> Yu
> 
> --
---
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: dev-
[EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-06 Thread Jürgen Schmidt
Hi,

it seems to be a documentation problem.
In IDL it is "com.sun.star.textfield.Annotation" but in real life you
have to use "com.sun.star.text.TextField.Annotation".
That is of course a bug and we will clean up the IDL as well as the
implementation for a future version (probably not OO 2.0). For
compatibility reasons we will support ...text.textfield,
...text.TextField, ...text.fieldmaster and ...text.FieldMaster.

issue 50350

Juergen


Liao Yu wrote:
> I got the XMultiServiceFactory of the text document with:
> XMultiServiceFactory cMSF= (XMultiServiceFactory)
> UnoRuntime.queryInterface(XMultiServiceFactory.class, 
> myDoc);
> where myDoc is a XTextDocument. But this did not make any 
> difference. It seems that things go wrong at 
> xMSF.createInstance
> ("com.sun.star.text.textfield.Annotation"), where a 
> com.sun.star.uno.Exception is caught. Any idea? Thank you 
> in advance!
> 
> Regards,
> 
> Yu
> 
> --原邮件---
> Hi,
> 
> which service factory do you use? Is xMSF the global 
> service factory or
> the text document factory. Not all services can be 
> instantiated at the
> global service factory (service manager). Query your text 
> document
> object for XMultiServiceFactory and use this interface to 
> create the
> text field.
> 
> Juergen
> 
> Liao Yu wrote:
> 
>>Here is the code that I wrote to insert an annotation, 
>>referring to the example in section 7.3.5 of Developer's 
>>Guide:
>>...
>>try {
>>com.sun.star.text.XTextField aNote= 
>>(com.sun.star.text.XTextField)UnoRuntime.queryInterface
>>(XTextField.class, xMSF.createInstance
>>("com.sun.star.text.textfield.Annotation"));
>>xText.insertTextContent(xText.getEnd(),  
>>aNote,  true);
>>
>>}
>>catch(com.sun.star.uno.Exception e){
>>System.out.println("111");
>>}
>>...
>>However, what I get is no more than the 
>>com.sun.star.uno.Exception that createInstance() throws. 
>>Could anyone please tell me what's going wrong with that 
>>piece of code? Thank you!
>>
>>Regards,
>>
>>Yu
>>
>>--
> 
> ---
> 
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: dev-
> 
> [EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [api-dev] How to insert and remove annotation?

2005-06-06 Thread Liao Yu
I've just changed the 2 letters into upper case and the 
annotation came out at last! Thank you, Juergen.

REgards,

Yu

--原邮件---
Hi,

it seems to be a documentation problem.
In IDL it is "com.sun.star.textfield.Annotation" but in 
real life you
have to use "com.sun.star.text.TextField.Annotation".
That is of course a bug and we will clean up the IDL as 
well as the
implementation for a future version (probably not OO 2.0). 
For
compatibility reasons we will support ...text.textfield,
...text.TextField, ...text.fieldmaster 
and ...text.FieldMaster.

issue 50350

Juergen


Liao Yu wrote:
> I got the XMultiServiceFactory of the text document with:
> XMultiServiceFactory cMSF= (XMultiServiceFactory)
> UnoRuntime.queryInterface(XMultiServiceFactory.class, 
> myDoc);
> where myDoc is a XTextDocument. But this did not make any 
> difference. It seems that things go wrong at 
> xMSF.createInstance
> ("com.sun.star.text.textfield.Annotation"), where a 
> com.sun.star.uno.Exception is caught. Any idea? Thank you 
> in advance!
> 
> Regards,
> 
> Yu
> 
> --原邮件---
> Hi,
> 
> which service factory do you use? Is xMSF the global 
> service factory or
> the text document factory. Not all services can be 
> instantiated at the
> global service factory (service manager). Query your text 
> document
> object for XMultiServiceFactory and use this interface to 
> create the
> text field.
> 
> Juergen
> 
> Liao Yu wrote:
> 
>>Here is the code that I wrote to insert an annotation, 
>>referring to the example in section 7.3.5 of Developer's 
>>Guide:
>>...
>>try {
>>com.sun.star.text.XTextField aNote= 
>>(com.sun.star.text.XTextField)UnoRuntime.queryInterface
>>(XTextField.class, xMSF.createInstance
>>("com.sun.star.text.textfield.Annotation"));
>>xText.insertTextContent(xText.getEnd(),  
>>aNote,  true);
>>
>>}
>>catch(com.sun.star.uno.Exception e){
>>System.out.println("111");
>>}
>>...
>>However, what I get is no more than the 
>>com.sun.star.uno.Exception that createInstance() throws. 
>>Could anyone please tell me what's going wrong with that 
>>piece of code? Thank you!
>>
>>Regards,
>>
>>Yu
>>
>>--
> 
> ---
> 
>>To unsubscribe, e-mail: [EMAIL PROTECTED]
>>For additional commands, e-mail: dev-
> 
> [EMAIL PROTECTED]
> 
> 
> --
--
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: dev-
[EMAIL PROTECTED]
> 
> 
> 
> --
---
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: dev-
[EMAIL PROTECTED]
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]