Java Doc for Settings.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » abeille forms designer » org.netbeans.editor 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.editor.Settings

All known Subclasses:   org.netbeans.editor.ext.java.JavaSettingsInitializer,  org.netbeans.editor.ext.ExtSettingsInitializer,  org.netbeans.editor.BaseSettingsInitializer,  org.netbeans.editor.ext.html.HTMLSettingsInitializer,
Settings
public class Settings (Code)
Configurable settings that editor uses. All the methods are static The editor is configurable mainly by using the following static method in Settings class: org.netbeans.editor.Settings.setValue(Class kitClass, String settingName, Object newValue); kitClass - this is the class of the editor kit for which the setting is changed. The current hierarchy of editor kits starts with the org.netbeans.editor.BaseKit kit, the begining of the whole kit hierarchy. There should be a different editor kit for each mime-type. When the particular setting is not set for a given kit, then the superclass of the given kit class is retrieved and the search for the setting value is performed. Example: If the java document calls Settings.getValue() to retrieve the value for TAB_SIZE setting and it passes JavaKit.class as the kitClass parameter and the setting has no value on this level, then the super class of the JavaKit is retrieved (by using Class.getSuperclass() call) which is BaseKit in this case and the search for the value of TAB_SIZE setting is performed again. It is finished by reaching the null value for the kitClass. The null value can be also used as the kitClass parameter value. In a more general look not only the kit-class hierarchy could be used in Settings. Any class inheritance hierarchy could be used here having the null as the common root. This way the inheritance of the setting values is guaranteed. By changing the setting value on the BaseKit level (or even on the null level), all the kit classes that don't override the particular setting are affected. settingName - name of the setting to change. The base setting names are defined as public String constants in SettingsNames class. The additional packages that extend the basic editor functionality can define additional setting names. newValue - new value for the setting. It must be always an object even if the setting is logicaly the basic datatype such as int (java.lang.Integer would be used in this case). A particular class types that can be used for the value of the settings are documented for each setting. WARNING! Please read carefully the description for each option you're going to change as you can make the editor stop working if you'll change the setting in a wrong way.
author:
   Miloslav Metelka
version:
   1.00

Inner Class :public static class KitAndValue
Inner Class :public static interface Initializer
Inner Class :abstract public static class AbstractInitializer implements Initializer
Inner Class :public static interface InitializerSorter
Inner Class :abstract public static class FilterInitializerSorter
Inner Class :public static interface Evaluator
Inner Class :public static interface Filter

Field Summary
final public static  intCORE_LEVEL
     Core level used by the settings initializers.
final public static  intEXTENSION_LEVEL
     Extension level used by the settings initializers.
final public static  intOPTION_LEVEL
     Option level used by the settings initializers.
final public static  intSYSTEM_LEVEL
     System level used by the settings initializers.
final public static  intUSER_LEVEL
     User level used by the settings initializers.


Method Summary
public static synchronized  voidaddFilter(Filter f)
     Add filter instance to the list of current filters.
public static synchronized  voidaddInitializer(Initializer i)
     Add the initializer at the system level and perform reset.
public static synchronized  voidaddInitializer(Initializer i, int level)
     Add initializer instance to the list of current initializers.
public static  voidaddSettingsChangeListener(SettingsChangeListener l)
     Add weak listener to listen to change of any property.
public static synchronized  InitializerSortergetInitializerSorter()
     Get the current initializer sorter.
public static  ObjectgetValue(Class kitClass, String settingName)
     Get the value and evaluate the evaluators.
public static synchronized  ObjectgetValue(Class kitClass, String settingName, boolean evaluateEvaluators)
     Get the property by searching the given kit class settings and if not found then the settings for super class and so on.
Parameters:
  kitClass - editor kit class for which the value of setting should beretrieved.
public static  KitAndValue[]getValueHierarchy(Class kitClass, String settingName)
    
public static synchronized  KitAndValue[]getValueHierarchy(Class kitClass, String settingName, boolean evaluateEvaluators)
     Get array of KitAndValue objects sorted from the given kit class to its deepest superclass and the last member can be filled whether there is global setting (kit class of that member would be null).
public static synchronized  StringinitializersToString()
    
public static synchronized  voidpropagateValue(Class kitClass, String settingName, Object newValue)
     Set the value for the current kit and propagate it to all the children of the given kit by removing the possible values for the setting from the children kit setting maps.
public static synchronized  voidremoveFilter(Filter f)
    
public static synchronized  voidremoveInitializer(String name)
     Remove the initializer of the given name from all the levels where it occurs.
public static  voidremoveSettingsChangeListener(SettingsChangeListener l)
    
public static synchronized  voidreset()
     Reset all the settings and fire the change of the settings so that all the listeners will be notified and will reload the settings.
public static synchronized  voidsetInitializerSorter(InitializerSorter initializerSorter)
     Set the current initializer sorter.
public static synchronized  voidsetValue(Class kitClass, String settingName, Object newValue)
     Set the new value for property on kit level.
public static synchronized  voidtouchValue(Class kitClass, String settingName)
     Don't change the value of the setting, but fire change event.
public static synchronized  voidupdate(Runnable r)
     Run the given runnable.

Field Detail
CORE_LEVEL
final public static int CORE_LEVEL(Code)
Core level used by the settings initializers. This is the level used for the base and ext editor packages initializers only.



EXTENSION_LEVEL
final public static int EXTENSION_LEVEL(Code)
Extension level used by the settings initializers. This is the second level. It should be used by all the modules that want to extend or modify the settings but they don't install their own kits. The example can be a module extending the popup menu of an existing kit.



OPTION_LEVEL
final public static int OPTION_LEVEL(Code)
Option level used by the settings initializers. This is the third level. It should be used by the visual options created by the IDE.



SYSTEM_LEVEL
final public static int SYSTEM_LEVEL(Code)
System level used by the settings initializers. This is the (default) first level. It should be used by all the modules that install the new kits into the editor.



USER_LEVEL
final public static int USER_LEVEL(Code)
User level used by the settings initializers. This is the fourth level. All the initializers with this level will be called AFTER all the initializers at the system level. All the user custom initializers should be added at this level to guarantee they will overwrite the settings added by the system.





Method Detail
addFilter
public static synchronized void addFilter(Filter f)(Code)
Add filter instance to the list of current filters. If there are already existing editor components, and you want to apply the changes that this filter makes to these existing components, you can call reset(). However all the changes that were made explicitly by calling setValue() will be lost in this case.
Parameters:
  f - filter to add to the list of the filters



addInitializer
public static synchronized void addInitializer(Initializer i)(Code)
Add the initializer at the system level and perform reset.



addInitializer
public static synchronized void addInitializer(Initializer i, int level)(Code)
Add initializer instance to the list of current initializers. You can call reset() after adding the initializer to make sure it will update the current settings with its values. However all the changes that were made explicitly by calling setValue() will be lost in this case.
Parameters:
  i - initializer to add to the current list of initializers
Parameters:
  level - initializer level. It defines in which order the initializerswill be called. There are currently three levelsCORE_LEVEL, SYSTEM_LEVEL andUSER_LEVEL. It's guaranteed that initializers withthe particular level will be called in the order shown above.The order of the initializers at the same level is given bythe order of their addition.



addSettingsChangeListener
public static void addSettingsChangeListener(SettingsChangeListener l)(Code)
Add weak listener to listen to change of any property. The caller must hold the listener object in some instance variable to prevent it from being garbage collected.



getInitializerSorter
public static synchronized InitializerSorter getInitializerSorter()(Code)
Get the current initializer sorter.



getValue
public static Object getValue(Class kitClass, String settingName)(Code)
Get the value and evaluate the evaluators.



getValue
public static synchronized Object getValue(Class kitClass, String settingName, boolean evaluateEvaluators)(Code)
Get the property by searching the given kit class settings and if not found then the settings for super class and so on.
Parameters:
  kitClass - editor kit class for which the value of setting should beretrieved. The null can be used as the root of the wholehierarchy. (which is top of kit class hierarchy) before theprocessing begins.
Parameters:
  settingName - name of the setting for which the value should be retrieved the value of the setting



getValueHierarchy
public static KitAndValue[] getValueHierarchy(Class kitClass, String settingName)(Code)
Get the value hierarchy and evaluate the evaluators



getValueHierarchy
public static synchronized KitAndValue[] getValueHierarchy(Class kitClass, String settingName, boolean evaluateEvaluators)(Code)
Get array of KitAndValue objects sorted from the given kit class to its deepest superclass and the last member can be filled whether there is global setting (kit class of that member would be null). This method is useful for objects like keymaps that need to create all the parent keymaps to work properly. The method can either evaluate evaluators or leave them untouched which can become handy in some cases.
Parameters:
  kitClass - editor kit class for which the value of setting should beretrieved. The null can be used as the root of the wholehierarchy.
Parameters:
  settingName - name of the setting for which the value should be retrieved
Parameters:
  evaluateEvaluators - whether the evaluators should be evaluated or not the array containing KitAndValue instances describing theparticular setting's value on the specific kit level.



initializersToString
public static synchronized String initializersToString()(Code)
Debug the current initializers



propagateValue
public static synchronized void propagateValue(Class kitClass, String settingName, Object newValue)(Code)
Set the value for the current kit and propagate it to all the children of the given kit by removing the possible values for the setting from the children kit setting maps. Note: This call only affects the settings for the kit classes for which the kit setting map with the setting values currently exists, i.e. when there was at least one getValue() or setValue() call performed for any setting on that particular kit class level. Other kit classes maps will be initialized by the particular initializer(s) as soon as the first getValue() or setValue() will be performed for them. However that future process will not be affected by the current propagateValue() call. This method is useful for the visual options that always set the value on all the kit levels without regard whether it's necessary or not. If the value is then changed for the base kit, it's not propagated naturally as there's a special setting This method enables The current implementation always fires the change regardless whether there was real change in setting value or not.
Parameters:
  kitClass - editor kit class for which the value of setting should be set.When given null, it's automatically set to BaseKit.class(which is top of kit class hierarchy) before the processingbegins. Therefore you get exactly the same results forkitClass == null and kitClass == BaseKit.class.
Parameters:
  settingName - the string used for searching the value
Parameters:
  newValue - new value to set for the property; the value can be null toclear the value for the specified kit



removeFilter
public static synchronized void removeFilter(Filter f)(Code)



removeInitializer
public static synchronized void removeInitializer(String name)(Code)
Remove the initializer of the given name from all the levels where it occurs.
Parameters:
  name - name of the initializer sorter to remove.



removeSettingsChangeListener
public static void removeSettingsChangeListener(SettingsChangeListener l)(Code)
Remove listener for changes in properties



reset
public static synchronized void reset()(Code)
Reset all the settings and fire the change of the settings so that all the listeners will be notified and will reload the settings. The settings that were changed using setValue() and propagateValue() are lost. Initializers will be asked for the settings values when necessary.



setInitializerSorter
public static synchronized void setInitializerSorter(InitializerSorter initializerSorter)(Code)
Set the current initializer sorter.



setValue
public static synchronized void setValue(Class kitClass, String settingName, Object newValue)(Code)
Set the new value for property on kit level. The old and new values are compared and if they are equal the setting is not changed and nothing is fired.
Parameters:
  kitClass - editor kit class for which the value of setting should be set.The null can be used as the root of the whole hierarchy.
Parameters:
  settingName - the string used for searching the value
Parameters:
  newValue - new value to set for the property; the value can be null toclear the value for the specified kit



touchValue
public static synchronized void touchValue(Class kitClass, String settingName)(Code)
Don't change the value of the setting, but fire change event. This is useful when there's internal change in the value object of some setting.



update
public static synchronized void update(Runnable r)(Code)
Run the given runnable. All the changes in the settings are not fired until the whole runnable completes. Nesting of update() call is allowed. Only one firing is performed after the whole runnable completes using the 'null triple'.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.