Difference between revisions of "Documentation/DevGuide/Spreadsheets/Settings"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial author Sun Microsystems, Inc.)
 
(Added Java syntax highlight)
(4 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/Spreadsheets/Spreadsheet Document Controller
 
|NextPage=Documentation/DevGuide/Spreadsheets/Spreadsheet Document Controller
 
}}
 
}}
{{DISPLAYTITLE:Settings}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Spreadsheets/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Settings}}
 
<!--<idltopic>com.sun.star.sheet.GlobalSheetSettings</idltopic>-->
 
<!--<idltopic>com.sun.star.sheet.GlobalSheetSettings</idltopic>-->
 
The <idl>com.sun.star.sheet.GlobalSheetSettings</idl> service contains settings that affect the whole spreadsheet application. It can be instantiated through the service manager. The properties are accessed using the <idl>com.sun.star.beans.XPropertySet</idl> interface.
 
The <idl>com.sun.star.sheet.GlobalSheetSettings</idl> service contains settings that affect the whole spreadsheet application. It can be instantiated through the service manager. The properties are accessed using the <idl>com.sun.star.beans.XPropertySet</idl> interface.
Line 13: Line 14:
 
The following example gets the list of user-defined sort lists from the settings and displays them:  
 
The following example gets the list of user-defined sort lists from the settings and displays them:  
 
<!--[SOURCE:Spreadsheet/SpreadsheetSample.java]-->
 
<!--[SOURCE:Spreadsheet/SpreadsheetSample.java]-->
 
+
<source lang="java">
 
   // --- Get the user defined sort lists ---
 
   // --- Get the user defined sort lists ---
 
   Object aSettings = xServiceManager.createInstance("com.sun.star.sheet.GlobalSheetSettings");
 
   Object aSettings = xServiceManager.createInstance("com.sun.star.sheet.GlobalSheetSettings");
Line 21: Line 22:
 
   System.out.println("User defined sort lists:");
 
   System.out.println("User defined sort lists:");
 
   for (int i=0; i<aEntries.length; i++)
 
   for (int i=0; i<aEntries.length; i++)
       System.out.println( aEntries[i] );  
+
       System.out.println( aEntries[i] ); </source>
  
 
{{PDL1}}
 
{{PDL1}}
[[Category: Spreadsheet Documents]]
+
 
 +
[[Category:Documentation/Developer's Guide/Spreadsheet Documents]]

Revision as of 05:59, 13 January 2013



The com.sun.star.sheet.GlobalSheetSettings service contains settings that affect the whole spreadsheet application. It can be instantiated through the service manager. The properties are accessed using the com.sun.star.beans.XPropertySet interface.

GlobalSheetSettings

The following example gets the list of user-defined sort lists from the settings and displays them:

  // --- Get the user defined sort lists ---
  Object aSettings = xServiceManager.createInstance("com.sun.star.sheet.GlobalSheetSettings");
  com.sun.star.beans.XPropertySet xPropSet = (com.sun.star.beans.XPropertySet)
      UnoRuntime.queryInterface( com.sun.star.beans.XPropertySet.class, aSettings );
  String[] aEntries = (String[]) xPropSet.getPropertyValue("UserLists");
  System.out.println("User defined sort lists:");
  for (int i=0; i<aEntries.length; i++)
      System.out.println( aEntries[i] );
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages