Re: [jopendocument] src/org/jopendocument/examples/SimpleOdt2.java

2013-08-01 Thread Sylvain Cuaz

Le 24/07/2013 09:50, Gmail a écrit :

Hi,

ok fine,

This code does not work anymore :

ODPackage outputDocument = new ODPackage(new File(styles.odt));
contentDom = outputDocument.toSingle();
final Paragraph paragraph = new Paragraph();
contentDom.add(paragraph);

What is the correct way to do it in version 1.3 ?


The add() method is now in TextDocument. So your second line should be

TextDocument contentDom = outputDocument.getTextDocument();


HTH,
Sylvain

--

--- 
You received this message because you are subscribed to the Google Groups jOpenDocument group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[jopendocument] src/org/jopendocument/examples/SimpleOdt2.java

2013-07-23 Thread yambo
Hi,

When I try to compile src/org/jopendocument/examples/SimpleOdt2.java with 
the version 1.3 this fails, compiling with 1.2 seems to work. 
I am using java 1.7.0.17.
What am I doing wrong ?

kind regards

willy

Errors :
javac src/org/jopendocument/examples/SimpleOdt2.java 
src/org/jopendocument/examples/SimpleOdt2.java:72: error: cannot find symbol
heading.setStyle(Movie_20_Heading);
   ^
  symbol:   method setStyle(String)
  location: variable heading of type Heading
src/org/jopendocument/examples/SimpleOdt2.java:76: error: no suitable 
method found for add(Heading)
contentDom.add(heading);
  ^
method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable
  (actual argument Heading cannot be converted to ODSingleXMLDocument 
by method invocation conversion)
method 
ODXMLDocument.add(IFactoryElement,int,ODXMLDocument,String,ElementTransformer)
 
is not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
src/org/jopendocument/examples/SimpleOdt2.java:88: error: cannot find symbol
paragraph.setStyle(Synopsis_20_Para);
 ^
  symbol:   method setStyle(String)
  location: variable paragraph of type Paragraph
src/org/jopendocument/examples/SimpleOdt2.java:90: error: no suitable 
method found for add(Paragraph)
contentDom.add(paragraph);
  ^
method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable
  (actual argument Paragraph cannot be converted to ODSingleXMLDocument 
by method invocation conversion)
method 
ODXMLDocument.add(IFactoryElement,int,ODXMLDocument,String,ElementTransformer)
 
is not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
src/org/jopendocument/examples/SimpleOdt2.java:99: error: cannot find symbol
heading.setStyle(Cast_20_Heading);
   ^
  symbol:   method setStyle(String)
  location: variable heading of type Heading
src/org/jopendocument/examples/SimpleOdt2.java:100: error: no suitable 
method found for add(Heading)
contentDom.add(heading);
  ^
method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument) is not applicable
  (actual argument Heading cannot be converted to ODSingleXMLDocument 
by method invocation conversion)
method 
ODXMLDocument.add(IFactoryElement,int,ODXMLDocument,String,ElementTransformer)
 
is not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(Element,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
method 
ODXMLDocument.add(String,int,ODXMLDocument,String,ElementTransformer) is 
not applicable
  (actual and formal argument lists differ in length)
src/org/jopendocument/examples/SimpleOdt2.java:109: error: cannot find 
symbol
actor.setStyle(Cast_20_Para);
 ^
  symbol:   method setStyle(String)
  location: variable actor of type Paragraph
src/org/jopendocument/examples/SimpleOdt2.java:115: error: no suitable 
method found for add(Paragraph)
contentDom.add(actor);
  ^
method ODSingleXMLDocument.add(Element,int,ODSingleXMLDocument) is not 
applicable
  (actual and formal argument lists differ in length)
method ODSingleXMLDocument.add(ODSingleXMLDocument,boolean) is not 
applicable
  (actual and formal argument lists differ in length)
method