From 0d9f355f29d82f95437556d118dbf6def9d8b7ed Mon Sep 17 00:00:00 2001
From: cbmarcum
Date: Thu, 2 Jul 2020 11:46:43 -0400
Subject: [PATCH] Refs #3 - doc update.
---
docs/index.adoc | 50 +++++++++++++++++++++++++++++-------------
docs/index.html | 58 ++++++++++++++++++++++++++++++++++---------------
2 files changed, 76 insertions(+), 32 deletions(-)
diff --git a/docs/index.adoc b/docs/index.adoc
index 27cb297..ba7d9be 100644
--- a/docs/index.adoc
+++ b/docs/index.adoc
@@ -23,9 +23,9 @@ Projects that build using dependencies from artifact repositories like Apache Ma
the latest version as a dependency in the build file or POM.
=== Gradle Projects
-[source, groovy]
+[source, gradle]
----
-compile group: 'net.codebuilders', name: 'guno-extension', version: '4.1.6.12'
+compile group: 'net.codebuilders', name: 'guno-extension', version: '4.1.6.13'
----
=== Maven Projects
@@ -34,7 +34,7 @@ compile group: 'net.codebuilders', name: 'guno-extension', version: '4.1.6.12'
net.codebuildersguno-extension
- 4.1.6.12
+ 4.1.6.13
----
@@ -43,7 +43,7 @@ Groovy scripts can declare a Grab dependency at the beginning before import stat
[source, groovy]
----
@Grapes(
- @Grab(group='net.codebuilders', module='guno-extension', version='4.1.6.12')
+ @Grab(group='net.codebuilders', module='guno-extension', version='4.1.6.13')
)
----
@@ -144,13 +144,15 @@ xSheet = oIndexSheets.getByIndex(0).guno(XSpreadsheet.class)
An UNO object must offer its properties through interfaces that allow you to work with properties. The most basic form
of these interfaces is the interface com.sun.star.beans.XPropertySet .
-In XPropertySet, two methods carry out the property access, _getPropertyValue(String propertyName)_ and
-_setPropertyValue(String propertyName, Object propertyValue)_.
+In XPropertySet, two methods carry out the property access: +
+_Object getPropertyValue(String propertyName)_ +
+_void setPropertyValue(String propertyName, Object propertyValue)_ +
-The GUNO Extension adds the methods _getAt(String propertyName)_ and _putAt(String propertyName, Object propertyValue)_
-to the XPropertySet class.
+The GUNO Extension adds two special methods to XPropertySet: +
+_Object getAt(String propertyName)_ +
+_void putAt(String propertyName, Object propertyValue)_ +
-Example: Set the CellStyle of a spreadsheet Cell *xCell*.
+Example: Set the CellStyle of a spreadsheet Cell _xCell_.
*Java*
[source,java]
@@ -166,8 +168,9 @@ XPropertySet xCellProps = xCell.guno(XPropertySet.class)
xCellProps.putAt("CellStyle", "Result")
----
-By adding _getAt()_ and _putAt()_ methods to XPropertySet we can now access the properties using http://groovy-lang.org/operators.html#subscript-operator[Groovy Subscript Operator] notation. This can Get or Set properties depending on which side of the assigment it's on.
+These special methods allow a shorthand version to getAt and PutAt using http://groovy-lang.org/operators.html#subscript-operator[Groovy Subscript Operator] notation. This can Get or Set properties depending on which side of the assigment it's on.
+*GUNO Extension* using Subscript operator for assignment.
[source,groovy]
----
xCellProps["CellStyle"] = "Result"
@@ -176,7 +179,10 @@ xCellProps["CellStyle"] = "Result"
See below for an even faster method to set Cell Properties.
=== Spreadsheet By Index and Name
-The GUNO Extension adds a _getSheetByIndex(Integer nIndex)_ method to XSpreadsheetDocument that returns the XSpreadsheet by the index position saving the steps of getting the XIndexAccess enumeration of sheets and then getting the sheet by index. Likewise there is a _getSheetByName(String name)_ method added also.
+The GUNO Extension adds a method to XSpreadsheetDocument that returns the XSpreadsheet by the index position saving the steps of getting the XIndexAccess enumeration of sheets and then getting the sheet by index. Likewise there is a method that uses the sheet name. +
+_XSpreadsheet getSheetByIndex(Integer nIndex)_ +
+_XSpreadsheet getSheetByName(String name)_
+
The example leaves out the try/catch for brevity and assumes we have a reference to XSpreadsheetDocument _myDoc_
@@ -221,9 +227,13 @@ xCellText.setString("Quotation")
xSpreadsheet.setFormulaOfCell(2,2, "Quotation")
----
-=== Setting the Cell Style property
+=== Cell Style
-The extension adds a setter method for CellStyle allowing what looks like property access to cellStyle. (ToDo add getter method)
+The extension adds getter and setter methods for CellStyle to XCell +
+_Object getCellStyle()_ +
+_void setCellStyle(Object value)_ +
+allowing what looks like property access to the CellStyle property. +
+To set the cell style to "Result":
*Without Extension*
@@ -239,9 +249,19 @@ xCellProps.setPropertyValue("CellStyle", "Result")
xCell.cellStyle = "Result"
----
-=== Using Enum Types
+To get the style as a String:
+
+*With Extension*
+[source, groovy]
+----
+String style = xCell.cellStyle
+----
+
+=== CellVertJustify Enum
-The extension adds getter and setter methods for CellVertJustify allowing what looks like property access to vertJustify.
+The extension adds getter and setter methods to XCell allowing what looks like property access to vertJustify and use the CellVertJustify enum types.
+_Integer getVertJustify()_ +
+_void setVertJustify(Object value)_
*Without Extension*
diff --git a/docs/index.html b/docs/index.html
index 93a298b..0cb9b87 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -465,8 +465,8 @@
P
of these interfaces is the interface com.sun.star.beans.XPropertySet .
-
In XPropertySet, two methods carry out the property access, getPropertyValue(String propertyName) and
-setPropertyValue(String propertyName, Object propertyValue).
+
In XPropertySet, two methods carry out the property access:
+Object getPropertyValue(String propertyName)
+void setPropertyValue(String propertyName, Object propertyValue)
-
The GUNO Extension adds the methods getAt(String propertyName) and putAt(String propertyName, Object propertyValue)
-to the XPropertySet class.
+
The GUNO Extension adds two special methods to XPropertySet:
+Object getAt(String propertyName)
+void putAt(String propertyName, Object propertyValue)
-
Example: Set the CellStyle of a spreadsheet Cell xCell.
+
Example: Set the CellStyle of a spreadsheet Cell xCell.
Java
@@ -715,7 +717,10 @@
P
-
By adding getAt() and putAt() methods to XPropertySet we can now access the properties using Groovy Subscript Operator notation. This can Get or Set properties depending on which side of the assigment it’s on.
+
These special methods allow a shorthand version to getAt and PutAt using Groovy Subscript Operator notation. This can Get or Set properties depending on which side of the assigment it’s on.
+
+
+
GUNO Extension using Subscript operator for assignment.
@@ -729,7 +734,9 @@
P
Spreadsheet By Index and Name
-
The GUNO Extension adds a getSheetByIndex(Integer nIndex) method to XSpreadsheetDocument that returns the XSpreadsheet by the index position saving the steps of getting the XIndexAccess enumeration of sheets and then getting the sheet by index. Likewise there is a getSheetByName(String name) method added also.
+
The GUNO Extension adds a method to XSpreadsheetDocument that returns the XSpreadsheet by the index position saving the steps of getting the XIndexAccess enumeration of sheets and then getting the sheet by index. Likewise there is a method that uses the sheet name.
+XSpreadsheet getSheetByIndex(Integer nIndex)
+XSpreadsheet getSheetByName(String name)
The example leaves out the try/catch for brevity and assumes we have a reference to XSpreadsheetDocument myDoc
@@ -787,9 +794,13 @@
Cell
-
Setting the Cell Style property
+
Cell Style
-
The extension adds a setter method for CellStyle allowing what looks like property access to cellStyle. (ToDo add getter method)
+
The extension adds getter and setter methods for CellStyle to XCell
+Object getCellStyle()
+void setCellStyle(Object value)
+allowing what looks like property access to the CellStyle property.
+To set the cell style to "Result":
The extension adds getter and setter methods for CellVertJustify allowing what looks like property access to vertJustify.
+
The extension adds getter and setter methods to XCell allowing what looks like property access to vertJustify and use the CellVertJustify enum types.
+Integer getVertJustify()
+void setVertJustify(Object value)