Trace: » resource_bundles » nsc_200_controllers » example_of_a_class_which_implements_the_schedulable_interface » laser » output » threads » plugins » cookies » userdir » xml_layer
XML layer basics
All the XML layers taken together make up the System Filesystem
Every single module in NetBeans has its own layer.xml file, which is a piece of xml.
At runtime, NetBeans merges xml files (pieces) into one large xml file, in the order in which the files are compiled (starting from the first, and in the order of inclusion).
Evidence of the existence of the XML layer
Go to your module/Important Files/XML Layer. <this layer> is the current layer (which might be empty), and <this layer in context> has the large xml file.
If you want to see how the menu bar is made to look the way it looks, go to your module/Important Files/XML Layer/<this layer in context>/Menu Bar/ Expand these trees and you can see how the appearance of the menus is set up, including separators etc.
Instance Files : <instance of myClass>
An .instance file represents an instance of a class. The file is in the System Filesystem
The layer.xml may contain an .instance file. For example, if a class which defines an action needs to be instantiated because that action must be made available in some menus by clicking on menu items, you'll see a .instance file.
Syntax If your class is in path /motion/newport/nsa12/StageControlAction.java then a .instance file is called :
<file name="motion-newport-nsa12-StageControlAction.instance"> <attr name="SystemFileSystem.localizingBundle" stringvalue="motion.newport.nsa12.Bundle"/> </file>
Settings Files
Settings files represent a class, and know the interfaces which this class implements. The class does not need to be instantiated in order to ask it what interfaces it implements, because the Settings file can be queried instead and it knows. In NetBeans, .settings files help to reduce the number of classes which have to be instantiated when all that's needed from them is information about their interfaces and parents.
NetBeans Wiki: DevFaqDotSettingsFiles
A .settings file may look like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE settings PUBLIC '-//NetBeans//DTD Session settings 1.0//EN' 'http://www.netbeans.org/dtds/sessionsettings-1_0.dtd'> <settings> <module name="digitizer"/> <instanceof class="digitizer.Digitizer"/> <instance class="digitizer.lecroy.DigitizerImpLeCroyXStream" method="create"/> </settings>
Shadow Files
.shadow files are similar to symbolic links. When NetBeans needs to put the same file in multiple places of the System Filesystem, it makes shadows of the file and puts those in place. A .shadow file is a link to another, existing file.
You can make a shadow of any file, System Filesystem files and real files included. For example:
<folder name="Actions"> <folder name="Window"> <file name="motion-newport-nsa12-StageControlAction.instance"> <attr name="SystemFileSystem.localizingBundle" stringvalue="motion.newport.nsa12.Bundle"/> </file> </folder> </folder> <folder name="Menu"> <folder name="Window"> <file name="StageControlAction.shadow"> <attr name="originalFile" stringvalue="Actions/Window/motion-newport-nsa12-StageControlAction.instance"/> </file> </folder> </folder> <folder name="Windows2"> <folder name="Components"> <file name="StageControlTopComponent.settings" url="StageControlTopComponentSettings.xml"/> </folder> <folder name="Modes"> <folder name="leftSlidingSide"> <file name="StageControlTopComponent.wstcref" url="StageControlTopComponentWstcref.xml"/> </folder> </folder> </folder>
Neurospy-Specify File Types
.connect
Other file types
All these files are written in xml, but they are of various types. XML file types are different from each other in the tags which they define.
The file types /.wsmode/, /.wstcref/ and /.wswmgr/ have the “ws” in common. Their file type is “ws”+other string; the other string also appears in the xml file itself and is the doc type. Look for “mode”, “tc-ref” and “wmgr” below.
.wstcref : Top Component Reference File
If you make a TopComponent with a wizard in NetBeans, it will generate a .wstcref file which will get inserted in the System Filesystem at /Modes/leftSlidingSide/yourthing.wstcref, or in /Modes/rightslidingside or wherever you decide to put it. The /Modes/ tree in the System Filesystem contains many .wstcref files, for example, for output, editor, explorer, properties, navigator etc.
the file may look like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0" > <module name="motion.newport.nsa12" spec="1.0"/> <tc-id id="StageControlTopComponent"/> <state opened="true"/> </tc-ref>
.wsgrp: Group files
Group files can be found in /Groups/
.wsmode files
Example:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mode PUBLIC "-//NetBeans//DTD Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/mode-properties2_0.dtd"> <mode version="2.0"> <name unique="navigator" /> <kind type="view" /> <state type="joined" /> <constraints> <path orientation="vertical" number="20" weight="0.7" /> <path orientation="horizontal" number="20" weight="0.32" /> <path orientation="vertical" number="60" weight="0.5" /> </constraints> <relative-bounds x="10" y="43" width="35" height="45" /> <active-tc id="navigatorTC" /> <empty-behavior permanent="true" /> </mode>
.wswmgr : Window Manager files
This file is in /Modes/WindowManager.wswmgr and can be used to edit window properties.