From 95a0d27887934ab60af321ce83655238a29df981 Mon Sep 17 00:00:00 2001 From: Lionel Elie Mamane Date: Sun, 11 Dec 2011 08:50:48 +0100 Subject: typo, trailing whitespace cleanup --- odk/examples/examples.html | 606 ++++++++++++++++++++++----------------------- 1 file changed, 302 insertions(+), 304 deletions(-) (limited to 'odk') diff --git a/odk/examples/examples.html b/odk/examples/examples.html index 6e9d21fd74ac..a3d11a5bc06c 100644 --- a/odk/examples/examples.html +++ b/odk/examples/examples.html @@ -9,70 +9,70 @@ - + - + - + - @@ -269,24 +267,24 @@ - - + - - + - - + - - +
+ - + - - + - - - + + - - + @@ -110,26 +108,26 @@ - + @@ -251,10 +249,10 @@ - - +
+
- + - +
Examples
+
- - + - + - +
-

The SDK provides a rich set of examples in different programming - languages (Java, Python, C++, LibreOffice %PRODUCT_RELEASE% Basic, OLE) to illustrate the use - of the API and demonstrate how to benefit from the included word - processor, spreadsheet, presentation software, graphics program and +

+

The SDK provides a rich set of examples in different programming + languages (Java, Python, C++, LibreOffice %PRODUCT_RELEASE% Basic, OLE) to illustrate the use + of the API and demonstrate how to benefit from the included word + processor, spreadsheet, presentation software, graphics program and database of LibreOffice %PRODUCT_RELEASE%.
- Some fo the examples need a running office instance listening on a - port. If this is necessary you will get further information in the + Some fo the examples need a running office instance listening on a + port. If this is necessary you will get further information in the makefiles.

-

Every makefile contains at least one run target to execute an - running example, please see the makefile output in the different +

Every makefile contains at least one run target to execute an + running example, please see the makefile output in the different example directories. Some of the examples which create a component have no run target. In these cases a document is provided which instantiates - and runs the component (see the makefile output). Also the Basic - examples provide documents which use and shows the implemented + and runs the component (see the makefile output). Also the Basic + examples provide documents which use and shows the implemented functionality.

+
- - @@ -83,26 +83,24 @@ - - + - + - +
Developer's Guide examplesThe Developer's Guide comes - with a rich set of examples which demonstrate the use of the API in + The Developer's Guide comes + with a rich set of examples which demonstrate the use of the API in the different application areas.
Java examplesSet of simple and more complex examples which + Set of simple and more complex examples which shows the use of the API from Java.
C++ examplesSmall set of examples which shows the use of + Small set of examples which shows the use of the API from C++.
LibreOffice %PRODUCT_RELEASE% Basic examplesSmall set of examples which shows the use of - the API from LibeOffice %PRODUCT_RELEASE% Basic.Small set of examples which shows the use of + the API from LibreOffice %PRODUCT_RELEASE% Basic.
Object Linking and Embedding (OLE) examplesExamples which show the use of the API from - OLE.Examples which show the use of the API from OLE.
Common Language Infrastructure (CLI) examplesExamples which show the use of the API from - the CLI.Examples which show the use of the API from the CLI.
- - + - + @@ -212,31 +210,31 @@ - - + - - + - - + - - +
+
- + - +
Java examples
@@ -140,64 +138,64 @@ - - + - - + - - + - - + - - + - - + - - + - - + - - +
BookmarkInsertionThis application connects to the office server and - gets the multi component factory. An empty text document will be opened - and an example text will be entered. Afterwards, some bookmarks will be + This application connects to the office server and + gets the multi component factory. An empty text document will be opened + and an example text will be entered. Afterwards, some bookmarks will be inserted.
HardFormattingThis program connects to the office server and gets - the multi component factory. Furthermore, an empty text document will be - opened, an example text will be entered, some text attributes will be + This program connects to the office server and gets + the multi component factory. Furthermore, an empty text document will be + opened, an example text will be entered, some text attributes will be inspected, and the PropertyState will be checked from the selection.
SWriterThe program connects to the office server and gets the + The program connects to the office server and gets the multi component factory. An empty text document will be created, some - text will be entered, and a text table, a colored text, and text frame + text will be entered, and a text table, a colored text, and text frame will be inserted.
StyleCreationThe example connects to the office server and gets the - multi component factory. An empty text document will be opened, a new + The example connects to the office server and gets the + multi component factory. An empty text document will be opened, a new paragraph style will be created, and applied.
StyleInitializationThe program connects to the office server and gets the - multi component factory. Thereafter, an empty text document will be - opened and an example text will be entered. The paragraph collection will - be used, in order to apply a different paragraph style on the + The program connects to the office server and gets the + multi component factory. Thereafter, an empty text document will be + opened and an example text will be entered. The paragraph collection will + be used, in order to apply a different paragraph style on the paragraphs.
TextDocumentStructureThe application connects to the office server and gets + The application connects to the office server and gets the multi component factory. An empty text document will be opened, an - enumeration of all paragraphs and an enumeration of all text portions + enumeration of all paragraphs and an enumeration of all text portions will be created.
TextReplaceThe example connects to the office server and gets the - multi component factory. An empty text document will be created, an - example text will be inserted, and some English spelled words will be + The example connects to the office server and gets the + multi component factory. An empty text document will be created, an + example text will be inserted, and some English spelled words will be replaced with US spelled words.
GraphicsInserterThe GraphicsInserter creates a graphics object on an + The GraphicsInserter creates a graphics object on an empty text document by setting its position, width, height, and URL.
WriterSelectorThis class gives you information on the selected - objects (text range, text frame, or graphics) at a LibreOffice + This class gives you information on the selected + objects (text range, text frame, or graphics) at a LibreOffice Server.
CalcAddinsThis component adds new functions to the spreadsheet - application. After registering the component, the inserted functions can - be found with help of the functions autopilot. The new functions are + This component adds new functions to the spreadsheet + application. After registering the component, the inserted functions can + be found with help of the functions autopilot. The new functions are assigned to the category Add-in.
ChartTypeChangeThis class loads a LibreOffice %PRODUCT_RELEASE% Calc document and + This class loads a LibreOffice %PRODUCT_RELEASE% Calc document and changes the type of the embedded chart.
EuroAdaptionThe application connects to the office server and gets - the multi component factory, opens an empty Calc document, enters an - example text, sets the number format to DM, changes the number format to + The application connects to the office server and gets + the multi component factory, opens an empty Calc document, enters an + example text, sets the number format to DM, changes the number format to EUR (Euro), and uses the DM/EUR factor on each cell with content.
SCalcThe program connects to the office server and gets the - multi component factory. Then an empty calc document will be opened, - cell styles will be created, some data will be inserted into the sheets, - and the created cell styles will be applied. Finally, a 3D chart will be + The program connects to the office server and gets the + multi component factory. Then an empty calc document will be opened, + cell styles will be created, some data will be inserted into the sheets, + and the created cell styles will be applied. Finally, a 3D chart will be inserted.
SDrawThis program connects to the office server and gets - the multi component factory. Afterwards, an empty text document will + This program connects to the office server and gets + the multi component factory. Afterwards, an empty text document will be created and some shapes will be inserted on the draw page.
DocumentConverterThe program offers a service that converts arbitrary + The program offers a service that converts arbitrary documents to a favored document type.
DocumentLoaderThe DocumentLoader can open a new or an + The DocumentLoader can open a new or an existing document.
DocumentPrinterThe DocumentPrinter allows you to print the + The DocumentPrinter allows you to print the favored pages of a specified document on your favored printer.
DocumentSaverThe DocumentSaver shows how to save a document and + The DocumentSaver shows how to save a document and how you can change the type of your document.
@@ -301,55 +299,55 @@
Object Inspector - The Object Inspector is primarily an auxiliary tool - for the developer, which can present information about an object of the - LibreOffice %PRODUCT_RELEASE% API at run-time. Depending on the object to be inspected, + The Object Inspector is primarily an auxiliary tool + for the developer, which can present information about an object of the + LibreOffice %PRODUCT_RELEASE% API at run-time. Depending on the object to be inspected, appropriate methods, interfaces, services, and attributes can be displayed - to the developer. The methods, interfaces, services and attributes are - represented in a predictable tree. If the attributes contained in an - object are to be examined, the appropriate nodes in the tree can be - expanded with the help of the mouse. For each non primitive object, five - categories are offered to the user, as long as those are available with - that object. The Object Inspector is currently available as a NetBeans project + to the developer. The methods, interfaces, services and attributes are + represented in a predictable tree. If the attributes contained in an + object are to be examined, the appropriate nodes in the tree can be + expanded with the help of the mouse. For each non primitive object, five + categories are offered to the user, as long as those are available with + that object. The Object Inspector is currently available as a NetBeans project only because of major code changes. Please see the project page for further details. - + MinimalComponent - This class provides a minimal UNO component. You can - take this class as a base for your own components. By extensions of this + This class provides a minimal UNO component. You can + take this class as a base for your own components. By extensions of this class it is possible to also extend the function range of the Office. - + PropTest - Contains a component that provides property set + Contains a component that provides property set interfaces by means of inheriting com.sun.star.lib.uno.helper.ProperterSet. - + ToDo For every to-do listed in a spreadsheet document, this - component calculates the start date, day of week of the start date, the - end date, and the day of week of the end date. All calculations are + component calculates the start date, day of week of the start date, the + end date, and the day of week of the end date. All calculations are dependent upon the values of "Needed Days", "Due Date" - and "Status". The columns "Needed Days" and - "Status" are mandatory. The first to-do should be placed in - row nine. The date to start the calculation should be placed in cell C6. + and "Status". The columns "Needed Days" and + "Status" are mandatory. The first to-do should be placed in + row nine. The date to start the calculation should be placed in cell C6. The private holidays should be placed in cell K4/K5 and below.
- All rows will be calculated up to the first empty cell in the first - column. If a cell in the column "Due Date" is colored red, + All rows will be calculated up to the first empty cell in the first + column. If a cell in the column "Due Date" is colored red, you should take a look at your entries. - + EmbeddedObject Contains a component that provides an example of embedded object implementation. - + - - + + - + - + +

Additional information:

@@ -357,38 +355,38 @@ Java UNO Language Binding
Debugging Java components

-
- + - + - - + - + - - + - +
+
- + - - - - + + + +
Python examples
@@ -400,57 +398,57 @@ - +
ToolPanelPoc This proof of concept extension illustrates how to create a ToolPanel in Calc.
+
- + - + +

No Additional information

-
- + - - + - + - - + - +
+
- + - - + + - + +
C++ examples
- The DocumentLoader example needs a running office server, before - running this program you should invoke the office with the following + The DocumentLoader example needs a running office server, before + running this program you should invoke the office with the following command:
soffice "-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager"
You can also customize the mentioned host and port to your needs. -
@@ -461,37 +459,37 @@ - - + - - + - - + - - +
DocumentLoaderThis component works the same as the appropriate Java + This component works the same as the appropriate Java example, but is implemented in C++.
CounterThis demo shows how to implement a very simple UNO + This demo shows how to implement a very simple UNO component and how to access the UNO component from an executable.
Remote clientThe 'uno' program is used to export an arbitrary - service to other processes. In this example the com.sun.star.uno.Pipe - service (which is built in io-module) is exported. The client component + The 'uno' program is used to export an arbitrary + service to other processes. In this example the com.sun.star.uno.Pipe + service (which is built in io-module) is exported. The client component implements the - com.sun.star.lang.XMain interface. In the run method, it connects to - the servers process and retrieves an instance and does some calls on the + com.sun.star.lang.XMain interface. In the run method, it connects to + the servers process and retrieves an instance and does some calls on the instance.
complextoolbarcontrolsThis example shows how to create a toolbar add-on with complex toolbar controls. + This example shows how to create a toolbar add-on with complex toolbar controls. It shows how to use an Image Button, a Combo Box, a Spin Field, an Edit Field, a Dropdown Box, a Toggle Dropdown Button and a normal Dropdown Button
+
- + - + +

Additional information:

@@ -499,48 +497,48 @@ C++ UNO Language Binding
C++ reference

-
- + - - + - + - - - + + - +
+
- + - - - + + - + +
LibreOffice %PRODUCT_RELEASE% Basic examples
-

The example programs are embedded in LibreOffice %PRODUCT_RELEASE% documents in the - samples directory. To view or edit the LibreOffice %PRODUCT_RELEASE% Basic source, +

+

The example programs are embedded in LibreOffice %PRODUCT_RELEASE% documents in the + samples directory. To view or edit the LibreOffice %PRODUCT_RELEASE% Basic source, select the appropriate document and then select Tools->Macro.

-

Most of the examples are stand-alone, but two of them (Creating an - Index and Import/Export of ASCII Files) have an associated data file +

Most of the examples are stand-alone, but two of them (Creating an + Index and Import/Export of ASCII Files) have an associated data file identified by a .txt file name suffix).

-

Some of the examples are also available in Java, you can find them in +

Some of the examples are also available in Java, you can find them in the Java section.

-
@@ -551,138 +549,138 @@ - - + - - + - - + - + - - + - - + - - + - - + - - +
Changing Appearance To change the style used for certain words, you can - start with the following example. This code searches for the regular - expression the[a-z], which stands for the text portion the - followed by exactly one lowercase letter. All occurrences of these four + To change the style used for certain words, you can + start with the following example. This code searches for the regular + expression the[a-z], which stands for the text portion the + followed by exactly one lowercase letter. All occurrences of these four letters are then changed to bold characters. The same happens in the next - part of the program, this time changing the appearance of - all[a-z] to italic. In order for this example to work, you + part of the program, this time changing the appearance of + all[a-z] to italic. In order for this example to work, you must execute it from an open text document.
Replacing TextIf you regularly receive documents from other people - for editing, you might want to make sure that certain words are always - written the same. The next example illustrates this by forcing certain + If you regularly receive documents from other people + for editing, you might want to make sure that certain words are always + written the same. The next example illustrates this by forcing certain words to be spelled in American English.
- In order for this example to work, you must execute it from an open text - document. For a real world application, it is a good idea to read the + In order for this example to work, you must execute it from an open text + document. For a real world application, it is a good idea to read the words from an external file.
Using Regular ExpressionsAnother application of automatic text modification is - related to stylistic questions. Suppose your company’s policy is to - avoid the use of certain words. You want to replace these words, but you - cannot do that automatically because you have to find the appropriate - replacement, which depends on the context. So instead of deleting or - replacing the offending words automatically, you change their color to + Another application of automatic text modification is + related to stylistic questions. Suppose your company’s policy is to + avoid the use of certain words. You want to replace these words, but you + cannot do that automatically because you have to find the appropriate + replacement, which depends on the context. So instead of deleting or + replacing the offending words automatically, you change their color to make them stand out during a subsequent manual review process.
- The following example handles two kinds of unwanted wordings: those - which are absolutely forbidden and must be replaced by something else, - and those which are considered bad style. A subroutine is responsible - for the changes. It can be used to make all words in a list appear in a - certain color in the text document. To keep the lists short, we use - regular expressions which provide for the variants of the words + The following example handles two kinds of unwanted wordings: those + which are absolutely forbidden and must be replaced by something else, + and those which are considered bad style. A subroutine is responsible + for the changes. It can be used to make all words in a list appear in a + certain color in the text document. To keep the lists short, we use + regular expressions which provide for the variants of the words (plural, adjective etc.).
Inserting Bookmarks -

The next example does something very similar. This time, however, we - do not change the color of the words but insert a bookmark at each of - them. You can thus use the StarOffice navigator to jump directly from - word to word. Bookmarks must first be created using - createInstance(). They are then inserted with +

The next example does something very similar. This time, however, we + do not change the color of the words but insert a bookmark at each of + them. You can thus use the StarOffice navigator to jump directly from + word to word. Bookmarks must first be created using + createInstance(). They are then inserted with insertTextContent() at the current text range.

-

The main difference to the preceding example is the For loop in - markList(). Instead of changing the color of the current - word, it creates a new bookmark, oBookmark, whose name is the current - word with an integer appended. It then inserts this bookmark at the +

The main difference to the preceding example is the For loop in + markList(). Instead of changing the color of the current + word, it creates a new bookmark, oBookmark, whose name is the current + word with an integer appended. It then inserts this bookmark at the word.

Creating an IndexIndices for text documents can be created manually in - LibreOffice %PRODUCT_RELEASE% Writer by clicking on the words that should appear in the - index. If the document is large, or if you have to generate indices for + Indices for text documents can be created manually in + LibreOffice %PRODUCT_RELEASE% Writer by clicking on the words that should appear in the + index. If the document is large, or if you have to generate indices for several documents, this task should be automated.
Adapting to EurolandMost of the members of the European Union will abandon - their old currency in favor of the new Euro in 2001. This requires + Most of the members of the European Union will abandon + their old currency in favor of the new Euro in 2001. This requires modifications to all programs using the old currencies. Since the exchange - rates for the old currencies have been fixed at the end of 1999, one can - already convert old data. The following program does this for all values + rates for the old currencies have been fixed at the end of 1999, one can + already convert old data. The following program does this for all values in a table that are formatted with the currency string DM.
Import/Export of ASCII FilesYou can use the drawing facilities of StarOffice API - to generate a picture from ASCII input. One application would be a - hierarchical representation of a directory listing, based on textual + You can use the drawing facilities of StarOffice API + to generate a picture from ASCII input. One application would be a + hierarchical representation of a directory listing, based on textual data.
Stock Quotes UpdaterIf you want to display stock charts for certain - companies, you can open up your browser every day, go to a search engine, - look up the quote and copy it by hand into a table. Or you can use a - program that does all this automatically. The following example relies on - the sheet module. It uses URLs to obtain the current stock quotes. The - quotes are displayed in sheets, one for each company. We show a line - diagram and the numerical values for this company on every sheet. The - functionality is hidden in the three subroutines GetValue(), + If you want to display stock charts for certain + companies, you can open up your browser every day, go to a search engine, + look up the quote and copy it by hand into a table. Or you can use a + program that does all this automatically. The following example relies on + the sheet module. It uses URLs to obtain the current stock quotes. The + quotes are displayed in sheets, one for each company. We show a line + diagram and the numerical values for this company on every sheet. The + functionality is hidden in the three subroutines GetValue(), UpdateValue(), and UpdateChart().
Forms and ControlsThe example document Burger Factory offers some forms - and controls, which you can use to order your desired burger type, - beverage, topping, and sauce. By hitting the button + The example document Burger Factory offers some forms + and controls, which you can use to order your desired burger type, + beverage, topping, and sauce. By hitting the button "Order now!", your order will be placed.
+
- + - + +
Additional information: OpenOffice.org %PRODUCT_RELEASE% Basic language binding -
- + - - + - + - - + - +
+
- + - +
Object Linking and Embedding (OLE) examples
@@ -693,61 +691,61 @@ - - + - - +
ActiveX ControlThe ActiveX control shows an example of access to UNO - through COM technology. It requires a properly installed StarOffice - version 6.0 or OpenOffice 1.0 or newer. This is a Lite ActiveX control - so it can be used only in containers that allow the use of such controls. - It can be activated with an <OBJECT> tag from a html-page to embed - a document. Without any parameters a new writer document will be opened + The ActiveX control shows an example of access to UNO + through COM technology. It requires a properly installed StarOffice + version 6.0 or OpenOffice 1.0 or newer. This is a Lite ActiveX control + so it can be used only in containers that allow the use of such controls. + It can be activated with an <OBJECT> tag from a html-page to embed + a document. Without any parameters a new writer document will be opened for editing. For more details please see the README.
- Note: This example works only under windows and if you don't use the MS - .Net C++ compiler please check the makefile and take notice of the + Note: This example works only under windows and if you don't use the MS + .Net C++ compiler please check the makefile and take notice of the comments.
WriterDemoThis Visual Basic Script creates an empty text + This Visual Basic Script creates an empty text document and inserts text, a table, and a text frame.
+
- + - + +
Additional information: Automation Language Binding -
- + - - + - + - - + - +
+
- + - +
Common Language Infrastructure (CLI) examples
@@ -759,42 +757,42 @@ - + - - +
Spreadsheet Example This example is written in C# and shows how Spreadsheet - documents are created and filled with content. This example actually - consists of three separate executables, SpreadsheetSample.exe, + documents are created and filled with content. This example actually + consists of three separate executables, SpreadsheetSample.exe, GeneralTableSample.exe, ViewSample.exe.
WriterDemoThis example is written in VB.NET. It creates a text + This example is written in VB.NET. It creates a text document and inserts text, a table, and a text frame.
+
- + - + +
Additional information: CLI-UNO Language Binding -
- + - + - - + +

Copyright © 2010, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.

-- cgit