站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 5.5.1

Overview (NetBeans Editor Settings) - NetBeans API Javadoc 5.5.1

org.netbeans.modules.editor.settings/1 1.4.31

NetBeans Editor Settings

See:
          Description

Editor Settings
org.netbeans.api.editor.settings  

 

It is a module located under /cvs/editor/settings directory.

It consists of

Editor Settings module defines EditorSettingsAPI.

API contains abstract classes, responsible for particular editor settings:

The particular mime-type settings can be found for example using the following mimelookup search:
FontColorSettings fcs = (FontColorSettings) MimeLookup.getMimeLookup("text/x-java").lookup(FontColorSettings.class);

The Javadoc documentation can be generated by using

    cd /cvs/editor/settings
    ant javadoc

What is New (see all changes)?

Use Cases

Per mime-type operation
The particular mime-type settings can be found for example using the following mimelookup search:
FontColorSettings fcs  = (FontColorSettings) MimeLookup.getMimeLookup("text/x-java").lookup(FontColorSettings.class);
AttributeSet fontColors = fcs.getFontColors(FontColorNames.SELECTION_COLORING);
This will resolve Fonts ant Colors settings of the coloring used for selection for the mime-type "text/x-java" in AttributeSet representation.
Listening on settings change
Settings clients often need to be able to listen on the settings change and handle this event. This can be done using mimelookup via Lookup.Template by registering LookupListener on the returned Lookup.Result.
LookupResult fontsColors  = MimeLookup.getMimeLookup("text/x-java").lookup(
    new Lookup.Template(FontColorSettings.class));
if (fontsColors !=null) {
    fontsColors.addLookupListener(new LookupListener(){
        public void resultChanged(LookupEvent ev) {
            Lookup.Result result = ((Lookup.Result)ev.getSource());
            //... settings client response on settings change
        }
    });
}

FontColorSettings implementor is responsible of creation of new instance of FontColorSettings if some setting will change in the lookup, it provides.

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
EditorSettingsAPIExportedOfficial

Implementation Details

What do other modules need to do to declare a dependency on this one?
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.editor.settings/1 > 1.4.31

Read more about the implementation in the answers to architecture questions.


org.netbeans.modules.editor.settings/1 1.4.31

Built on March 26 2007.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.