<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
The module is an implementation of the
<api name="org.netbeans.modules.editor.settings"type="import" group="java" category="private">Editor Settings API</api>
providing a settings storage on the default filesystem.
</answer>
<p>
The <code>editor/settings/storage</code> module provides friend
<api name="EditorSettingsStorageAPI" group="java"type="export" category="friend" />
comprising classes in the <code>org.netbeans.modules.editor.settings.storage.api</code>
package. It also defines the structure of the settings storage and the structure
of XML files with settings. The following XML files are supported.
</p>
<ul>
<li>Fonts & Colors - contains colorings that define various attributes
for rendering text tokens in the editor.<br/>
<api name="EditorFontsColors-1_1.dtd" group="dtd"type="export" category="official"url="http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd"><code>-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN</code></api>
</li>
<li>Key Bindings - contains definitions of keyboard shortcust and their
associated editor actions.<br/>
<api name="EditorKeyBindings-1_1.dtd" group="dtd"type="export" category="official"url="http://www.netbeans.org/dtds/EditorKeyBindings-1_1.dtd"><code>-//NetBeans//DTD Editor KeyBindings settings 1.1//EN</code></api>
</li>
</ul>
<h2>Profiles and setting folders</h2>
<p>
The setting files are stored in <code>MimeLookup</code> in the folders hierarchy
under the <code>Editors/</code> folder on the default filesystem. The storage follows
the main principle of <code>MimeLookup</code> and allows to define mime type
specific settings as well as settings that apply for all editors. This is achieved
by placing the setting files in the appropriate folder (i.e. in the mime type
folder such as <code>Editors/<mime-type></code> or in the <code>Editors/</code>
folder itself for the global settings).
</p>
<p>
No matter whether the files are stored in <code>Editors/</code> or in a mime type
specific folder their further position relative to that folder and their meaning
is the same.
</p>
<p>
Both font & colors and key bindings are grouped in so called profiles that
allow user switching quickly between predefined sets of colorings or key bindings. An
example of profiles can be key bindings for NetBeans, Eclipse and Emacs. Each of those
profiles defines keyboard shortcuts for IDE actions that are known from other products.
Another example is the profiles defining normal and inverse color schemes.
In Netbeans they are called NetBeans and CityLights.
</p>
<p>
The <code>editor/settings/storage</code> module dedicates a special folder for
each profile and stores all the profile related files in that folder.
</p>
<h3>Special profiles and mime types</h3>
<p>
The module provides a special treatment for profiles with names starting with
the <code>"test"</code> string. These profiles are handled as a temporary in-memory
profiles, which are not persisted to the disk. They are mainly used for 'preview'
purposes in the Options dialog.
</p>
<p>
The module also recognizes special mime paths, which <code>String</code> representation
starts with the <code>"test*_"</code> string (e.g. <code>"test123ed_text/x-java"</code>)
and provides MimeLookup for those mime paths. The contents of MimeLookup for those
special mime paths is basically the same as MimeLookup for the mime path without the
leading <code>test*_</code> string, but it contains <code>FontColorsSettings</code>
and <code>KeyBindingSettings</code> instances specially constructed for the 'test'
mime type. Again this is mainly used for 'preview' purposes by the Options dialog.
</p>
<p>
Since this functionality is defacto an API it is being tracked as
<api name="SpecialProfilesAndMimeTypesAPI" category="friend" group="java"type="export" />.
</p>
<h2>User changes and defaults</h2>
<p>
The editor settings storage is organized in the way that allows storing user
changes separately from the default values provided by modules. This is useful
when a users wants to reset their profiles back to the original values shipped
with the product. This is achieved by defining a special subfolder called
<code>Defaults</code> for every profile. The default colorings and key bindings
provided by modules are then registered in this <code>Defaults</code> subfolder
while user changes are stored directly in the profile's folder. When restoring the
original values the files with user changes are simply deleted and the profile
is reloaded from the default files.
</p>
<h3>Font & color files</h3>
<p><b>Since version1.10</b> the storage module does not require coloring files to be
called any special name. The coloring profiles and files are expected to be
registered by modules under a special folder called <code>FontsColors</code>. The
structure below shows an example of registering several different coloring files
for all editors and the text/x-java mime type.
</p>
<p>
In order to distinguish files containing token-related colorings from those
with highlight-related colorings the storage module recognizes a special file
attribute called <code>nbeditor-settings-ColoringType</code>, which value can
either be <code>token</code> or <code>highlight</code>. If a coloring file does
not specify this attribute it is automatically expected to contain token-related
colorings.
</p>
<p>
Generally, the files with default values are stored in <code>Defaults</code>
subfolders while the files with user changes are stored directly in the
profile's folder.
</p>
<p>
The default profile for font & colors is called 'NetBeans'.
</p>
<p><b>Prior to version1.10</b> the storage module expected colorings in the
three different types of files. They are still recognized to support
backwards compatibility, but modules are suggusted to use the new registration
scheme. All of those three files had the same structure, but different purpose.
</p>
<ul>
<li>
<code>coloring.xml</code> - defines colorings used for rendering tokens from
a particular language (i.e. mime type).
</li>
<li>
<code>defaultColoring.xml</code> - defines language neutral colorings, which
can be used as fallback for language specific colorings. This file can only
be specified in the <code>Editors/<profile-name>/Defaults</code> folders.
If specified in a mime type subfolder it will be ignored.
</li>
<li>
<code>editorColoring.xml</code> - defines colorings that do not apply for
tokens. These colorings define for example the color for highlighting the row
with a caret, etc. They are not mime type specific and can only be specified
in the <code>Editors/<profile-name>/Defaults</code> folders.
If specified in a mime type subfolder it will be ignored.
</li>
</ul>
<h3>Key bindings files</h3>
<p>
<b>Since version1.10</b> modules can provide their keybindings in multiple files
placed under the special folder called <code>Keybindings</code> and its profiles'
subfolders. Similarily as for colorings the files with default key bindings are stored in <code>Defaults</code>
subfolder and user changes are stored in files directly in the profile's folder.
The example below shows registration of several keybinding files for all editors
and the text/x-java mime type.
</p>
<p>
<b>Prior to version1.10</b> the default profile for key bindings, called NetBeans,
had not been stored in its own folder. Therefore the default key bindings for
the NetBeans profile used to be stored directly in
<code>Editors/<mime-type>/Defaults/keybindings.xml</code> and similarily
user changes used to be stored in <code>Editors/<mime-type>/keybindings.xml</code>.
This has been deprecated, but is still supported for backwards compatibility reasons.
</p>
<p>
Also the special mime type called <code>text/base</code>, has been deprecated
and should not be used anymore. It is however still supported to preserve
backwards compatibility.
</p>
<h2>Platform specific settings</h2>
<p>
<b>Since 1.10</b> it is possible to mark setting files as applicable only on a certain
platform (a.k.a. operating system). This was mainly introduced for keybindings,
which are generally platform sensitive settings, but can be used for any other
setting type supported by the storage module.
</p>
<p class="nonnormative">
Some platforms (eg. Mac) define their own special rules for the use of some
combinations of keystrokes (eg. ctrl+Q closes the app) that applications on that
platform have to obey. NetBeans mitigates this problem by introducing a special
module ide/applemenu, which is only loaded on Mac and which overrides
<code>keybindings.xml</code> files provided by some Netbeans modules (eg. editor and java).
This approach works albeit some severe limitations. However with introducing
multiple setting files this would no longer be practical, which is why platform
specific settings have been introduced.
</p>
<p>
The storage module recognizes a special file attribute for marking
platform specific setting files called <code>nbeditor-settings-targetOS</code>.
The rules for its use follow.
</p>
<ul>
<li>
Any file that does not define <code>nbeditor-settings-targetOS</code> is loaded
on all platforms. All such files will be loaded exactly in the same order as
they appear on the system filesystem.
</li>
<li>
If a file defines <code>nbeditor-settings-targetOS</code> attribute, but its
value does not correspond to the current Operating System, the file is ignored.
</li>
<li>
If a file defines <code>nbeditor-settings-targetOS</code> attribute and its
value designates the current Operating System, the file will be loaded.
Furthermore, any such a file will be loaded <b>after</b> other files in the
same folder that do not define this attribute and therefore its settings will
<b>override</b> settings from those other files.
</li>
<li>
If there is more files that define <code>nbeditor-settings-targetOS</code>
attribute and are eligible for loading on the current Operating System,
they will be loaded in the same order as they appear on the system filesystem.
</li>
</ul>
<p>
The available values that can be used for the <code>nbeditor-settings-targetOS</code>
attribute are the string names of the <code>OS_*</code> constants in <code>org.openide.util.Utilities</code>
class. So, for example the following file will only be loaded on MacOS and its settings
will override settings from all other files that do not specify the target OS attribute.
</p>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
There are unit tests available covering the module's functionality.
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
The modules is available in CVS trunk.
</answer>
<usecase id="new-options-dialog" name="New Options Dialog">
<p>
The friend API provided by this module is used only by the new options dialog. It
is not expected to have any other clients or users. The API gives the options
dialog a read/write access to the editor settings storage allowing it to implement
UI for maintaining the settings.
</p>
</usecase>
<usecase id="defining-a-coloring" name="Defining a coloring">
<p>
Various modules need to provide predefined font a colors for text tokens from
languages they support. An example of such a module is <code>java/editor</code>
which defines colorings for tokens in java files. Defining colorings is as simple
as writing an XML file with the appropriate information. The example below shows
how to do that.
</p>
<usecase id="defining-a-key-binding" name="Defining a key binding">
<p>
As well as providing predefined colorings modules need to provide predefined
key bindings. This can be accomplished by writing another simple XML file.
</p>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
The module stores settings in its own XML files in the folders hierarchy under
the <code>Editors</code> folder on the default file system. Changes in
settings are stored as differences from the default values.
</p>
<p>
The legacy settings are not handled by this module. The editor module itself
supports the legacy settings and combines them with the new ones.
</p>
</answer>
<!-- <questionid="dep-jre"when="final"> WhichversionofJREdoyouneed(1.2,1.3,1.4,etc.)? <hint> Itisexpectedthatifyourmodulerunson1.xthatitwillrun on1.x+1ifno,statethatplease.Alsodescribeherecaseswhere yourundifferentcodeondifferentversionsofJREandwhy. </hint> </question>
-->
<answer id="dep-jre">
JDK1.4 and higher can be used.
</answer>
<!-- <questionid="deploy-packages"when="init"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>).Ifyoudonotrestrictaccesstoyourclassesyouare makingittooeasyforotherpeopletomisuseyourimplementation details,thatiswhyyoushouldhavegoodreasonfornot restrictingpackageaccess. </hint> </question>
-->
<answer id="deploy-packages">
Yes, only the package with the friend API is public.
</answer>
<!-- <questionid="format-types"when="impl"> Whichprotocolsandfileformats(ifany)doesyourmodulereadorwriteondisk, ortransmitorreceiveoverthenetwork? </question>
-->
<answer id="format-types">
<p>
The module reads and writes XML files in the folders hierarchy under the
<code>Editors</code> folder on the default filesystem. The structure of the files
is governed by the following DTDs.
</p>
<ul>
<li><a href="http://www.netbeans.org/dtds/EditorFontsColors-1_1.dtd">-//NetBeans//DTD Editor Fonts and Colors settings 1.1//EN</a></li>
<li><a href="http://www.netbeans.org/dtds/EditorKeyBindings-1_1.dtd">-//NetBeans//DTD Editor KeyBindings settings 1.1//EN</a></li>
</ul>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract. </hint> </question>
-->
<answer id="lookup-lookup">
Yes. module creates a new MimeDataProvider and plug it into the MimeLookup. Also EditorSettings
implementation is registered into default lookup.
</answer>
<!-- <questionid="lookup-register"when="final"> Doyouregisteranythingintolookupforothercodetofind? <hint> Doyouregisterusinglayerfileorusing<code>META-INF/services</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
Yes. The implementation of <code>MimeDataProvider</code> is
registered via <code>META-INF/services</code>.
</answer>
<!-- <questionid="perf-scale"when="init"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? <hint> Pleaseincludesomeestimates,thereareothermoredetailed questionstoanswerinlaterphasesofimplementation. </hint> </question>
-->
<answer id="perf-scale">
There is no performance sensitive code in the module.
</answer>
<!-- <questionid="resources-layer"when="final"> Doesyourmoduleprovideownlayer?Doesitcreateanyfilesor foldersinit?Whatitistryingtocommunicatebythatandwithwhich components? <hint> NetBeansallowsautomaticanddeclarativeinstallationofresources bymodulelayers.Moduleregisterfilesintoappropriateplaces andothercomponentsusethatinformationtoperformtheirtask (buildmenu,toolbar,windowlayout,listoftemplates,setof options,etc.). </hint> </question>
-->
<answer id="resources-layer">
Yes. The layer is used for registering DTDs in the Netbeans catalog and MIME type
resolvers for editor settings files.
</answer>
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.44Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.