<?xml version="1.0" encoding="UTF-8"?>
<!--
The contents of this file are subject to the terms of the Common Development
and Distribution License (the License). You may not use this file except in
compliance with the License.

You can obtain a copy of the License at http://www.netbeans.org/cddl.html
or http://www.netbeans.org/cddl.txt.

When distributing Covered Code, include this CDDL Header Notice in each file
and include the License file at http://www.netbeans.org/cddl.txt.
If applicable, add the following below the CDDL Header, with the fields
enclosed by brackets [] replaced by your own identifying information:
"Portions Copyrighted [year] [name of copyright owner]"

The Original Software is NetBeans. The Initial Developer of the Original
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Microsystems, Inc. All Rights Reserved.
-->
<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [
  <!ENTITY api-questions SYSTEM "../../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml">
]>

<api-answers
  question-version="1.23"
  module="Window System"
  author="mslama@netbeans.org"
>

  &api-questions;


<!-- Question: arch-what

     <question id="arch-what">
            What is this project good for?
            <hint>
            Please provide here few lines describing the the project, 
            what problem it should solve, provide links to documentation, 
            specifications, etc.
            </hint>
        </question>
 -->
<answer id="arch-what">
Window System API is used to display and control application GUI: Main window,
frames, components.
</answer>


<!--
        <question id="arch-overall" when="init">
            Describe the overall architecture. 
            <hint>
            What will be API for 
            <a href="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi">
                clients and what support API
            </a>? 
            What parts will be plugable.
            How the plugins will registrate. If possible please provide 
            simple diagrams. 
            </hint>
        </question>
-->
<answer id="arch-overall">
<a href="http://core.netbeans.org/windowsystem/redesign.html">Redesign document</a>.
</answer>



<!--
        <question id="arch-time" when="init">
            What are the time estimates of the work?
            <hint>
            Please express your estimates of how long the design, implementation,
            stabilization are likely to last. How many people will be needed to
            implement this and what is the expected milestone the work should be 
            ready.
            </hint>
        </question>
-->
<answer id="arch-time">
November 15 2003.
</answer>



<!--
        <question id="arch-usecases" when="init">
            Describe the main <a href="http://openide.netbeans.org/tutorial/api-design.html#usecase">
            usecases</a> of the new API. Who will use it at
            what circumstances and what will be the typical code to write
            to use the module.
        </question>
-->
<answer id="arch-usecases">
General 
<api group="java" name="Usecases" category="devel" type="export" url="http://core.netbeans.org/windowsystem/changes.html#4" >Use cases</api>
can be read on the <a href="http://core.netbeans.org/windowsystem/changes.html#4">external page</a>. 
Here is a small howto for simple things that may
be found useful:

<usecase id="windowsystem-settings-for-topcomponent" name="How to create a '.settings' file for a TopComponent?" >

Either write it by hand (not that hard if you copy other file and
tweak it to match your TC), or start the IDE, instantiate the TC
somehow (You have a "Window->Show My TC", right? ),
copy the file that gets created in $userdir/config/Windows2Local/Component
and cleanup the serialdata section - replace it with proper  "&lt;instance class='..." /&gt; tag.

</usecase>

<usecase id="windowsystem-groups" name="How to make a TopComponentGroup?" >

<p></p>
    <b>Q:</b> I'm trying to make a TopComponentGroup.  I've just read http://ui.netbeans.org/docs/ui/ws/ws_spec.html#3.9
            I want to make a group that uses the first invocation strategy.  
            That is, I want the group to open/close when I activate a certain subclass of TopComponent.  
            Say, for example, I have a FooTopComponent, and when it's active, 
            I want to open a FooPropertySheetComponent, docked in a mode on the right-hand side.
            I know I have to:

            <ol>
                <li>declare the group in the layer file (Windows2/Groups)</li>
                <li>have code for opening the group</li>
                <li>have code for closing the group</li>
            </ol>
            I think I do #2 in FooTopComponent.componentActivated() and #3 in 
            FooTopComponent.componentDeactivated().  Is that right? 

<p></p>
    <b>A:</b>Yes it is correct way. You can check
    <a href="http://www.netbeans.org/source/browse/platform/samples/window-system-groups/">simple test module</a>.
    First you must get TopComponentGroup instance using find method then call TopComponentGroup.open()/close(). 
    Here is the code in your componentDeactivated method:
    <pre>
   protected void componentDeactivated ()
   {
       // close window group containing propsheet, but only if we're
       // selecting a different kind of TC in the same mode
       boolean closeGroup = true;
       Mode curMode = WindowManager.getDefault().findMode(this);
       TopComponent selected = curMode.getSelectedTopComponent();
       if (selected != null &amp;&amp; selected instanceof FooTopComponent)
           closeGroup = false;
             if (closeGroup)
       {
           TopComponentGroup group = WindowManager.getDefault().findTopComponentGroup(TC_GROUP);
           if (group != null)
           {
               group.close();
           }
       }
   }     
    </pre>

</usecase>

</answer>



<!--
        <question id="perf-spi" when="init">
            How the performance of the plugged in code will be enforced?
            <hint>
            If you allow foreign code to be plugged into your own module, how
            do you enforce, that it will behave correctly and fast and will not
            negatively influence the performance of your own module?
            </hint>
        </question>
-->
<answer id="perf-spi">
There cannot be enforced the performance quality of <code>TopComponent</code> implementation, just could be provided performance
test which could indicate some specific <code>TopComponent</code> instance doesn't fullfil certain performance criteria.
</answer>


<!-- Question: compat-i18n

     <question id="compat-i18n">
            Is your module correctly internationalized?
            <hint>
            Correct internationalization means that it obeys instuctions 
            at <a href="http://www.netbeans.org/devhome/docs/i18n/index.html">
            NetBeans I18N pages</a>.
            </hint>
        </question>
-->
<answer id="compat-i18n">
Yes.
</answer>



<!-- Question: compat-standards

     <question id="compat-standards">
            Does the module implements or defines any standards? Is the 
            implementation exact or it deviates somehow?
        </question>
-->
<answer id="compat-standards">
It follows JLF standard for the custom UI components provided by core implementation.
</answer>



<!-- Question: compat-version

     <question id="compat-version">
            Does your module properly coexists with earlier and future
            versions? Can you correctly read settings? Will future
            versions be able to read settings?
            
            <hint>
            Very helpful for reading settings is to store version number
            there, so future versions can decide whether how to read/convert
            the settings and older versions can ignore the new ones.
            </hint>
        </question>
-->
<answer id="compat-version">
Yes. Module stores its own versioned settings as XML files. In addition
components are stored in settings file format of core/settings module.
For description of current (version 2.0) configuration data folders see
<api group="layer" category="devel" name="NewConfigurationData" type="export" url="http://core.netbeans.org/windowsystem/changes.html#3.4.2" >
new configuration data</api> here
For description of old (version &lt; 2.0) configuration data folders and how they are imported
to new desktop layout see 
<api group="layer" category="deprecated" name="OldConfigurationData" type="export" url="http://core.netbeans.org/windowsystem/changes.html#3.4.6" >
old configuration data </api>
</answer>



<!-- Question: dep-jre

     <question id="dep-jre">
            Which version of JRE you need (1.2, 1.3, 1.4, etc.)?
            <hint>
            It is expected that if your module runs on 1.x that it will run 
            on 1.x+1 if no, state that please. Also describe here cases where
            you run different code on different versions of JRE and why.
            </hint>
        </question>
-->
<answer id="dep-jre">
It runs on JRE 1.4.
</answer>



<!-- Question: dep-jrejdk

     <question id="dep-jrejdk">
            Do you require JDK or is JRE enough?
        </question>
-->
<answer id="dep-jrejdk">
JRE is enough.
</answer>



<!-- Question: dep-nb

     <question id="dep-nb">
            What other NetBeans projects this one depends on?
            <hint>
            If you want, describe such projects as imported API using
            the <code>&lt;api name="identification" type="import or export" category="stable" url="where is the description" /&gt;</code>
            </hint>
        </question>
-->
<answer id="dep-nb">
Module uses following API's:
<ul>
<li>
    <api 
        name="NodesAPI"
        type="import"
        category="official"
        url="@org-openide-nodes@/org/openide/nodes/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="ActionsAPI"
        type="import"
        category="official"
        url="@org-openide-actions@/org/openide/actions/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="ModulesAPI"
        type="import"
        category="official"
        url="@org-openide-modules@/org/openide/modules/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="FilesystemsAPI"
        type="import"
        category="official"
        url="@org-openide-filesystems@/org/openide/filesystems/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="LoadersAPI"
        type="import"
        category="official"
        url="@org-openide-loaders@/org/openide/loaders/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="UtilitiesAPI"
        type="import"
        category="official"
        url="@org-openide-util@/org/openide/util/doc-files/api.html"
        group="java" 
    />
</li>
<li>
    <api 
        name="SettingsAPI"
        type="import"
        category="official"
        url="@org-netbeans-modules-settings@/org/netbeans/spi/settings/doc-files/api.html"
        group="java" 
    />
</li>
</ul>
</answer>



<!-- Question: dep-non-nb

     <question id="dep-non-nb">
            What other non-NetBeans projects this one depends on?
            
            <hint>
            Some non-NetBeans projects are packaged as NetBeans modules
            (see <a href="http://libs.netbeans.org">libraries</a>) and
            it is prefered to use this approach when more modules may
            depend on such third-party library.
            </hint>
        </question>
-->
<answer id="dep-non-nb">
SAX parser is used to parse settings files.
</answer>



<!-- Question: dep-platform

     <question id="dep-platform">
            On which platforms your module run? Any? Does it run in the same
            way?
            <hint>
            If your module is using JNI or deals with special differences of
            OSes like filesystems, etc. please describe here what they are.
            </hint>
        </question>
-->
<answer id="dep-platform">
100% pure Java. Runs anywhere. Swing is used for GUI display.
</answer>



<!-- Question: deploy-jar

     <question id="deploy-jar">
            Do you deploy just module JAR file(s) or some other files?
            <hint>
            If your module consist just from one module JAR file, just confirm that.
            If it uses more than one JAR, describe where there are located, how
            they refer to each other. 
            If it consist of module JAR(s) and other files, please describe
            what is their purpose, why other files are necessary. Please 
            make sure that installation/deinstallation leaves the system 
            in state as it was before installation.
            </hint>
        </question>
-->
<answer id="deploy-jar">
Module API is part of openide.jar, implementation is mostly in core-windows.jar. Module 
API also contains dummy implementation usable for tests.
</answer>



<!-- Question: deploy-nbm

     <question id="deploy-nbm">
            Can you deploy NBM via AutoUpdate center?
            <hint>
            If not why?
            </hint>
        </question>
-->
<answer id="deploy-nbm">
Whole openide.jar and core-windows.jar can be deployed via AU center.
</answer>



<!-- Question: deploy-packages

     <question id="deploy-packages">
            Are packages of your module made inaccessible by not declaring them
            public?
            
            <hint>
            NetBeans module system allows restriction of access rights to
            public classes of your module from other modules. This prevents
            unwanted dependencies of others on your code and should be used
            whenever possible (<a href="http://www.netbeans.org/download/apis/org/openide/doc-files/upgrade.html#3.4-public-packages">
            public packages
            </a>). 
            </hint>
        </question>
-->
<answer id="deploy-packages">
No. Window System API contains
<api group="java" name="WindowSystemAPI" type="export" category="official" url="@TOP@/org/openide/windows/doc-files/api.html"/>.
Some parts of core can use semi-private API <api group="java" name="WindowSystemImplementationAPI" type="export" category="friend"/>.
</answer>



<!-- Question: deploy-shared

     <question id="deploy-shared">
            Do you need to be installed in shared location or only in user directory?
            <hint>
            Installation location shall not matter, if it does explain why.
            </hint>
        </question>
-->
<answer id="deploy-shared">
openide.jar and core-windows.jar needs to be in the system directory.
</answer>

<!--
        <question id="deploy-dependencies">
            What do other modules need to do to declare a dependency on this one?
            <hint>
                Provide a sample of the actual lines you would add to a module manifest
                to declare a dependency, for example using OpenIDE-Module-Module-Dependencies
                or OpenIDE-Module-Requires. You may use the magic token @SPECIFICATION-VERSION@
                to represent the current specification version of the module.
            </hint>
        </question>
-->
<answer id="deploy-dependencies">
Declare dependency on openide module ie. add following line to manifest of your module:
<code>OpenIDE-Module-IDE-Dependencies: IDE/1 > X.XX (it will be defined yet)</code> as window system is part of openide.
And dependeny on implementation:
<code>OpenIDE-Module-Module-Dependencies: org.netbeans.core.windows > X.XX</code>. But since the core-windows.jar does not provide any public API
this should be used only in ui-declaration module (like core-ui.jar).
</answer>


<!-- Question: exec-classloader

     <question id="exec-classloader">
            Does your code uses own classloader?
            <hint>
            A bit unusual. Please explain why and what for.
            </hint>
        </question>
-->
<answer id="exec-classloader"> 
No.
</answer>



<!-- Question: exec-component

     <question id="exec-component">
            Is execution of your code influenced by (string) property
            of any of your components?
            
            <hint>
            Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code>
            or <code>PropertyDescriptor.getValue</code>, etc. are used to influence
            a behaviour of some code. This of course forms an interface that should
            be documented. Also if one depends on some interface that an object
            implements (<code>component instanceof Runnable</code>) that forms an
            API as well.
            </hint>
        </question>
-->
<answer id="exec-component">
Yes. Component can control its persistence and way how they are displayed in container.
<api type="export" group="property" name="PersistenceType" category="deprecated">
    Valid values are "Never", "OnlyOpened". Default is "" (empty string) and means always persistent.
    "Never" means that TopComponent is not persistent at all. It lives only during IDE run.
    "OnlyOpened" means that TopComponent is serialized only when it is opened. If it is closed
    instance is lost.
    Default behaviour is that TopComponent is serialized always regardless it is opened or
    closed.
    It is client property of TopComponent. Usage example: To disable persistence of TopComponent
    use <code>putClientProperty("PersistenceType","Never");</code> in initialization code of TopComponent
    eg. in constructor.
    Usage of this client property is deprecated. Use API method <code>TopComponent.getPersistenceType()</code>
    instead.
</api>
<api type="export" group="property" name="SlidingName" category="private">
    Valid value is any String value representing displayable title of TopComponent in
    sliding mode. Title is shown on buttons on sides of main window for TopComponents that
    are currently hidden in sliding state. 
    This property has no effect on regular display names of TopComponents which are shown in
    captions of windows/tabs in the window system.
    It is client property of TopComponent. Usage example: To provide different, preferably
    shorter and non changing name for sliding title of your TopComponent subclass, 
    use <code>putClientProperty("SlidingName","your sliding title");</code> in initialization code of TopComponent
    eg. in constructor.
    Note that in next releases usage of this client property will be removed and replaced 
    by API, see issue #55955 in Issuezilla on www.netbeans.org.
</api>

<!--<api group="property" name="NamingType" type="export" category="private">
    Valid values are "BothOnlyCompName", "SDIOnlyCompName", "MDIOnlyCompName". 
    Default is "" (empty string). This property controls how window (frame) title is constructed
    from Mode name and TopComponent name.
    By default frame title is {Mode display name}  [{TopComponent name}].
    "BothOnlyCompName" means that only {TopComponent name} is displayed for both MDI and SDI mode.
    "SDIOnlyCompName", "MDIOnlyCompName" are the same "BothOnlyCompName" but only in SDI or MDI mode.
    It is client property of TopComponent. Usage example: To display only TopComponent name in title
    of window both in MDI and SDI mode use <code>putClientProperty("NamingType","BothOnlyCompName");</code>
    in initialization code of TopComponent eg. in constructor.
</api>
<api group="property" name="TabPolicy" type="export" category="private">
    Valid value is "HideWhenAlone". JTabbedPane is used with tabs. When this property
    is set and TopComponent is alone in given pane JTabbedPane is not used ie. tab is not
    displayed. It is used to save space and to avoid confusion when TopComponent uses its
    own tabs and it is usualy alone. Of course when there is more than one TopComponent in
    one pane JTabbedPane is used and tabs are displayed.
    Default is "" (empty string). In such case tab is displayed always.
    It is client property of TopComponent. Usage example: To disable tab when TopComponent
    is alone in container use <code>putClientProperty("TabPolicy","HideWhenAlone");</code> in initialization
    code of TopComponent eg. in constructor.
</api>-->
        <api group="property" name="OpenIDE-Transmodal-Action" type="export" category="friend">
            <p>
                An <code>Action</code> with the property <code>OpenIDE-Transmodal-Action</code> set to
                <code>Boolean.TRUE</code> should function on all focused components. This includes the Main
                Window, dialogs, popup menus, etc. Otherwise only the Main Window and <code>TopComponent</code>s
                will receive the keystroke.
            </p>
        </api>
</answer>



<!-- Question: exec-privateaccess

     <question id="exec-privateaccess">
            Are you aware of any other part of the system calling some of 
            your methods by reflection?
            <hint>
            If so, describe the "contract" as an API. Likely private or friend one, but
            still API and consider rewrite of it.
            </hint>
        </question>
-->
<answer id="exec-privateaccess">
No. Now is the window persistence independent from projects.
<!--Yes projects module invokes serialization of window system. It is removed in new projects -
window system configuration will not be part of project.-->
</answer>



<!-- Question: exec-property

     <question id="exec-property">
            Is execution of your code influenced by any environment of
            system (<code>System.getProperty</code>) property?
            
            <hint>
            If there is a property that can change the behaviour of your 
            code, somebody will likely use it. You should describe what it does 
            and the stability category of this API. You may use
            <PRE>
                &lt;property name="id" category="private" &gt;
                    description of the property, where it is used, what it influence, etc.
                &lt;/property&gt;            
            </PRE>
            </hint>
        </question>
-->
<answer id="exec-property">
There are some, will put later here.
Yes.
<api group="property" name="netbeans.winsys.imageSource" type="export" category="private">
    Valid values are path to image in NB like "org/netbeans/core/resources/splash.gir". 
    It puts the specified image into the the emptied documents area.
    it is experimental now.
    <code>-J-Dnetbeans.winsys.imageSource=org/netbeans/core/resources/splash.gif</code>
</api>
<api group="property" name="netbeans.winsys.dndfade.on" type="export" category="private">
    Valid values are "true" and "false". Default is "false".
    If it is "true" it paint faded feedback during DnD of windows. Keep in mind it makes
    some performance impact on DnD.
    It is experimental now.
    <code>-J-Dnetbeans.winsys.fade.on=true</code>
</api>
<api group="property" name="netbeans.winsys.disable_dnd" type="export" category="private">
    Valid values are "true" and "false". Default is "false". 
    If it is "true" it disables DnD of windows.
    <code>-J-Dnetbeans.winsys.disable_dnd=true</code>
</api>
<api group="property" name="netbeans.winsys.allow.dock.anywhere" type="export" category="private">
    Valid values are "true" and "false". Default is "false". 
    It allows user to move (e.g. using DnD) <code>TopComponent</code>S between editor(document) and view
    which is restricte otherwise.
    It is experimental now.
    <code>-J-Dnetbeans.winsys.allow.dock.anywhere=true</code>
</api>
<api group="property" name="netbeans.winsys.hideEmptyDocArea" type="export" category="private">
    Valid values are "true" and "false". Default is "false". 
    If it is "true" it doesn't show empty documents area.
    <code>-J-Dnetbeans.winsys.hideEmptyDocArea=true</code>
</api>
<api group="property" name="netbeans.winsys.statusLine.in.menuBar" type="export" category="private">
    Valid values are "true" and "false". Default is "false".
    If it is "true" it shows status line at the and of menu bar instead of the
    bottom of documents are (or main window).
    <code>-J-Dnetbeans.winsys.statusLine.in.menuBar=true</code>
</api>
<api group="property" name="netbeans.winsys.no_toolbars" type="export" category="private">
    Valid values are "true" and "false". Default is "false".
    If it is "true" it hides all toolbars.
    <code>-J-Dnetbeans.winsys.no_toolbars=true</code>
</api>
<api group="property" name="netbeans.winsys.menu_bar.path" type="export" category="private">
    If this property is set its value must point to a file on the system file system
    that provides instance of type <code>org.openide.awt.MenuBar</code>. 
    This alternative menu bar will be used instead of the default one.
    <code>-J-Dnetbeans.winsys.menu_bar.path=foo/bar.instance</code>
</api>
<api group="property" name="netbeans.winsys.status_line.path" type="export" category="private">
    If this property is set its value must point to a file on the system file system
    that provides instance of type <code>javax.swing.JComponent</code>. 
    This alternative status line will be used instead of the default one.
    <code>-J-Dnetbeans.winsys.status_line.path=foo/bar.instance</code>
</api>

<api group="property" name="netbeans.windows" type="export" category="private">
    Valid values are "mdi" and "sdi". It selects GUI mode in which window system is started.
    The "mdi" and "sdi" names are now obsoleted (together with the option). The "mdi" corresponds to
    "compact" mode and "sdi" corresponds to "selected" mode.
    It can be set on command line or in ide.cfg. Usage example: To start IDE in Selected mode use 
    <code>-J-Dnetbeans.windows=sdi</code>
</api>
<api group="javax.swing.UIManager" name="tab_focus_fill_dark" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_focus_fill_dark")</code>
</api>
<api group="javax.swing.UIManager" name="tab_focus_fill_bright" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_focus_fill_bright")</code>
</api>
<api group="javax.swing.UIManager" name="tab_unsel_fill_dark" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_unsel_fill_dark")</code>
</api>
<api group="javax.swing.UIManager" name="tab_unsel_fill_bright" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_unsel_fill_bright")</code>
</api>
<api group="javax.swing.UIManager" name="tab_sel_fill" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_sel_fill")</code>
</api>
<api group="javax.swing.UIManager" name="tab_sel_fill_bright" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_sel_fill_bright")</code>
</api>
<api group="javax.swing.UIManager" name="tab_sel_fill_dark" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_sel_fill_dark")</code>
</api>
<api group="javax.swing.UIManager" name="tab_border" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_border")</code>
</api>
<api group="javax.swing.UIManager" name="tab_bottom_border" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_bottom_border")</code>
</api>
<api group="javax.swing.UIManager" name="tab_sel_border" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_sel_border")</code>
</api>
<api group="javax.swing.UIManager" name="workplace_fill" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("workplace_fill")</code>
</api>
<api group="javax.swing.UIManager" name="tab_highlight_header" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_highlight_header")</code>
</api>
<api group="javax.swing.UIManager" name="tab_highlight_header_fill" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("tab_highlight_header_fill")</code>
</api>
<api group="javax.swing.UIManager" name="standard_border" type="export" category="private">
    One of colors used in own tabs UI implementation.
    Usage example: To get color, call <code>javax.swing.UIManager.get("standard_border")</code>
</api>
<api group="javax.swing.UIManager" name="org.netbeans.core.windows.view.ui.tabcontrol.BorderProvider" type="export" category="private">
    Custom border management for tabbed containers can be achieved by implementing
    interface <code>org.netbeans.core.windows.view.ui.tabcontrol.BorderProvider</code>
    and putting instance into Swing's UIManager table under key with the same name 
    as interface has.
    Usage example: Provide BorderProviderImpl implementation and put it in table
    <code>javax.swing.UIManager.put("org.netbeans.core.windows.view.ui.tabcontrol.BorderProvider", borderProviderImpl)</code>
    during startup, before main window is shown.
</api>
<!--<api group="property" name="netbeans.scrolling.tabs" type="export" category="private">
    Valid values are "true" and "false". Default is "false". If it is true new JDK 1.4 scrolling tabs 
    are used. 
    It can be set on command line or in ide.cfg. Usage example: To enable scrolling tabs use
    <code>-J-Dnetbeans.scrolling.tabs=true</code>
</api>
<api group="property" name="netbeans.winsys.dnd" type="export" category="private">
    Valid values are "true" and "false". Default is "false". If it is true it enables window system DnD
    on JDK 1.4. 
    It can be set on command line or in ide.cfg. Usage example: To enable window system DnD use 
    <code>-J-Dnetbeans.winsys.dnd=true</code>
</api>
<api group="property" name="netbeans.windows.tabs_on_top" type="export" category="private">
    Valid values are "true" and "false". Default is "false". If it si true tabs are put
    on top. By default tabs are at bottom. 
    It can be set on command line or in ide.cfg. Usage example: To place tabs on top of container (area)
    use <code>-J-Dnetbeans.windows.tabs_on_top=true</code>
</api>
<api group="property" name="netbeans.windows.no_wswitcher" type="export" category="private">
    Valid values are "true" and "false". Default is "false". If it is true workspace switcher
    and status line are not displayed. It can be used to save some screen space esp. useful
    on notebook.
    It can be set on command line or in ide.cfg. Usage example: To disable (hide) default workspace 
    use <code>-J-Dnetbeans.windows.no_wswitcher=true</code>
</api>-->
</answer>



<!-- Question: exec-reflection

     <question id="exec-reflection">
            Does your code uses java.lang.reflect to execute some other code?
            <hint>
            This usually indicates a missing or unsufficient API in the other
            part of the system. If the other side is not aware of your dependency
            this contract can be easily broken.
            </hint>
        </question>
-->
<answer id="exec-reflection">
No.
</answer>

<!--
        <question id="exec-introspection">
            Does your module use any kind of runtime type information (<code>instanceof</code>,
            work with <code>java.lang.Class</code>, etc.)?
            <hint>
            Check for cases when you have an object of type A and you also
            expect it to (possibly) be of type B and do some special action. That
            should be documented. The same applies on operations in meta-level
            (Class.isInstance(...), Class.isAssignableFrom(...), etc.).
            </hint>
        </question>
-->
<answer id="exec-introspection">
No.
</answer>



<!--
        <question id="exec-process">
            Do you execute an external process from your module? How do you ensure
            that the result is the same on different platforms? Do you parse output?
            Do you depend on result code?
            <hint>
            If you feed an input, parse the output please declare that as an API.
            </hint>
        </question>
-->
<answer id="exec-process">
No.
</answer>


<!-- Question: format-clipboard

     <question id="format-clipboard">
            Which protocols your code reads/inserts when communicating with
            clipboard?
        </question>
-->
<answer id="format-clipboard">
Module uses the same standard protocol as actions module. In case of Copy-n-Paste
instances of Workspace, Mode and TopComponent are passed to clipboard.
<p/>There are defined three kinds of <code>DataFlavor</code>S for pure internal usage for DnD of <code>TopComponent</code>S.
They are constructed using MIME Types constructed following way:
<ul>
<li><api group="java" category="private" type="export" name="DataFlavorDnDTopComponent">DataFlavor.javaJVMLocalObjectMimeType + "; class=org.openide.windows.TopComponent"</api></li>
<li><api group="java" category="private" type="export" name="DataFlavorDnDTopComponent.Cloneable">DataFlavor.javaJVMLocalObjectMimeType + "; class=org.openide.windows.TopComponent$Cloneable"</api></li>
<li><api group="java" category="private" type="export" name="DataFlavorDnDTopComponentArray">DataFlavor.javaJVMLocalObjectMimeType + "; class=org.netbeans.core.windows.dnd.TopComponentDragSupport$TopComponentArray"</api></li>
</ul>
</answer>



<!-- Question: format-dnd

     <question id="format-dnd">
            Which protocols your code understands during drag-n-drop?
        </question>
-->
<answer id="format-dnd">
Window system DnD: Module uses standard AWT DragDrop protocol. TopComponent 
instances are transfered. Experimental, not enabled by default.
Explorer DnD: It is also possible to DnD nodes in Explorer in such case instances 
of Workspace, Mode and TopComponent are transfered.
</answer>



<!-- Question: format-types

     <question id="format-types">
            Which file formats your code reads or writes on disk?
        </question>
-->
<answer id="format-types">
Module configuration is stored in XML files.
<ul>
<li>
    <api
        name="windowmanager-properties2_0.dtd"
        type="export"
        group="dtd"
        category="devel"
        url="http://www.netbeans.org/dtds/windowmanager-properties2_0.dtd"
    ><samp>-//NetBeans//DTD Window Manager Properties 2.01//EN</samp></api>
</li>
<li>
    <api
        name="mode-properties2_0.dtd"
        group="dtd"
        type="export"
        category="devel"
        url="http://www.netbeans.org/dtds/mode-properties2_0.dtd"
    ><samp>-//NetBeans//DTD Mode Properties 2.0//EN</samp></api>
</li>
<li>
    <api
        name="tc_ref2_0.dtd"
        group="dtd"
        type="export"
        category="devel"
        url="http://www.netbeans.org/dtds/tc_ref2_0.dtd"
    ><samp>-//NetBeans//DTD Top Component in Mode Properties 2.0//EN</samp></api>
</li>
<li>
    <api
        name="group-properties2_0.dtd"
        group="dtd"
        type="export"
        category="devel"
        url="http://www.netbeans.org/dtds/group-properties2_0.dtd"
    ><samp>-//NetBeans//DTD Group Properties 2.0//EN</samp></api>
</li>
<li>
    <api
        name="tc_group2_0.dtd"
        group="dtd"
        type="export"
        category="devel"
        url="http://www.netbeans.org/dtds/tc_group2_0.dtd"
    ><samp>-//NetBeans//DTD Top Component in Group Properties 2.0//EN</samp></api>
</li>
<li>
    <api
        name="sessionsettings-1_0.dtd"
        group="dtd"
        type="export"
        category="devel"
        url="http://www.netbeans.org/dtds/sessionsettings-1_0.dtd"
    ><samp>-//NetBeans//DTD Session settings 1.0//EN</samp></api>
</li>
</ul>
</answer>



<!-- Question: lookup-lookup

     <question id="lookup-lookup">
            Does your module uses <code>org.openide.util.Lookup</code>
            to find any components to communicate to? Which ones?
            
            <hint>
            Please describe the interfaces you are searching for, where 
            are defined, whether you are searching for just one or more of them,
            if the order is important, etc. Also clasify the stability of such
            API contract.
            </hint>
        </question>
-->
<answer id="lookup-lookup">
Window Manager implementation (from core) registers itself and lookup is used 
from API part to  get the instance and return as 
<a href="@TOP@/org/openide/windows/WindowManager.html#getDefault()">WindowManager.getDefault ()</a>
and also <a href="@TOP@/org/openide/windows/WindowManager.html#componentRegistry()">WindowManager.componentRegistry()</a>.
gets the registered instance of <code>TopComponent.Registry</code>.
Also there are provided implementations of <a href="@org-openide-dialogs@/org/openide/DialogDisplayer.html#getDefault()">DialogDisplayer.getDefault()</a> 
and <a href="@org-openide-nodes@/org/openide/nodes/NodeOperation.html#getDefault()">NodeOperation.getDefault()</a> services.
<p/>
There is also provided service which implements <api category="friend" group="java" name="NbTopManager.WindowSystem" type="import">org.netbeans.core.NbTopManager$WindowSystem interface</api>, 
which is used in core module. It is used for starting window system (loading and show) in startup sequence and finishiing of window system (hiding and saving)
during exit sequence. The reason of this is that module API is not sufficient fot window system module, since it needs to provide its loading after all
module layers are loaded etc.
</answer>



<!-- Question: lookup-register

     <question id="lookup-register">
            Do you register anything into the lookup for other to find? 
            <hint>
            Do you register using layer file or using <code>META-INF/services</code>?
            Who is supposed to find your component?
            </hint>
        </question>
-->
<answer id="lookup-register">
WindowManager and TopComponent.Registry are registered. Used to find sinleton
instance by singleton accessor.
</answer>



<!-- Question: lookup-remove

     <question id="lookup-remove">
            Are removing entries of other modules from the lookup? 
            <hint>
            Why? Of course, that is possible, but it can be dangerous. Is the module
            your are masking resource from aware of what you are doing?
            </hint>
        </question>
-->
<answer id="lookup-remove">
Yes. It removes implementation of <a href="@org-openide-nodes@/org/openide/nodes/NodeOperation.html#getDefault()">NodeOperation.getDefault()</a>
service provided by openide-explorer module.
</answer>



<!-- Question: perf-exit

     <question id="perf-exit">
            Does your module executes anything on exit?
        </question>
-->
<answer id="perf-exit">
Module configuration is saved on exit.
</answer>



<!-- Question: perf-huge_dialogs

     <question id="perf-huge_dialogs">
            Does your module contain any dialogs or wizards with huge
            amount of GUI controls like combo boxes, lists, trees, text
            areas?
        </question>
-->
<answer id="perf-huge_dialogs">
No.
</answer>



<!-- Question: perf-limit

     <question id="perf-limit">
            Are there any limits in number/size of elements your code
            can handle?
        </question>
-->
<answer id="perf-limit">
Yes. Of course it is size of memory. The other limits were not set yet.
</answer>



<!-- Question: perf-mem

     <question id="perf-mem">
            What is the amount of memory your component occupies? Estimate
            with a relaction to the number of windows, etc.
        </question>
-->
<answer id="perf-mem">
<!-- TODO Needs to add estimated size of plain TopComponent object constructed -> new TopComponent() -->
<!--Estimate for default window system layout. Created empty workspace test and I measured
how heap increases when other workspaces are initialized by switching to them.
Editing - 1.5MB,
GUI Editing - 600KB,
Debugging - 700KB,
sum - 2.8MB.-->
</answer>



<!-- Question: perf-menus

     <question id="perf-menus">
            Does your module use dynamically changing context menus or
            context sensitive actions with complicated logic for enable/disable?
        </question>
-->
<answer id="perf-menus">
No.
</answer>



<!-- Question: perf-progress

     <question id="perf-progress">
            Does your module executes some long running task?
            <hint>Typically they are tasks like connecting over
            network, computing huge amount of data, compilation.
            Such communication should be done asynchronously (for example
            using <code>RequestProcessor</code>), definitively it should 
            not block AWT thread.
            </hint>
        </question>
-->
<answer id="perf-progress">
It executes long running tasks at startup and exit of IDE, i.e. loading and saving of window system configurations.
<!--Initializing of workspace (due to lazy loading of components) can be long depending
on number of components or time necessary to initialize components. It is performed
in AWT thread because user is blocked anyway till workspace is initialized.-->
</answer>



<!-- Question: perf-scale

     <question id="perf-scale">
            Which external criteria influence the performance of your
            program (size of file in editor, number of files in menu, 
            in source directory, etc.) and how well your code scales?
            Please include some estimates.
        </question>
-->
<answer id="perf-scale">
The performance of window system can influence meny externals quite heavily. Cases which can singificantly
influence window system responsiveness are:
<ul>
<li>Long running client task performed in AWT thead</li>
<li>Any sublcass of <code>TopComponnet</code> with slow internal responsiveness, e.g. with slow
painting routines, validating, bad UI management etc.</li>
</ul>
<p/>
Depends on number of displayed frames, components. Currently it is linear though
some part of components initialization is done only when necessary (eg. when component
is in JTabbedPane it is not necessary to initialize component ui when component
is not visible.
</answer>



<!-- Question: perf-startup

     <question id="perf-startup">
            Does your module executes anything on startup?
        </question>
-->
<answer id="perf-startup">
Yes. The window system configuration is loaded and shown the result on screen.
<!--Current workspace is initialized.-->
</answer>



<!-- Question: perf-wakeup

     <question id="perf-wakeup">
            Is any piece of your code waking up periodically?
        </question>
-->
<answer id="perf-wakeup">
No.
</answer>



<!-- Question: resources-file

     <question id="resources-file">
            Does your module use <code>java.io.File</code> directly?
            
            <hint>
            NetBeans provide a logical wrapper over plain files called 
            <code>org.openide.filesystems.FileObject</code> that
            provides uniform access to such resources and is the prefered
            way that should be used. But of course there can be situations when
            this is not suitable.
            </hint>
        </question>
-->
<answer id="resources-file">
No.
</answer>



<!-- Question: resources-layer

     <question id="resources-layer">
            Does your module provide own layer? Does it create some files or
            folders on it? What it is trying to communicate by that and with which 
            component?
            
            <hint>
            NetBeans allows automatic and declarative installation of resources 
            by module layers. Module register files into appropriate places
            and other components use that information to perform their task
            (build menu, toolbar, window layout, list of templates, set of
            options, etc.). 
            </hint>
        </question>
-->
<answer id="resources-layer">
Yes. Default window system layout is in module layer. Other modules can define 
their own winsys elements (mode, group, component) in their module layer.
</answer>



<!-- Question: resources-mask

     <question id="resources-mask">
            Does your module mask/hide/override any resource provided by another one in
            module layer? 
            
            <hint>
            If you mask a file provided by another module, you probably depend
            on that and do not want the other module to (for example) change
            the file's name. That module shall thus make that file available as an API
            of some stability category.
            </hint>
        </question>
-->
<answer id="resources-mask">
No.
</answer>



<!-- Question: resources-read

     <question id="resources-read">
            Does your module read any resources from layers? For what purpose?
            
            <hint>
            As this is some kind of intermodule dependency, it is a kind of API.
            Please describe it and clasify according to 
            <a href="http://openide.netbeans.org/tutorial/api-design.html#categories">
            common stability categories</a>.
            </hint>
        </question>
-->
<answer id="resources-read">
Module reads its own configuration from its layer and eventualy from other module layers
if provided. Data have following <a href="http://core.netbeans.org/windowsystem/changes.html#3.4.2">folder structure</a>.
It contains <api group="layer" category="private" type="export" name="ModuleDataStructure" url="http://core.netbeans.org/windowsystem/changes.html#3.4.2">Module folder structure under Windows2 directory </api>
and <api group="layer" category="private" type="export" name="LocalDataStructure" url="http://core.netbeans.org/windowsystem/changes.html#3.4.2">Local folder structure under Windows2Local directory</api>.
<!--<a href="http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/windows/doc-files/api.html#xml">directory structure</a>.
-->
</answer>

</api-answers>
