incubator-odf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From devin...@apache.org
Subject svn commit: r1165478 [1/3] - in /incubator/odf/site/trunk/content/odftoolkit/simple: ./ demo/scripts/ demo/styles/ document/ document/cookbook/ document/javadoc/ javadoc/
Date Tue, 06 Sep 2011 02:09:28 GMT
Author: devinhan
Date: Tue Sep  6 02:09:27 2011
New Revision: 1165478

URL: http://svn.apache.org/viewvc?rev=1165478&view=rev
Log:
update directory structure, add cookbook

Added:
    incubator/odf/site/trunk/content/odftoolkit/simple/document/
    incubator/odf/site/trunk/content/odftoolkit/simple/document/APIChangesFrom086.mdtext
      - copied unchanged from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/APIChangesFrom086.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/PackageLayer.mdtext
      - copied unchanged from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/PackageLayer.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/ProjectRoadmap.mdtext
      - copied unchanged from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/ProjectRoadmap.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/ReleaseNotes.mdtext
      - copied unchanged from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/ReleaseNotes.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/Requirements.mdtext
      - copied unchanged from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/Requirements.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Charts.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Fields.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell Range.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Presentation.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Slide.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Table.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Text Document.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate TextSearch.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Presentation Document.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Slide.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Style Handling.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Table.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Text Document.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/TextExtractor.html
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/cookbook.css
    incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/index.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/index.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/document/javadoc/
      - copied from r1163976, incubator/odf/site/trunk/content/odftoolkit/simple/javadoc/
Modified:
    incubator/odf/site/trunk/content/odftoolkit/simple/APIChangesFrom086.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/PackageLayer.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/ProjectRoadmap.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/ReleaseNotes.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/Requirements.mdtext
    incubator/odf/site/trunk/content/odftoolkit/simple/demo/scripts/
    incubator/odf/site/trunk/content/odftoolkit/simple/demo/styles/
    incubator/odf/site/trunk/content/odftoolkit/simple/javadoc/

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell%20Range.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell Range.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,125 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Cell Range</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Cell Range.html">Cell Range</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Cell.html">previous</a></li>
+  <li><a href="Charts.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get CellRange">
+<br/>
+<a href="#Get CellRange" >Get CellRange</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can get cell range by providing start and end index of the column and row,or just provide start and end address of the cell(if you are using the spreadsheet.)
+</div>
+<br/><pre class='code' id="code0">
+	    <span class='javaclass'>CellRange</span> cellRange = table.getCellRangeByPosition(1, 0, 2, 0);<br/>
+	    <span class='javaclass'>CellRange</span> cellRangeAdd = table.getCellRangeByPosition("$E1","$E6");<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Table">
+<br/>
+<a href="#Merge Text Table" >Merge Text Table</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below merges all of the selected cells into one:
+</div>
+<br/><pre class='code' id="code1">
+	    <span class='javaclass'>Table</span> table1 = document.getTableByName("Table1");<br/>
+	    <span class='javaclass'>CellRange</span> cellrange = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, table1.getRowCount()-1);<br/>
+	    cellRange.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Column">
+<br/>
+<a href="#Merge Text Column" >Merge Text Column</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below shows how to merge the cells of the first column into one :
+</div>
+<br/><pre class='code' id="code2">
+	    	table1 = document.getTableByName("Table1");<br/>
+	    	<span class='javaclass'>CellRange</span> firstColumn = table1.getCellRangeByPosition(0, 0, 0, table1.getRowCount()-1);<br/>
+	    	firstColumn.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Row">
+<br/>
+<a href="#Merge Text Row" >Merge Text Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below shows how to merge the cells of the first 2 rows into one :
+</div>
+<br/><pre class='code' id="code3">
+		table1 = document.getTableByName("Table1");<br/>
+		<span class='basic'>int</span> rowCount = table1.getRowCount();<br/>
+    	        <span class='javaclass'>CellRange</span> firstTwoRow = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, 1);<br/>
+    	        firstTwoRow.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge SpreadSheet">
+<br/>
+<a href="#Merge SpreadSheet" >Merge SpreadSheet</a>
+<hr/>
+</div>
+<div class="bodytext">
+Merge a spreadsheet's cell is the same as text document.Especially,when getting the cell range of spreadsheet,you can use special address instead of index.
+</div>
+<br/><pre class='code' id="code4">
+		<span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+		<span class='javaclass'>CellRange</span> cellRange2 = sheet1.getCellRangeByPosition("$E1","$E6");<br/>
+		cellRange2.setCellRangeName("<span class='javaclass'>TimeCellRange</span>");<br/>
+		cellRange2.merge(); <br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Cell.html">previous</a></li>
+  <li><a href="Charts.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Cell.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,334 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Cell</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Cell.html">Cell</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Column and Row.html">previous</a></li>
+  <li><a href="Cell Range.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get Cell">
+<br/>
+<a href="#Get Cell" >Get Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to get the specified cell in a table,you can use the getCellByPosition method of Table.
+</div>
+<div class="bodytext">
+The first parameter is the column index,the second parameter is the row index.
+</div>
+<br/><pre class='code' id="code0">
+         <span class='javaclass'>TextDocument</span> document = (<span class='javaclass'>TextDocument</span>) <span class='javaclass'>TextDocument</span>.loadDocument(filePath);<br/>
+	 <span class='javaclass'>Table</span> table=document.getTableByName("stringTable");<br/>
+	 <span class='javaclass'>Cell</span> cell=table.getCellByPosition(1, 1);<br/>
+</pre>
+<br/><div class="bodytext">
+If you are manipulating a spreadsheet,you can get the cell by its address:
+</div>
+<br/><pre class='code' id="code1">
+	 <span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+	 <span class='javaclass'>Cell</span> odsCell=sheet1.getCellByPosition("A1");<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to get a cell from a row,you can specify the index of the cell in the row.
+</div>
+<br/><pre class='code' id="code2">
+	 <span class='javaclass'>Row</span> row=table.getRowByIndex(1);<br/>
+	 <span class='javaclass'>Cell</span> cell2=row.getCellByIndex(1);<br/>
+	 <span class='javaclass'>System</span>.out.println(cell2.getStringValue());<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I have a Cell instance and want to know which column and row it belongs to ?
+</div>
+<div class="bodytext">
+The code below shows how you can do that:
+</div>
+<br/><pre class='code' id="code3">
+	 <span class='javaclass'>Row</span> row1=cell.getTableRow();<br/>
+	 <span class='javaclass'>Column</span> column1=cell.getTableColumn();<br/>
+</pre>
+<br/><div class="contenttitle" id="Control Cell Attributes">
+<br/>
+<a href="#Control Cell Attributes" >Control Cell Attributes</a>
+<hr/>
+</div>
+<div class="bodytext">
+Use the getStyleName() method you can get the style name of the cell.
+</div>
+<div class="bodytext">
+If you want to change the style,it must be set when you set the display text.
+</div>
+<br/><pre class='code' id="code4">
+	 <span class='javaclass'>String</span> cellSytle=cell.getStyleName();<br/>
+	 cell.setDisplayText("content", cellSytle);<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to control the display alignment of the cell?
+</div>
+<div class="bodytext">
+You can set the horizontal and vertical alignment to do so.
+</div>
+<div class="bodytext">
+The code below shows how to get and set the alignment.You can refer to the javadoc about the alignment type.
+</div>
+<br/><pre class='code' id="code5">
+	  <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span> horizontalAlign=cell.getHorizontalAlignmentType();<br/>
+	  <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span> verticalAlign=cell.getVerticalAlignmentType();<br/>
+	  cell.setHorizontalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span>.<span class='javaclass'>CENTER</span>);<br/>
+	  cell.setVerticalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span>.<span class='javaclass'>BOTTOM</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If the content of the cell is too long,you can set the wrap option of the cell.
+</div>
+<br/><pre class='code' id="code6">
+	   cell.setTextWrapped(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If don't know the cell is wrapped or not,you can use the method:
+</div>
+<br/><pre class='code' id="code7">
+	   <span class='basic'>boolean</span> isTextWrapped=cell.isTextWrapped();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to set the background color of the cell,be care that the color type is org.odftoolkit.odfdom.type.Color.
+</div>
+<br/><pre class='code' id="code8">
+	    <span class='javaclass'>Color</span> cellBackgroundColor=cell.getCellBackgroundColor();<br/>
+	    cell.setCellBackgroundColor(<span class='javaclass'>Color</span>.valueOf("#000000"));<br/>
+</pre>
+<br/><div class="bodytext">
+How can I control the spanned number of the column/row:
+</div>
+<br/><pre class='code' id="code9">
+	    <span class='basic'>int</span> spannedNum=cell.getcgetColumnSpannedNumber();<br/>
+	    cell.setColumnSpannedNumber(spannedNum);<br/>
+	    <span class='basic'>int</span> rowSpannedNum=cell.getRowSpannedNumber();<br/>
+	    cell.setRowSpannedNumber(rowSpannedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+For column,maybe you want to know the column repeated number:
+</div>
+<br/><pre class='code' id="code10">
+	    <span class='basic'>int</span> repeatedNum=cell.getColumnsRepeatedNumber();<br/>
+	    cell.setColumnsRepeatedNumber(repeatedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+How about formatting a cell's content? You can set the format string of the cell to do so.
+</div>
+<div class="bodytext">
+For example you want to format the date to yyyy-MM-dd ,you can:
+</div>
+<br/><pre class='code' id="code11">
+	      <span class='javaclass'>String</span> cellFormatStr=cell.getFormatString();<br/>
+	      cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+	      cell.setFormatString("yyyy-<span class='javaclass'>MM</span>-dd");<br/>
+</pre>
+<br/><div class="bodytext">
+Be care that the setFormatString only works for float, date and percentage.
+</div>
+<div class="bodytext">
+You may be confused by the difference between getFormatString and getFormula,the difference is that:
+</div>
+<div class="bodytext">
+For the setFormula method,it just sets as a formula attribute,the cell value will not be calculated.
+</div>
+<br/><pre class='code' id="code12">
+	      <span class='javaclass'>String</span> formula=cell.getFormula();<br/>
+	      cell.setFormula(formula);    <br/>
+</pre>
+<br/><div class="bodytext">
+How can I clear the content of the cell?
+</div>
+<div class="bodytext">
+RemoveContent remove all of the cell while the removeTextContent only remove the text content of the cell.
+</div>
+<br/><pre class='code' id="code13">
+	   cell.removeContent();<br/>
+	   cell.removeTextContent();<br/>
+</pre>
+<br/><div class="contenttitle" id="Get&Set Cell Value Type">
+<br/>
+<a href="#Get&Set Cell Value Type" >Get&Set Cell Value Type</a>
+<hr/>
+</div>
+<div class="bodytext">
+	 The cell value can have different types,for the setValueType method:	 the parameter can be 	 <ul><li>"boolean"</li>	 <li>"currency"</li>	 <li>"date"</li>	 <li>"float"</li>         <li>"percentage"</li>	 <li>"string"</li>	 <li>"time"</li>	 <li>"void"</li>	 </ul>	 If the parameter type is not a valid cell type, an IllegalArgumentException will be thrown.
+</div>
+<br/><pre class='code' id="code14">
+	   <span class='javaclass'>String</span> valueType=cell.getValueType();<br/>
+	   cell.setValueType(valueType);<br/>
+</pre>
+<br/><div class="bodytext">
+For the following getXXXValue() method:it gets the cell value as xxx type.An IllegalArgumentException will be thrown if the cell type is not xxx.
+</div>
+<div class="contenttitle2" id="Get&Set boolean type Cell">
+<br/>
+<a href="#Get&Set boolean type Cell" >Get&Set boolean type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+	For setBooleanValue method:it sets the cell value as a boolean and sets the value type to be boolean.
+</div>
+<br/><pre class='code' id="code15">
+	   <span class='basic'>boolean</span> booleanValue=cell.getBooleanValue();<br/>
+	   cell.setBooleanValue(booleanValue);<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set currency type Cell">
+<br/>
+<a href="#Get&Set currency type Cell" >Get&Set currency type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+For the following getting methods,if the value type is not "currency", an IllegalArgumentException will be thrown.
+</div>
+<div class="bodytext">
+The currency code of the cell is like "USD", "EUR", "CNY", and the currency symbol is like "$"
+</div>
+<br/><pre class='code' id="code16">
+	   <span class='javaclass'>String</span> currencyCode=cell.getCurrencyCode();  <br/>
+	   cell.setCurrencyCode("<span class='javaclass'>USD</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+You can also set currency value and currency format.Please note the overall format includes the symbol character, for example: $#,##0.00.
+</div>
+<br/><pre class='code' id="code17">
+	   cell.setCurrencyValue(100.00, "<span class='javaclass'>USD</span>");<br/>
+	   cell.setCurrencyFormat("$", "$#,##0.00");<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set date type Cell">
+<br/>
+<a href="#Get&Set date type Cell" >Get&Set date type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code18">
+	   <span class='javaclass'>Calendar</span> dateValue=cell.getDateValue(); <br/>
+	   cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set float type Cell">
+<br/>
+<a href="#Get&Set float type Cell" >Get&Set float type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code19">
+	  <span class='basic'>double</span> floatValue=cell.getDoubleValue();  <br/>
+	  cell.setDoubleValue(<span class='modifier'>new</span> <span class='javaclass'>Double</span>(22.99f));<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set percentage type Cell">
+<br/>
+<a href="#Get&Set percentage type Cell" >Get&Set percentage type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code20">
+	  <span class='basic'>double</span> percentageValue=cell.getPercentageValue();<br/>
+	  cell.setPercentageValue(0.89);<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set string type Cell">
+<br/>
+<a href="#Get&Set string type Cell" >Get&Set string type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+If the cell type is not string, the display text will be returned.
+</div>
+<br/><pre class='code' id="code21">
+	  <span class='javaclass'>String</span> stringValue=cell.getStringValue();   <br/>
+	  cell.setStringValue("simple");<br/>
+</pre>
+<br/><div class="contenttitle2" id="Deal with the Time Value">
+<br/>
+<a href="#Deal with the Time Value" >Deal with the Time Value</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to get the string type of time value,you can format it:
+</div>
+<br/><pre class='code' id="code22">
+	  cell.setTimeValue(<span class='javaclass'>Calendar</span>.getInstance());<br/>
+	  <span class='javaclass'>SimpleDateFormat</span> simpleFormat = <span class='modifier'>new</span> <span class='javaclass'>SimpleDateFormat</span>("'<span class='javaclass'>PT</span>'<span class='javaclass'>HH</span>'H'mm'M'ss'S'");<br/>
+          <span class='javaclass'>String</span>  timeString= simpleFormat.format(cell.getTimeValue().getTime());<br/>
+</pre>
+<br/><div class="contenttitle2" id="Something about Display Text">
+<br/>
+<a href="#Something about Display Text" >Something about Display Text</a>
+<hr/>
+</div>
+<div class="bodytext">
+          Please note the display text in ODF viewer might be different from the value set by this method,	  because the displayed text in ODF viewer is calculated and set by editor. 
+</div>
+<br/><pre class='code' id="code23">
+	  <span class='javaclass'>String</span> displayText=cell.getDisplayText();<br/>
+	  cell.setDisplayText(displayText);<br/>
+</pre>
+<br/><div class="contenttitle" id="Set image">
+<br/>
+<a href="#Set image" >Set image</a>
+<hr/>
+</div>
+<div class="bodytext">
+		From version 0.5.5, we support high level APIs for images.	    You can use following codes to set an image to a cell.
+</div>
+<br/><pre class='code' id="code24">
+	    <span class='javaclass'>Image</span> myImage = cell.setImage(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("http://www.xxx.com/a.jpg"));<br/>
+</pre>
+<br/><div class="bodytext">
+	    You can use following codes to access an image in a cell.
+</div>
+<br/><pre class='code' id="code25">
+	    <span class='javaclass'>Image</span> image = cell.getImage();<br/>
+	    <span class='javaclass'>String</span> imagename = image.getName();<br/>
+	    <span class='javaclass'>FrameRectangle</span> rect = image.getRectangle();<br/>
+	    rect.setX(1);<br/>
+	    rect.setY(1);<br/>
+	    image.setRectangle(rect);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Column and Row.html">previous</a></li>
+  <li><a href="Cell Range.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Charts.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Charts.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Charts.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Charts.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,183 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Charts</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Charts.html">Charts</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Cell Range.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Overview">
+<br/>
+<a href="#Overview" >Overview</a>
+<hr/>
+</div>
+<div class="bodytext">
+	    Since 0.6, Simple ODF provides methods to manipulate charts in text document, spreadsheet document and presentation document.		You can create, update and delete charts with these methods.
+</div>
+<div class="contenttitle" id="Create charts">
+<br/>
+<a href="#Create charts" >Create charts</a>
+<hr/>
+</div>
+<div class="bodytext">
+		We all know, a chart is associated with a table. In order to create a chart, you must determine the data set of this chart.		The data set can be a cell range of a table, for example:
+</div>
+<br/><pre class='code' id="code0">
+		<span class='javaclass'>CellRangeAddressList</span> cellRange = <span class='javaclass'>CellRangeAddressList</span>.valueOf("A.A1:A.B3");<br/>
+		<span class='javaclass'>DataSet</span> dataSet = <span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(cellRange, spreadsheetDoc, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+		Or a two dimensional array, for example:
+</div>
+<br/><pre class='code' id="code1">
+		<span class='basic'>int</span> row = 2, column = 3;<br/>
+		<span class='basic'>double</span>[][] data = <span class='modifier'>new</span> <span class='basic'>double</span>[column][row];<br/>
+		<span class='javaclass'>String</span>[] labels = <span class='modifier'>new</span> <span class='javaclass'>String</span>[row];<br/>
+		<span class='javaclass'>String</span>[] legends = <span class='modifier'>new</span> <span class='javaclass'>String</span>[column];<br/>
+		<span class='javaclass'>DataSet</span> dataset = <span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(labels, legends, data);<br/>
+</pre>
+<br/><div class="bodytext">
+		You should also use rectangle to define the position and the size of this chart. For example: 
+</div>
+<br/><pre class='code' id="code2">
+		<span class='javaclass'>Rectangle</span> rect = <span class='modifier'>new</span> <span class='javaclass'>Rectangle</span>();<br/>
+		rect.x = 2000;<br/>
+		rect.y = 2700;<br/>
+		rect.width = 15000;<br/>
+		rect.height = 8000;<br/>
+		rect.y = 110000;<br/>
+</pre>
+<br/><div class="bodytext">
+		Then you can create a chart:
+</div>
+<br/><pre class='code' id="code3">
+		spreadsheetDoc.createChart("<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", dataSet,rect);<br/>
+</pre>
+<br/><div class="bodytext">
+		There are some shortcut methods to create charts, for example, below codes show how to create a chart in a text document:
+</div>
+<br/><pre class='code' id="code4">
+		<span class='javaclass'>Chart</span> chart = textDoc.createChart(<br/>
+				"<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", spreadsheetDoc,<br/>
+				cellRange, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, rect);<br/>
+</pre>
+<br/><div class="bodytext">
+		If you want to create a chart in a spreadsheet document, you need to specify a cell to be the anchor of this chart, for example: 
+</div>
+<br/><pre class='code' id="code5">
+		spreadsheetDoc.createChart("<span class='javaclass'>Page</span> <span class='javaclass'>Visit</span>", spreadsheetDoc, cellRange,<br/>
+				<span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, rect, spreadsheetDoc.getTableByName("C")<br/>
+						.getCellByPosition("D10"));<br/>
+</pre>
+<br/><div class="bodytext">
+		If you want to create a chart in a presentation document, you can use the existing layout of a slide, which means, you don't need to specify		a rectangle. The layouts that could contain a chart include: TITLE_PLUS_CHART, TITLE_PLUS_2_CHART, TITLE_LEFT_CHART_RIGHT_OUTLINE,		TITLE_PLUS_3_OBJECT, and TITLE_PLUS_4_OBJECT. For example:
+</div>
+<br/><pre class='code' id="code6">
+		<span class='javaclass'>Slide</span> slide = presentationDoc.newSlide(2, "Slide3",<br/>
+				<span class='javaclass'>SlideLayout</span>.TITLE_PLUS_2_CHART);<br/>
+		chart = slide.createChart("<span class='javaclass'>Count</span> of <span class='javaclass'>Visits</span>", spreadsheetDoc,<br/>
+				cellRange, <span class='basic'>true</span>, <span class='basic'>true</span>, <span class='basic'>false</span>, <span class='basic'>null</span>);<br/>
+</pre>
+<br/><div class="contenttitle" id="Update charts">
+<br/>
+<a href="#Update charts" >Update charts</a>
+<hr/>
+</div>
+<div class="bodytext">
+		You can update charts properties, for example, the title, axis title, chart type, whether to apply 3D effect, whether to use legend with API.		For example:
+</div>
+<br/><pre class='code' id="code7">
+		chart.setChartTitle("<span class='javaclass'>New</span> title");<br/>
+		chart.setAxisTitle("<span class='javaclass'>Hour</span>", "<span class='javaclass'>Number</span>");<br/>
+		chart.setChartType(<span class='javaclass'>ChartType</span>.<span class='javaclass'>AREA</span>);<br/>
+		chart.setApply3DEffect(<span class='basic'>true</span>);<br/>
+		chart.setUseLegend(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+		You can update the data set too. For example:
+</div>
+<br/><pre class='code' id="code8">
+		chart.setChartData(<span class='modifier'>new</span> <span class='javaclass'>DataSet</span>(<span class='javaclass'>CellRangeAddressList</span>.valueOf("A.A1:A.C4"), spreadsheetDoc, true, true, true));<br/>
+</pre>
+<br/><div class="contenttitle" id="Get and delete charts">
+<br/>
+<a href="#Get and delete charts" >Get and delete charts</a>
+<hr/>
+</div>
+<div class="bodytext">
+		You can get charts by title e.g.
+</div>
+<br/><pre class='code' id="code9">
+		chart = textDoc.getChartByTitle("<span class='javaclass'>New</span> title").get(0);<br/>
+</pre>
+<br/><div class="bodytext">
+		You can also get a chart by its unique ID. The unique ID of a chart in Simple ODF API is the path of the chart document (relative to the ODF document package).		The unique ID can be gotten with method:
+</div>
+<br/><pre class='code' id="code10">
+		<span class='javaclass'>String</span> chartid = chart.getChartID();<br/>
+		chart = textDoc.getChartById(chartid);<br/>
+</pre>
+<br/><div class="bodytext">
+		You can also get the count of charts in this document.
+</div>
+<br/><pre class='code' id="code11">
+		<span class='basic'>int</span> count = textDoc.getChartCount();<br/>
+</pre>
+<br/><div class="bodytext">
+		You can delete a chart by ID or by title, e.g.
+</div>
+<br/><pre class='code' id="code12">
+		textDoc.deleteChartById(chartid);<br/>
+		textDoc.deleteChartByTitle("<span class='javaclass'>New</span> title");<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Cell Range.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Column%20and%20Row.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Column and Row.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,166 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Column and Row</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Column and Row.html">Column and Row</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Table.html">previous</a></li>
+  <li><a href="Cell.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get Column/Row">
+<br/>
+<a href="#Get Column/Row" >Get Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+The class Column/Row represents the column/row of table.To get all the columns or rows you can use the getColumnList or getRowList of the table instance.
+</div>
+<br/><pre class='code' id="code0">
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; columns = table.getColumnList();<br/>
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; rows = table.getRowList();<br/>
+</pre>
+<br/><div class="bodytext">
+You can also get single column/row by specifying the index of the column/row.
+</div>
+<div class="bodytext">
+The column/row index start from 0.If not found, null will be returned.
+</div>
+<br/><pre class='code' id="code1">
+	<br/>
+	<span class='javaclass'>Column</span> column = table.getColumnByIndex(2);<br/>
+	<span class='javaclass'>Row</span> row = table.getRowByIndex(0);<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the count of header column/row in the table,you can do like this:
+</div>
+<br/><pre class='code' id="code2">
+	<span class='basic'>int</span> headerColumnCount = table.getHeaderColumnCount();<br/>
+	<span class='basic'>int</span> headerRowCount = table.getHeaderRowCount();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the index of the column/row,you can use the method below:
+</div>
+<br/><pre class='code' id="code3">
+	<span class='basic'>int</span> columnIndex=column.getColumnIndex();<br/>
+	<span class='basic'>int</span> rowIndex=row.getRowIndex();<br/>
+</pre>
+<br/><div class="bodytext">
+Can I get the previous or next Column/Row by the current column/row instance?
+</div>
+<div class="bodytext">
+Yes,you can ask the column/row instance itself,if it doesn't exist,null will be returned.
+</div>
+<br/><pre class='code' id="code4">
+	<span class='javaclass'>Column</span> previousCol=column.getPreviousColumn();<br/>
+	<span class='javaclass'>Column</span> nextCol=column.getNextColumn();<br/>
+	<span class='javaclass'>Row</span> previousRow=row.getPreviousRow();<br/>
+	<span class='javaclass'>Row</span> nextRow=row.getNextRow();<br/>
+</pre>
+<br/><div class="contenttitle" id="Append or Insert Column/Row">
+<br/>
+<a href="#Append or Insert Column/Row" >Append or Insert Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can add a column to the end or insert many columns before the specified index
+</div>
+<div class="bodytext">
+The appendColumn/Row method add an empty column/row at the end and return the new appended column/row
+</div>
+<br/><pre class='code' id="code5">
+	<span class='javaclass'>Column</span> newColumn=table.appendColumn();<br/>
+	<span class='javaclass'>Row</span> newRow=table.appendRow();<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to insert a column/row into the specified position?
+</div>
+<div class="bodytext">
+	 You can use the insertColumn/RowBefore method,whose first parameter is the index of the column/row to be inserted before;	 The second parameter is the number of columns/rows to be inserted.
+</div>
+<br/><pre class='code' id="code6">
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; cols = table.insertColumnsBefore(1, 2);<br/>
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; newRows = table.insertRowsBefore(0, 2);<br/>
+</pre>
+<br/><div class="contenttitle" id="Remove Columns/Rows">
+<br/>
+<a href="#Remove Columns/Rows" >Remove Columns/Rows</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can delete a number of columns/rows by index
+</div>
+<div class="bodytext">
+The first parameter is the index of the first column/row to delete; The second parameter is the number of columns/rows to delete.
+</div>
+<div class="bodytext">
+The code below remove 1 column whose index is 2;remove 2 rows whose index is 1,2. 
+</div>
+<br/><pre class='code' id="code7">
+	table.removeColumnsByIndex(2, 1);<br/>
+	table.removeRowsByIndex(1, 2);<br/>
+</pre>
+<br/><div class="contenttitle" id="Set Column/Row">
+<br/>
+<a href="#Set Column/Row" >Set Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to change the width of the column or the height of the row,you can use it like this:
+</div>
+<div class="bodytext">
+If the second parameter of row's setHeight is true, the row can fit the height to the text, vice versa.
+</div>
+<br/><pre class='code' id="code8">
+	column.setWidth(column.getWidth()/2);<br/>
+	row.setHeight(row.getHeight()/2, <span class='basic'>true</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Table.html">previous</a></li>
+  <li><a href="Cell.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Fields.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Fields.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Fields.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Fields.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,220 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Fields</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Fields.html">Fields</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="TextExtractor.html">previous</a></li>
+  <li><a href="Manipulate Metadata.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Variable Field">
+<br/>
+<a href="#Variable Field" >Variable Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			You can use the following code to create a variable field, and set the value.
+</div>
+<br/><pre class='code' id="code0">
+			<span class='javaclass'>TextDocument</span> doc = <span class='javaclass'>TextDocument</span>.newTextDocument();<br/>
+			<span class='javaclass'>Paragraph</span> paragraph = doc.addParagraph("test_con_variable:");<br/>
+			<span class='javaclass'>VariableField</span> simpleVariableField = <span class='javaclass'>Fields</span>.createSimpleVariableField(doc, "test_con_variable");<br/>
+			simpleVariableField.updateField("true", paragraph.getOdfElement());<br/>
+</pre>
+<br/><div class="bodytext">
+			Following code can be used to set value to variable field, and append it to an ODF element.
+</div>
+<br/><pre class='code' id="code1">
+			simpleVariableField.updateField("user variable content", null);<br/>
+			simpleVariableField.displayField(paragraph.getOdfElement());<br/>
+</pre>
+<br/><div class="contenttitle" id="Condition Field">
+<br/>
+<a href="#Condition Field" >Condition Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a condition field.
+</div>
+<br/><pre class='code' id="code2">
+			<span class='javaclass'>Paragraph</span> newParagraph = doc.addParagraph("<span class='javaclass'>Condition</span> <span class='javaclass'>Field</span> <span class='javaclass'>Test</span>:");<br/>
+			<span class='javaclass'>ConditionField</span> conditionField = <span class='javaclass'>Fields</span>.createConditionField(newParagraph.getOdfElement(), "test_con_variable == \"true\"",<br/>
+					"trueText", "falseText");<br/>
+</pre>
+<br/><div class="contenttitle" id="Hidden Field">
+<br/>
+<a href="#Hidden Field" >Hidden Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a hidden field.
+</div>
+<br/><pre class='code' id="code3">
+			newParagraph = doc.addParagraph("<span class='javaclass'>Hide</span> <span class='javaclass'>Text</span> <span class='javaclass'>Field</span> <span class='javaclass'>Test</span>:");<br/>
+			conditionField = <span class='javaclass'>Fields</span>.createHiddenTextField(newParagraph.getOdfElement(), "test_con_variable == \"true\"", "hiddenText");<br/>
+</pre>
+<br/><div class="contenttitle" id="Cross Reference Field">
+<br/>
+<a href="#Cross Reference Field" >Cross Reference Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a reference field.
+</div>
+<br/><pre class='code' id="code4">
+			<span class='javaclass'>OdfElement</span> newTextSpanElement = ((<span class='javaclass'>TextPElement</span>)doc.addParagraph("<span class='javaclass'>Reference</span> <span class='javaclass'>Content</span>:").getOdfElement()).newTextSpanElement();<br/>
+			newTextSpanElement.setTextContent("<span class='javaclass'>This</span> is a test reference content.");<br/>
+			<span class='javaclass'>ReferenceField</span> referenceField = <span class='javaclass'>Fields</span>.createReferenceField(newTextSpanElement, "test-ref");<br/>
+</pre>
+<br/><div class="bodytext">
+			Following code can be used to append a reference field.
+</div>
+<br/><pre class='code' id="code5">
+			referenceField.appendReferenceTo(doc.addParagraph("<span class='javaclass'>User</span> <span class='javaclass'>Reference</span> <span class='javaclass'>Field</span>:").getOdfElement(), <span class='javaclass'>ReferenceField</span>.<span class='javaclass'>DisplayType</span>.<span class='javaclass'>TEXT</span>);<br/>
+</pre>
+<br/><div class="contenttitle" id="Chapter Field">
+<br/>
+<a href="#Chapter Field" >Chapter Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a chapter field.
+</div>
+<br/><pre class='code' id="code6">
+			<span class='javaclass'>ChapterField</span> chapterField = <span class='javaclass'>Fields</span>.createChapterField(doc.addParagraph("<span class='javaclass'>Chapter</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="contenttitle" id="Title and Subject Field">
+<br/>
+<a href="#Title and Subject Field" >Title and Subject Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a title field.
+</div>
+<br/><pre class='code' id="code7">
+			<span class='javaclass'>TitleField</span> titleField = <span class='javaclass'>Fields</span>.createTitleField(doc.addParagraph("<span class='javaclass'>The</span> <span class='javaclass'>Title</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="bodytext">
+			Following code can be used to create a subject field.
+</div>
+<br/><pre class='code' id="code8">
+			<span class='javaclass'>SubjectField</span> subjectField = <span class='javaclass'>Fields</span>.createSubjectField(doc.addParagraph("<span class='javaclass'>The</span> <span class='javaclass'>Subject</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="contenttitle" id="Author Field">
+<br/>
+<a href="#Author Field" >Author Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a author initial field and a author name field.
+</div>
+<br/><pre class='code' id="code9">
+			<span class='javaclass'>AuthorField</span> authorField = <span class='javaclass'>Fields</span>.createAuthorInitialsField(doc.addParagraph("<span class='javaclass'>The</span> initials of the author :").getOdfElement());<br/>
+			authorField = <span class='javaclass'>Fields</span>.createAuthorNameField(doc.addParagraph("<span class='javaclass'>Author</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="contenttitle" id="Page Number Field">
+<br/>
+<a href="#Page Number Field" >Page Number Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a current page number field.
+</div>
+<br/><pre class='code' id="code10">
+			<span class='javaclass'>PageNumberField</span> numberField = <span class='javaclass'>Fields</span>.createCurrentPageNumberField(doc.addParagraph("<span class='javaclass'>Current</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+			numberField.setNumberFormat(<span class='javaclass'>NumberFormat</span>.UPPERCASE_LATIN_ALPHABET);<br/>
+			numberField.setDisplayPage(<span class='javaclass'>DisplayType</span>.NEXT_PAGE);<br/>
+</pre>
+<br/><div class="bodytext">
+			Following code can be used to create a previous page number and a next page number field.
+</div>
+<br/><pre class='code' id="code11">
+			numberField = <span class='javaclass'>Fields</span>.createPreviousPageNumberField(doc.addParagraph("<span class='javaclass'>Previous</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+			numberField = <span class='javaclass'>Fields</span>.createNextPageNumberField(doc.addParagraph("<span class='javaclass'>Next</span> <span class='javaclass'>Page</span> <span class='javaclass'>Number</span>:").getOdfElement());<br/>
+</pre>
+<br/><div class="contenttitle" id="Page Number Field">
+<br/>
+<a href="#Page Number Field" >Page Number Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a page count field, and set the number format.
+</div>
+<br/><pre class='code' id="code12">
+			<span class='javaclass'>PageCountField</span> countField = <span class='javaclass'>Fields</span>.createPageCountField(doc.addParagraph("<span class='javaclass'>Page</span> <span class='javaclass'>Count</span>:").getOdfElement());<br/>
+			countField.setNumberFormat(<span class='javaclass'>NumberFormat</span>.UPPERCASE_LATIN_ALPHABET);<br/>
+</pre>
+<br/><div class="contenttitle" id="Date Field">
+<br/>
+<a href="#Date Field" >Date Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a date field, and set the format.
+</div>
+<br/><pre class='code' id="code13">
+			<span class='javaclass'>DateField</span> dateField = <span class='javaclass'>Fields</span>.createDateField(doc.addParagraph("<span class='javaclass'>Date</span>:").getOdfElement());<br/>
+			dateField.formatDate("yy-<span class='javaclass'>MM</span>-dd");<br/>
+</pre>
+<br/><div class="contenttitle" id="Time Field">
+<br/>
+<a href="#Time Field" >Time Field</a>
+<hr/>
+</div>
+<div class="bodytext">
+			Following code can be used to create a time field, and set the format.
+</div>
+<br/><pre class='code' id="code14">
+			<span class='javaclass'>TimeField</span> timeField = <span class='javaclass'>Fields</span>.createTimeField(doc.addParagraph("<span class='javaclass'>Time</span>:").getOdfElement());<br/>
+			timeField.formatTime("<span class='javaclass'>HH</span>:mm:ss a");<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="TextExtractor.html">previous</a></li>
+  <li><a href="Manipulate Metadata.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell Range.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate%20Cell%20Range.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell Range.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell Range.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,112 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Manipulate Cell Range</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../samples.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Manipulate Cell Range.html">Manipulate Cell Range</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Cell.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get CellRange">
+<br/>
+<a href="#Get CellRange" >Get CellRange</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can get cell range by providing start and end index of the column and row,or just provide start and end address of the cell(if you are using the spreadsheet.)
+</div>
+<br/><pre class='code' id="code0">
+	    <span class='javaclass'>CellRange</span> cellRange = table.getCellRangeByPosition(1, 0, 2, 0);<br/>
+	    <span class='javaclass'>CellRange</span> cellRangeAdd = table.getCellRangeByPosition("$E1","$E6");<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Table">
+<br/>
+<a href="#Merge Text Table" >Merge Text Table</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below merges all of the selected cells into one:
+</div>
+<br/><pre class='code' id="code1">
+	    <span class='javaclass'>Table</span> table1 = document.getTableByName("Table1");<br/>
+	    <span class='javaclass'>CellRange</span> cellrange = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, table1.getRowCount()-1);<br/>
+	    cellRange.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Column">
+<br/>
+<a href="#Merge Text Column" >Merge Text Column</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below shows how to merge the cells of the first column into one :
+</div>
+<br/><pre class='code' id="code2">
+	    	table1 = document.getTableByName("Table1");<br/>
+	    	<span class='javaclass'>CellRange</span> firstColumn = table1.getCellRangeByPosition(0, 0, 0, table1.getRowCount()-1);<br/>
+	    	firstColumn.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge Text Row">
+<br/>
+<a href="#Merge Text Row" >Merge Text Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+The code below shows how to merge the cells of the first 2 rows into one :
+</div>
+<br/><pre class='code' id="code3">
+		table1 = document.getTableByName("Table1");<br/>
+		<span class='basic'>int</span> rowCount = table1.getRowCount();<br/>
+    	        <span class='javaclass'>CellRange</span> firstTwoRow = table1.getCellRangeByPosition(0, 0, table1.getColumnCount()-1, 1);<br/>
+    	        firstTwoRow.merge();<br/>
+</pre>
+<br/><div class="contenttitle" id="Merge SpreadSheet">
+<br/>
+<a href="#Merge SpreadSheet" >Merge SpreadSheet</a>
+<hr/>
+</div>
+<div class="bodytext">
+Merge a spreadsheet's cell is the same as text document.Especially,when getting the cell range of spreadsheet,you can use special address instead of index.
+</div>
+<br/><pre class='code' id="code4">
+		<span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+		<span class='javaclass'>CellRange</span> cellRange2 = sheet1.getCellRangeByPosition("$E1","$E6");<br/>
+		cellRange2.setCellRangeName("<span class='javaclass'>TimeCellRange</span>");<br/>
+		cellRange2.merge(); <br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Cell.html">previous</a></li>
+  <li><a href="Style Handling.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate%20Cell.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Cell.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,321 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Manipulate Cell</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../samples.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Manipulate Cell.html">Manipulate Cell</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Columns and Rows.html">previous</a></li>
+  <li><a href="Manipulate Cell Range.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get Cell">
+<br/>
+<a href="#Get Cell" >Get Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to get the specified cell in a table,you can use the getCellByPosition method of Table.
+</div>
+<div class="bodytext">
+The first parameter is the column index,the second parameter is the row index.
+</div>
+<br/><pre class='code' id="code0">
+         <span class='javaclass'>TextDocument</span> document = (<span class='javaclass'>TextDocument</span>) <span class='javaclass'>TextDocument</span>.loadDocument(filePath);<br/>
+	 <span class='javaclass'>Table</span> table=document.getTableByName("stringTable");<br/>
+	 <span class='javaclass'>Cell</span> cell=table.getCellByPosition(1, 1);<br/>
+</pre>
+<br/><div class="bodytext">
+If you are manipulating a spreadsheet,you can get the cell by its address:
+</div>
+<br/><pre class='code' id="code1">
+	 <span class='javaclass'>Table</span> sheet1 = document.getTableByName("Sheet1");<br/>
+	 <span class='javaclass'>Cell</span> odsCell=sheet1.getCellByPosition("A1");<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to get a cell from a row,you can specify the index of the cell in the row.
+</div>
+<br/><pre class='code' id="code2">
+	 <span class='javaclass'>Row</span> row=table.getRowByIndex(1);<br/>
+	 <span class='javaclass'>Cell</span> cell2=row.getCellByIndex(1);<br/>
+	 <span class='javaclass'>System</span>.out.println(cell2.getStringValue());<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I have a Cell instance and want to know which column and row it belongs to ?
+</div>
+<div class="bodytext">
+The code below shows how you can do that:
+</div>
+<br/><pre class='code' id="code3">
+	 <span class='javaclass'>Row</span> row1=cell.getTableRow();<br/>
+	 <span class='javaclass'>Column</span> column1=cell.getTableColumn();<br/>
+</pre>
+<br/><div class="contenttitle" id="Control Cell Attributes">
+<br/>
+<a href="#Control Cell Attributes" >Control Cell Attributes</a>
+<hr/>
+</div>
+<div class="bodytext">
+Use the getStyleName() method you can get the style name of the cell.
+</div>
+<div class="bodytext">
+If you want to change the style,it must be set when you set the display text.
+</div>
+<br/><pre class='code' id="code4">
+	 <span class='javaclass'>String</span> cellSytle=cell.getStyleName();<br/>
+	 cell.setDisplayText("content", cellSytle);<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to control the display alignment of the cell?
+</div>
+<div class="bodytext">
+You can set the horizontal and vertical alignment to do so.
+</div>
+<div class="bodytext">
+The code below shows how to get and set the alignment.You can refer to the javadoc about the alignment type.
+</div>
+<br/><pre class='code' id="code5">
+	  <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span> horizontalAlign=cell.getHorizontalAlignmentType();<br/>
+	  <span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span> verticalAlign=cell.getVerticalAlignmentType();<br/>
+	  cell.setHorizontalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>HorizontalAlignmentType</span>.<span class='javaclass'>CENTER</span>);<br/>
+	  cell.setVerticalAlignment(<span class='javaclass'>StyleTypeDefinitions</span>.<span class='javaclass'>VerticalAlignmentType</span>.<span class='javaclass'>BOTTOM</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If the content of the cell is too long,you can set the wrap option of the cell.
+</div>
+<br/><pre class='code' id="code6">
+	   cell.setTextWrapped(<span class='basic'>true</span>);<br/>
+</pre>
+<br/><div class="bodytext">
+If don't know the cell is wrapped or not,you can use the method:
+</div>
+<br/><pre class='code' id="code7">
+	   <span class='basic'>boolean</span> isTextWrapped=cell.isTextWrapped();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to set the background color of the cell,be care that the color type is org.odftoolkit.odfdom.type.Color.
+</div>
+<br/><pre class='code' id="code8">
+	    <span class='javaclass'>Color</span> cellBackgroundColor=cell.getCellBackgroundColor();<br/>
+	    cell.setCellBackgroundColor(<span class='javaclass'>Color</span>.valueOf("#000000"));<br/>
+</pre>
+<br/><div class="bodytext">
+How can I control the spanned number of the column/row:
+</div>
+<br/><pre class='code' id="code9">
+	    <span class='basic'>int</span> spannedNum=cell.getcgetColumnSpannedNumber();<br/>
+	    cell.setColumnSpannedNumber(spannedNum);<br/>
+	    <span class='basic'>int</span> rowSpannedNum=cell.getRowSpannedNumber();<br/>
+	    cell.setRowSpannedNumber(rowSpannedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+For column,maybe you want to know the column repeated number:
+</div>
+<br/><pre class='code' id="code10">
+	    <span class='basic'>int</span> repeatedNum=cell.getColumnsRepeatedNumber();<br/>
+	    cell.setColumnsRepeatedNumber(repeatedNum);<br/>
+</pre>
+<br/><div class="bodytext">
+How about formatting a cell's content? You can set the format string of the cell to do so.
+</div>
+<div class="bodytext">
+For example you want to format the date to yyyy-MM-dd ,you can:
+</div>
+<br/><pre class='code' id="code11">
+	      <span class='javaclass'>String</span> cellFormatStr=cell.getFormatString();<br/>
+	      cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+	      cell.setFormatString("yyyy-<span class='javaclass'>MM</span>-dd");<br/>
+</pre>
+<br/><div class="bodytext">
+Be care that the setFormatString only works for float, date and percentage.
+</div>
+<div class="bodytext">
+You may be confused by the difference between getFormatString and getFormula,the difference is that:
+</div>
+<div class="bodytext">
+For the setFormula method,it just sets as a formula attribute,the cell value will not be calculated.
+</div>
+<br/><pre class='code' id="code12">
+	      <span class='javaclass'>String</span> formula=cell.getFormula();<br/>
+	      cell.setFormula(formula);    <br/>
+</pre>
+<br/><div class="bodytext">
+How can I clear the content of the cell?
+</div>
+<div class="bodytext">
+RemoveContent remove all of the cell while the removeTextContent only remove the text content of the cell.
+</div>
+<br/><pre class='code' id="code13">
+	   cell.removeContent();<br/>
+	   cell.removeTextContent();<br/>
+</pre>
+<br/><div class="contenttitle" id="Get&Set Cell Value Type">
+<br/>
+<a href="#Get&Set Cell Value Type" >Get&Set Cell Value Type</a>
+<hr/>
+</div>
+<div class="bodytext">
+	 The cell value can have different types,for the setValueType method:	 the parameter can be 	 <ul><li>"boolean"</li>	 <li>"currency"</li>	 <li>"date"</li>	 <li>"float"</li>         <li>"percentage"</li>	 <li>"string"</li>	 <li>"time"</li>	 <li>"void"</li>	 </ul>	 If the parameter type is not a valid cell type, an IllegalArgumentException will be thrown.
+</div>
+<br/><pre class='code' id="code14">
+	   <span class='javaclass'>String</span> valueType=cell.getValueType();<br/>
+	   cell.setValueType(valueType);<br/>
+</pre>
+<br/><div class="bodytext">
+For the following getXXXValue() method:it gets the cell value as xxx type.An IllegalArgumentException will be thrown if the cell type is not xxx.
+</div>
+<div class="contenttitle2" id="Get&Set boolean type Cell">
+<br/>
+<a href="#Get&Set boolean type Cell" >Get&Set boolean type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+	For setBooleanValue method:it sets the cell value as a boolean and sets the value type to be boolean.
+</div>
+<br/><pre class='code' id="code15">
+	   <span class='basic'>boolean</span> booleanValue=cell.getBooleanValue();<br/>
+	   cell.setBooleanValue(booleanValue);<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set currency type Cell">
+<br/>
+<a href="#Get&Set currency type Cell" >Get&Set currency type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+For the following getting methods,if the value type is not "currency", an IllegalArgumentException will be thrown.
+</div>
+<div class="bodytext">
+The currency code of the cell is like "USD", "EUR", "CNY", and the currency symbol is like "$"
+</div>
+<br/><pre class='code' id="code16">
+	   <span class='javaclass'>String</span> currencyCode=cell.getCurrencyCode();  <br/>
+	   cell.setCurrencyCode("<span class='javaclass'>USD</span>");<br/>
+</pre>
+<br/><div class="bodytext">
+You can also set currency value and currency format.Please note the overall format includes the symbol character, for example: $#,##0.00.
+</div>
+<br/><pre class='code' id="code17">
+	   cell.setCurrencyValue(100.00, "<span class='javaclass'>USD</span>");<br/>
+	   cell.setCurrencyFormat("$", "$#,##0.00");<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set date type Cell">
+<br/>
+<a href="#Get&Set date type Cell" >Get&Set date type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code18">
+	   <span class='javaclass'>Calendar</span> dateValue=cell.getDateValue(); <br/>
+	   cell.setDateValue(<span class='modifier'>new</span> <span class='javaclass'>GregorianCalendar</span>(2010,5,1));<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set float type Cell">
+<br/>
+<a href="#Get&Set float type Cell" >Get&Set float type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code19">
+	  <span class='basic'>double</span> floatValue=cell.getDoubleValue();  <br/>
+	  cell.setDoubleValue(<span class='modifier'>new</span> <span class='javaclass'>Double</span>(22.99f));<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set percentage type Cell">
+<br/>
+<a href="#Get&Set percentage type Cell" >Get&Set percentage type Cell</a>
+<hr/>
+</div>
+<br/><pre class='code' id="code20">
+	  <span class='basic'>double</span> percentageValue=cell.getPercentageValue();<br/>
+	  cell.setPercentageValue(0.89);<br/>
+</pre>
+<br/><div class="contenttitle2" id="Get&Set string type Cell">
+<br/>
+<a href="#Get&Set string type Cell" >Get&Set string type Cell</a>
+<hr/>
+</div>
+<div class="bodytext">
+If the cell type is not string, the display text will be returned.
+</div>
+<br/><pre class='code' id="code21">
+	  <span class='javaclass'>String</span> stringValue=cell.getStringValue();   <br/>
+	  cell.setStringValue("simple");<br/>
+</pre>
+<br/><div class="contenttitle2" id="Deal with the Time Value">
+<br/>
+<a href="#Deal with the Time Value" >Deal with the Time Value</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to get the string type of time value,you can format it:
+</div>
+<br/><pre class='code' id="code22">
+	  cell.setTimeValue(<span class='javaclass'>Calendar</span>.getInstance());<br/>
+	  <span class='javaclass'>SimpleDateFormat</span> simpleFormat = <span class='modifier'>new</span> <span class='javaclass'>SimpleDateFormat</span>("'<span class='javaclass'>PT</span>'<span class='javaclass'>HH</span>'H'mm'M'ss'S'");<br/>
+          <span class='javaclass'>String</span>  timeString= simpleFormat.format(cell.getTimeValue().getTime());<br/>
+</pre>
+<br/><div class="contenttitle2" id="Something about Display Text">
+<br/>
+<a href="#Something about Display Text" >Something about Display Text</a>
+<hr/>
+</div>
+<div class="bodytext">
+          Please note the display text in ODF viewer might be different from the value set by this method,	  because the displayed text in ODF viewer is calculated and set by editor. 
+</div>
+<br/><pre class='code' id="code23">
+	  <span class='javaclass'>String</span> displayText=cell.getDisplayText();<br/>
+	  cell.setDisplayText(displayText);<br/>
+</pre>
+<br/><div class="contenttitle" id="Set image">
+<br/>
+<a href="#Set image" >Set image</a>
+<hr/>
+</div>
+<div class="bodytext">
+		From version 0.5.5, we support high level APIs for images.	    You can use following codes to set an image to a cell.
+</div>
+<br/><pre class='code' id="code24">
+	    <span class='javaclass'>Image</span> myImage = cell.setImage(<span class='modifier'>new</span> <span class='javaclass'>URI</span>("http://www.xxx.com/a.jpg"));<br/>
+</pre>
+<br/><div class="bodytext">
+	    You can use following codes to access an image in a cell.
+</div>
+<br/><pre class='code' id="code25">
+	    <span class='javaclass'>Image</span> image = cell.getImage();<br/>
+	    <span class='javaclass'>String</span> imagename = image.getName();<br/>
+	    <span class='javaclass'>FrameRectangle</span> rect = image.getRectangle();<br/>
+	    rect.setX(1);<br/>
+	    rect.setY(1);<br/>
+	    image.setRectangle(rect);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Columns and Rows.html">previous</a></li>
+  <li><a href="Manipulate Cell Range.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate%20Columns%20and%20Rows.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Columns and Rows.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,153 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Manipulate Columns and Rows</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../samples.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Manipulate Columns and Rows.html">Manipulate Columns and Rows</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Table.html">previous</a></li>
+  <li><a href="Manipulate Cell.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Get Column/Row">
+<br/>
+<a href="#Get Column/Row" >Get Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+The class Column/Row represents the column/row of table.To get all the columns or rows you can use the getColumnList or getRowList of the table instance.
+</div>
+<br/><pre class='code' id="code0">
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; columns = table.getColumnList();<br/>
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; rows = table.getRowList();<br/>
+</pre>
+<br/><div class="bodytext">
+You can also get single column/row by specifying the index of the column/row.
+</div>
+<div class="bodytext">
+The column/row index start from 0.If not found, null will be returned.
+</div>
+<br/><pre class='code' id="code1">
+	<br/>
+	<span class='javaclass'>Column</span> column = table.getColumnByIndex(2);<br/>
+	<span class='javaclass'>Row</span> row = table.getRowByIndex(0);<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the count of header column/row in the table,you can do like this:
+</div>
+<br/><pre class='code' id="code2">
+	<span class='basic'>int</span> headerColumnCount = table.getHeaderColumnCount();<br/>
+	<span class='basic'>int</span> headerRowCount = table.getHeaderRowCount();<br/>
+</pre>
+<br/><div class="bodytext">
+If you want to know the index of the column/row,you can use the method below:
+</div>
+<br/><pre class='code' id="code3">
+	<span class='basic'>int</span> columnIndex=column.getColumnIndex();<br/>
+	<span class='basic'>int</span> rowIndex=row.getRowIndex();<br/>
+</pre>
+<br/><div class="bodytext">
+Can I get the previous or next Column/Row by the current column/row instance?
+</div>
+<div class="bodytext">
+Yes,you can ask the column/row instance itself,if it doesn't exist,null will be returned.
+</div>
+<br/><pre class='code' id="code4">
+	<span class='javaclass'>Column</span> previousCol=column.getPreviousColumn();<br/>
+	<span class='javaclass'>Column</span> nextCol=column.getNextColumn();<br/>
+	<span class='javaclass'>Row</span> previousRow=row.getPreviousRow();<br/>
+	<span class='javaclass'>Row</span> nextRow=row.getNextRow();<br/>
+</pre>
+<br/><div class="contenttitle" id="Append or Insert Column/Row">
+<br/>
+<a href="#Append or Insert Column/Row" >Append or Insert Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can add a column to the end or insert many columns before the specified index
+</div>
+<div class="bodytext">
+The appendColumn/Row method add an empty column/row at the end and return the new appended column/row
+</div>
+<br/><pre class='code' id="code5">
+	<span class='javaclass'>Column</span> newColumn=table.appendColumn();<br/>
+	<span class='javaclass'>Row</span> newRow=table.appendRow();<br/>
+</pre>
+<br/><div class="bodytext">
+What can I do if I want to insert a column/row into the specified position?
+</div>
+<div class="bodytext">
+	 You can use the insertColumn/RowBefore method,whose first parameter is the index of the column/row to be inserted before;	 The second parameter is the number of columns/rows to be inserted.
+</div>
+<br/><pre class='code' id="code6">
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Column</span>&gt; cols = table.insertColumnsBefore(1, 2);<br/>
+	<span class='javaclass'>List</span>&lt;<span class='javaclass'>Row</span>&gt; newRows = table.insertRowsBefore(0, 2);<br/>
+</pre>
+<br/><div class="contenttitle" id="Remove Columns/Rows">
+<br/>
+<a href="#Remove Columns/Rows" >Remove Columns/Rows</a>
+<hr/>
+</div>
+<div class="bodytext">
+You can delete a number of columns/rows by index
+</div>
+<div class="bodytext">
+The first parameter is the index of the first column/row to delete; The second parameter is the number of columns/rows to delete.
+</div>
+<div class="bodytext">
+The code below remove 1 column whose index is 2;remove 2 rows whose index is 1,2. 
+</div>
+<br/><pre class='code' id="code7">
+	table.removeColumnsByIndex(2, 1);<br/>
+	table.removeRowsByIndex(1, 2);<br/>
+</pre>
+<br/><div class="contenttitle" id="Set Column/Row">
+<br/>
+<a href="#Set Column/Row" >Set Column/Row</a>
+<hr/>
+</div>
+<div class="bodytext">
+If you want to change the width of the column or the height of the row,you can use it like this:
+</div>
+<div class="bodytext">
+If the second parameter of row's setHeight is true, the row can fit the height to the text, vice versa.
+</div>
+<br/><pre class='code' id="code8">
+	column.setWidth(column.getWidth()/2);<br/>
+	row.setHeight(row.getHeight()/2, <span class='basic'>true</span>);<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Manipulate Table.html">previous</a></li>
+  <li><a href="Manipulate Cell.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="#">About Us</a> | <a href="#">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>

Added: incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html
URL: http://svn.apache.org/viewvc/incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate%20Metadata.html?rev=1165478&view=auto
==============================================================================
--- incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html (added)
+++ incubator/odf/site/trunk/content/odftoolkit/simple/document/cookbook/Manipulate Metadata.html Tue Sep  6 02:09:27 2011
@@ -0,0 +1,143 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title>Manipulate Metadata</title>
+ <link type="text/css" rel="stylesheet" href="cookbook.css"/>
+<link rel="stylesheet" href="../images/style.css" type="text/css" />
+<script type="text/javascript">
+
+var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-22366020-1']);
+_gaq.push(['_trackPageview']);
+
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+</script>
+</head>
+<body>
+<div id="page" align="center">
+<div id="content" style="width:920px" class="contentpanel">
+<div id="topheader">
+<div class="topright"> </div>
+</div>
+<div id="menu">
+<div align="left" class="smallwhitetext"> <a href="../index.html" class="home"> </a> <a href="../downloads.html" class="download"></a> <a href="../documents.html" class="document"></a> <a href="../demo/index.html" class="sample"> </a> </div>
+</div>
+<div id="subcontent" align ="left">
+<div align="left" class="titletext"> <span >
+<a href="../documents.html">Documents</a> > 
+<a href="index.html">Cookbook</a> ><a href="Manipulate Metadata.html">Manipulate Metadata</a>
+</span>
+</div>
+<div class="navigation">
+ <ul>
+  <li><a href="Fields.html">previous</a></li>
+  <li><a href="Text Document.html">next</a></li>
+ </ul>
+</div>
+<br/>
+<div class="contenttitle" id="Overview">
+<br/>
+<a href="#Overview" >Overview</a>
+<hr/>
+</div>
+<div class="bodytext">
+     This <a href="">Meta</a> API supports to access and set document metadata. It covers the metadata definitions in <a href="http:docs.oasis-open.org/office/v1.2/cd05/OpenDocument-v1.2-cd05-part1.html#a_4_Metadata">ODF Specification 1.2 Committee Draft05</a>
+</div>
+<div class="contenttitle" id="Get Meta object">
+<br/>
+<a href="#Get Meta object" >Get Meta object</a>
+<hr/>
+</div>
+<div class="bodytext">
+     First you load an ODF text document(for example),then get the meta file DOM and then use the meta DOM to create an instance of     the Meta. Use Meta you can access all the supported elements.
+</div>
+<br/><pre class='code' id="code0">
+	<span class='javaclass'>TextDocument</span> doc = (<span class='javaclass'>TextDocument</span>) <span class='javaclass'>TextDocument</span>.loadDocument("testtable.odt");<br/>
+	<span class='javaclass'>OdfFileDom</span> metadom = doc.getMetaDom();<br/>
+	<span class='javaclass'>Meta</span> metadata = <span class='modifier'>new</span> <span class='javaclass'>Meta</span>(metadom);<br/>
+</pre>
+<br/><div class="contenttitle" id="Access metadata">
+<br/>
+<a href="#Access metadata" >Access metadata</a>
+<hr/>
+</div>
+<div class="bodytext">
+     After creating the Meta instance,you can use it to manipulate the metadata:     for example, you can set a value for the &lt;meta:generator&gt; like this:
+</div>
+<br/><pre class='code' id="code1">
+	metadata.setGenerator("<span class='javaclass'>OpenOffice</span>.org/3.0$Win32 <span class='javaclass'>OpenOffice</span>.org_project/300m15$<span class='javaclass'>Build</span>-9379");<br/>
+</pre>
+<br/><div class="bodytext">
+     The &lt;meta:keyword&gt; may contain many keywords, you can set the whole list of keywords and add one keyword as you want.     the api currently do not provide the direct method for deleting one keyword ,you can get the keyword list first,and then     delete the keyword,finally set the list to the element.
+</div>
+<br/><pre class='code' id="code2">
+       metadata.addKeyword("java");<br/>
+      <span class='javaclass'>List</span>&lt;<span class='javaclass'>String</span>&gt; keywords=metadata.getKeywords();<br/>
+      keywords.remove("java");<br/>
+      metadata.setKeywords(keywords);<br/>
+</pre>
+<br/><div class="contenttitle" id="Access the user defined element">
+<br/>
+<a href="#Access the user defined element" >Access the user defined element</a>
+<hr/>
+</div>
+<div class="bodytext">
+    To manipulate the user defined data,you should get the list of their names,and then use the names to     update the data or its datatype or delete the whole user defined data.    you can use the setUserDefinedData(String name, String type, String value) method to update data,if the    name not exists in the document,the method will add the new user defined data.
+</div>
+<br/><pre class='code' id="code3">
+      <span class='javaclass'>List</span>&lt;<span class='javaclass'>String</span>&gt; names=metadata.getUserDefinedDataNames();<br/>
+      <span class='control'>for</span> (<span class='javaclass'>String</span> name : names) {<br/>
+	  metadata.removeUserDefinedDataByName(name);<br/>
+      }<br/>
+      <span class='javaclass'>String</span> key="newId";<br/>
+<span class='comments'>      //org.odftoolkit.odfdom.dom.attribute.meta.MetaValueTypeAttribute.Value</span>
+      metadata.setUserDefinedData(key, <span class='javaclass'>Value</span>.<span class='javaclass'>STRING</span>.toString(), "new001");<br/>
+<span class='comments'>      //update the  datatype</span>
+      metadata.setUserDefinedDataType(key, <span class='javaclass'>Value</span>.<span class='javaclass'>BOOLEAN</span>.toString());<br/>
+<span class='comments'>      //update the data value</span>
+      metadata.setUserDefinedDataValue(key, "false");<br/>
+      <br/>
+<span class='comments'>      //get the datatype</span>
+      <span class='javaclass'>String</span> dataType=metadata.getUserDefinedDataType(key);<br/>
+<span class='comments'>      //get the data value</span>
+      <span class='javaclass'>String</span> dataValue=metadata.getUserDefinedDataValue(key);    <br/>
+</pre>
+<br/><div class="contenttitle" id="Access the document statistics">
+<br/>
+<a href="#Access the document statistics" >Access the document statistics</a>
+<hr/>
+</div>
+<div class="bodytext">
+    if you want to access the document statistics,you should get a DocumentStatistic instance,    if the return is null,it means that this ODF document doesn't have any document statistic information,you should    create a document statistics object.
+</div>
+<br/><pre class='code' id="code4">
+	<span class='javaclass'>DocumentStatistic</span> stat = metadata.getDocumentStatistic();<br/>
+	<span class='control'>if</span>(stat==<span class='basic'>null</span>) {<br/>
+	    stat=<span class='modifier'>new</span> <span class='javaclass'>DocumentStatistic</span>(metadata.getOfficeMetaElement().newMetaDocumentStatisticElement());<br/>
+	}<br/>
+	<br/>
+	stat.setCellCount(3);<br/>
+	<span class='javaclass'>Integer</span> cellCount=stat.getCellCount();<br/>
+</pre>
+<br/><br/> 
+<div class="navigation">
+ <ul>
+  <li><a href="Fields.html">previous</a></li>
+  <li><a href="Text Document.html">next</a></li>
+  <li><a href="#">top</a></li>
+ </ul>
+</div>
+<br/>
+</div>
+<div id="footer" class="smallgraytext"> <a href="../index.html">Home</a> | <a href="../index.html">About Us</a> | <a href="mailto:Daisy@odftoolkit.org">Contact Us</a> </div>
+</div>
+</div>
+</body>
+</html>



Mime
View raw message