This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 161286
Collapse All | Expand All

(-)a/bugtracking/nbproject/project.xml (-1 / +6 lines)
Lines 137-144 Link Here
137
                    <build-prerequisite/>
137
                    <build-prerequisite/>
138
                    <compile-dependency/>
138
                    <compile-dependency/>
139
                    <run-dependency>
139
                    <run-dependency>
140
                        <specification-version>7.7</specification-version>
140
                        <specification-version>7.9</specification-version>
141
                    </run-dependency>
141
                    </run-dependency>
142
                </dependency>
143
                <dependency>
144
                    <code-name-base>org.netbeans.core.ide</code-name-base>
145
                    <build-prerequisite/>
146
                    <compile-dependency/>
142
                </dependency>
147
                </dependency>
143
                <dependency>
148
                <dependency>
144
                    <code-name-base>org.openide.text</code-name-base>
149
                    <code-name-base>org.openide.text</code-name-base>
(-)a/bugtracking/src/org/netbeans/modules/bugtracking/layer.xml (-10 lines)
Lines 49-64 Link Here
49
        </folder>
49
        </folder>
50
    </folder>
50
    </folder>
51
51
52
    <folder name="UI">
53
        <folder name="Runtime">
54
            <file name="org-netbeans-modules-bugtracking-ui-nodes-BugtrackingRootNode.instance">
55
                <attr name="instanceClass" stringvalue="org.netbeans.modules.bugtracking.ui.nodes.BugtrackingRootNode"/>
56
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.bugtracking.ui.nodes.BugtrackingRootNode.getDefault"/>
57
                <attr name="position" intvalue="588"/>
58
            </file>
59
        </folder>
60
    </folder>
61
62
    <folder name="OptionsDialog">
52
    <folder name="OptionsDialog">
63
        <folder name="Advanced">
53
        <folder name="Advanced">
64
            <file name="org-netbeans-modules-bugtracking-util-BugtrackingOptions.instance"/>
54
            <file name="org-netbeans-modules-bugtracking-util-BugtrackingOptions.instance"/>
(-)a/bugtracking/src/org/netbeans/modules/bugtracking/ui/nodes/BugtrackingRootNode.java (+7 lines)
Lines 51-56 Link Here
51
import java.util.List;
51
import java.util.List;
52
import javax.swing.AbstractAction;
52
import javax.swing.AbstractAction;
53
import javax.swing.Action;
53
import javax.swing.Action;
54
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
54
import org.netbeans.modules.bugtracking.BugtrackingManager;
55
import org.netbeans.modules.bugtracking.BugtrackingManager;
55
import org.netbeans.modules.bugtracking.spi.Repository;
56
import org.netbeans.modules.bugtracking.spi.Repository;
56
import org.netbeans.modules.bugtracking.util.BugtrackingUtil;
57
import org.netbeans.modules.bugtracking.util.BugtrackingUtil;
Lines 89-94 Link Here
89
     *
90
     *
90
     * @return default instance of BugtrackingRootNode
91
     * @return default instance of BugtrackingRootNode
91
     */
92
     */
93
    @ServiceTabNodeRegistration(
94
        name="bugtracking",
95
        displayName="org.netbeans.modules.bugtracking.ui.nodes.Bundle#LBL_BugtrackingNode",
96
        iconResource="org/netbeans/modules/bugtracking/ui/resources/bugtracking.png",
97
        position=588
98
    )
92
    public static BugtrackingRootNode getDefault() {
99
    public static BugtrackingRootNode getDefault() {
93
        synchronized(LOCK_INIT) {
100
        synchronized(LOCK_INIT) {
94
            if (defaultInstance == null) {
101
            if (defaultInstance == null) {
(-)fab8ea7d1591 (+94 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
7
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License.  When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
25
26
Contributor(s):
27
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
Microsystems, Inc. All Rights Reserved.
31
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
42
-->
43
<?xml-stylesheet type="text/xml" href="../nbbuild/javadoctools/apichanges.xsl"?>
44
<!DOCTYPE apichanges PUBLIC "-//NetBeans//DTD API changes list 1.0//EN" "../nbbuild/javadoctools/apichanges.dtd">
45
46
<apichanges>
47
    <apidefs>
48
        <apidef name="api">Core IDE API</apidef>
49
    </apidefs>
50
51
    <changes>
52
        <change id="ServiceTabProcessor">
53
            <api name="api"/>
54
            <summary>Annotation to register Nodes into Services tab</summary>
55
            <version major="1" minor="15"/>
56
            <date day="1" month="4" year="2009"/>
57
            <author login="jtulach"/>
58
            <compatibility addition="yes"/>
59
            <description>
60
                <p>
61
                    Use <a href="@TOP@/org/netbeans/api/core/ide/ServiceTabNodeRegistration.html">
62
                    ServiceTabNodeRegistration</a> to register your nodes
63
                    into <em>Services</em> in the IDE.
64
                </p>
65
            </description>
66
            <issue number="161286"/>
67
        </change>
68
    </changes>
69
70
    <!-- Now the surrounding HTML text and document structure: -->
71
72
    <htmlcontents>
73
        <!-- Generated from apichanges.xml -->
74
        <head>
75
            <title>Change History for the Core IDE API</title>
76
            <link rel="stylesheet" href="prose.css" type="text/css"/>
77
        </head>
78
        <body>
79
80
            <p class="overviewlink"><a href="@org-netbeans-core-ide@/overview-summary.html">Overview</a></p>
81
82
            <h1>Introduction</h1>
83
            <p>This document lists changes made to the <a href="@org-netbeans-core-ide@/overview-summary.html">Core IDE API</a>.</p>
84
85
            <!-- The actual lists of changes, as summaries and details: -->
86
            <hr/>
87
            <standard-changelists module-code-name="org.netbeans.core.ide/1"/>
88
            <hr/>
89
            <p>@FOOTER@</p>
90
91
        </body>
92
    </htmlcontents>
93
94
</apichanges>
(-)fab8ea7d1591 (+1082 lines)
Added Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE api-answers PUBLIC "-//NetBeans//DTD Arch Answers//EN" "../nbbuild/antsrc/org/netbeans/nbbuild/Arch.dtd" [
3
  <!ENTITY api-questions SYSTEM "../nbbuild/antsrc/org/netbeans/nbbuild/Arch-api-questions.xml">
4
]>
5
6
<api-answers
7
  question-version="1.29"
8
  author="yourname@netbeans.org"
9
>
10
11
  &api-questions;
12
13
14
<!--
15
        <question id="arch-overall" when="init">
16
            Describe the overall architecture. 
17
            <hint>
18
            What will be API for 
19
            <a href="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi">
20
                clients and what support API</a>? 
21
            What parts will be pluggable?
22
            How will plug-ins be registered? Please use <code>&lt;api type="export"/&gt;</code>
23
            to describe your general APIs and specify their
24
            <a href="http://openide.netbeans.org/tutorial/api-design.html#category-private">
25
            stability categories</a>.
26
            If possible please provide simple diagrams.
27
            </hint>
28
        </question>
29
-->
30
 <answer id="arch-overall">
31
  <p>
32
   This module contains various generic IDE-like extensions.
33
  </p>
34
 </answer>
35
36
37
38
<!--
39
        <question id="arch-quality" when="init">
40
            How will the <a href="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a>
41
            of your code be tested and 
42
            how are future regressions going to be prevented?
43
            <hint>
44
            What kind of testing do
45
            you want to use? How much functionality, in which areas,
46
            should be covered by the tests? How you find out that your
47
            project was successful?
48
            </hint>
49
        </question>
50
-->
51
 <answer id="arch-quality">
52
  <p>
53
   We have few unit tests.
54
  </p>
55
 </answer>
56
57
58
59
<!--
60
        <question id="arch-time" when="init">
61
            What are the time estimates of the work?
62
            <hint>
63
            Please express your estimates of how long the design, implementation,
64
            stabilization are likely to last. How many people will be needed to
65
            implement this and what is the expected milestone by which the work should be 
66
            ready?
67
            </hint>
68
        </question>
69
-->
70
 <answer id="arch-time">
71
  <p>
72
   Module will be available for 6.7 version.
73
  </p>
74
 </answer>
75
76
77
78
<!--
79
        <question id="arch-usecases" when="init">
80
            <hint>
81
                Content of this answer will be displayed as part of page at
82
                http://www.netbeans.org/download/dev/javadoc/usecases.html 
83
                You can use tags &lt;usecase name="name&gt; regular html description &lt;/usecase&gt;
84
                and if you want to use an URL you can prefix if with @TOP@ to begin
85
                at the root of your javadoc
86
            </hint>
87
        
88
            Describe the main <a href="http://openide.netbeans.org/tutorial/api-design.html#usecase">
89
            use cases</a> of the new API. Who will use it under
90
            what circumstances? What kind of code would typically need to be written
91
            to use the module?
92
        </question>
93
-->
94
 <answer id="arch-usecases">
95
  <p>
96
   <usecase id="services-tab-node" name="Register Node in Services tab">
97
        Use <a href="@TOP@/org/netbeans/api/core/ide/ServiceTabNodeRegistration.html">
98
        ServiceTabNodeRegistration</a> to register your nodes into <em>Services</em> in the IDE.
99
   </usecase>
100
  </p>
101
 </answer>
102
103
104
105
<!--
106
        <question id="arch-what" when="init">
107
            What is this project good for?
108
            <hint>
109
            Please provide here a few lines describing the project, 
110
            what problem it should solve, provide links to documentation, 
111
            specifications, etc.
112
            </hint>
113
        </question>
114
-->
115
 <answer id="arch-what">
116
  <api name="core.ide" category="stable" group="java" type="export">
117
  Right now this module provides handy
118
  <a href="@TOP@/org/netbeans/api/core/ide/ServiceTabNodeRegistration.html">
119
    ServiceTabNodeRegistration</a>
120
    accompanied with few UI elements.
121
  </api>
122
 </answer>
123
124
125
126
<!--
127
        <question id="arch-where" when="impl">
128
            Where one can find sources for your module?
129
            <hint>
130
                Please provide link to the Hg web client at
131
                http://hg.netbeans.org/
132
                or just use tag defaultanswer generate='here'
133
            </hint>
134
        </question>
135
-->
136
 <answer id="arch-where">
137
  <defaultanswer generate='here' />
138
 </answer>
139
140
141
142
<!--
143
        <question id="compat-deprecation" when="init">
144
            How the introduction of your project influences functionality
145
            provided by previous version of the product?
146
            <hint>
147
            If you are planning to deprecate/remove/change any existing APIs,
148
            list them here accompanied with the reason explaining why you
149
            are doing so.
150
            </hint>
151
        </question>
152
-->
153
 <answer id="compat-deprecation">
154
  <p>
155
   XXX no answer for compat-deprecation
156
  </p>
157
 </answer>
158
159
160
161
<!--
162
        <question id="compat-i18n" when="impl">
163
            Is your module correctly internationalized?
164
            <hint>
165
            Correct internationalization means that it obeys instructions 
166
            at <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html">
167
            NetBeans I18N pages</a>.
168
            </hint>
169
        </question>
170
-->
171
 <answer id="compat-i18n">
172
  <p>
173
   XXX no answer for compat-i18n
174
  </p>
175
 </answer>
176
177
178
179
<!--
180
        <question id="compat-standards" when="init">
181
            Does the module implement or define any standards? Is the 
182
            implementation exact or does it deviate somehow?
183
        </question>
184
-->
185
 <answer id="compat-standards">
186
  <p>
187
   XXX no answer for compat-standards
188
  </p>
189
 </answer>
190
191
192
193
<!--
194
        <question id="compat-version" when="impl">
195
            Can your module coexist with earlier and future
196
            versions of itself? Can you correctly read all old settings? Will future
197
            versions be able to read your current settings? Can you read
198
            or politely ignore settings stored by a future version?
199
            
200
            <hint>
201
            Very helpful for reading settings is to store version number
202
            there, so future versions can decide whether how to read/convert
203
            the settings and older versions can ignore the new ones.
204
            </hint>
205
        </question>
206
-->
207
 <answer id="compat-version">
208
  <p>
209
   XXX no answer for compat-version
210
  </p>
211
 </answer>
212
213
214
215
<!--
216
        <question id="dep-jre" when="final">
217
            Which version of JRE do you need (1.2, 1.3, 1.4, etc.)?
218
            <hint>
219
            It is expected that if your module runs on 1.x that it will run 
220
            on 1.x+1 if no, state that please. Also describe here cases where
221
            you run different code on different versions of JRE and why.
222
            </hint>
223
        </question>
224
-->
225
 <answer id="dep-jre">
226
  <p>
227
   XXX no answer for dep-jre
228
  </p>
229
 </answer>
230
231
232
233
<!--
234
        <question id="dep-jrejdk" when="final">
235
            Do you require the JDK or is the JRE enough?
236
        </question>
237
-->
238
 <answer id="dep-jrejdk">
239
  <p>
240
   XXX no answer for dep-jrejdk
241
  </p>
242
 </answer>
243
244
245
246
<!--
247
        <question id="dep-nb" when="init">
248
            What other NetBeans projects and modules does this one depend on?
249
            <hint>
250
            Depending on other NetBeans projects influnces the ability of
251
            users of your work to customize their own branded version of
252
            NetBeans by enabling and disabling some modules. Too
253
            much dependencies restrict this kind of customization. If that
254
            is your case, then you may want to split your functionality into
255
            pieces of autoload, eager and regular modules which can be
256
            enabled independently. Usually the answer to this question
257
            is generated from your <code>project.xml</code> file, but
258
            if it is not guessed correctly, you can suppress it by
259
            specifying &lt;defaultanswer generate="none"/&gt; and
260
            write here your own. Please describe such projects as imported APIs using
261
            the <code>&lt;api name="identification" type="import or export" category="stable" url="where is the description" /&gt;</code>.
262
            By doing this information gets listed in the summary page of your
263
            javadoc.
264
            </hint>
265
        </question>
266
-->
267
 <answer id="dep-nb">
268
  <defaultanswer generate='here' />
269
 </answer>
270
271
272
273
<!--
274
        <question id="dep-non-nb" when="init">
275
            What other projects outside NetBeans does this one depend on?
276
            
277
            <hint>
278
            Depending on 3rd party libraries is always problematic,
279
            especially if they are not open source, as that complicates
280
            the licensing scheme of NetBeans. Please enumerate your
281
            external dependencies here, so it is correctly understood since
282
            the begining what are the legal implications of your project.
283
            Also please note that
284
            some non-NetBeans projects are packaged as NetBeans modules
285
            (see <a href="http://libs.netbeans.org/">libraries</a>) and
286
            it is preferred to use this approach when more modules may
287
            depend and share such third-party libraries.
288
            </hint>
289
        </question>
290
-->
291
 <answer id="dep-non-nb">
292
  <p>
293
   XXX no answer for dep-non-nb
294
  </p>
295
 </answer>
296
297
298
299
<!--
300
        <question id="dep-platform" when="init">
301
            On which platforms does your module run? Does it run in the same
302
            way on each?
303
            <hint>
304
            If you plan any dependency on OS or any usage of native code,
305
            please describe why you are doing so and describe how you envision
306
            to enforce the portability of your code.
307
            Please note that there is a support for <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-os-specific">OS conditionally
308
            enabled modules</a> which together with autoload/eager modules
309
            can allow you to enable to provide the best OS aware support
310
            on certain OSes while providing compatibility bridge on the not
311
            supported ones.
312
            Also please list the supported
313
            OSes/HW platforms and mentioned the lovest version of JDK required
314
            for your project to run on. Also state whether JRE is enough or
315
            you really need JDK.
316
            </hint>
317
        </question>
318
-->
319
 <answer id="dep-platform">
320
  <p>
321
   XXX no answer for dep-platform
322
  </p>
323
 </answer>
324
325
326
327
<!--
328
        <question id="deploy-dependencies" when="final">
329
            What do other modules need to do to declare a dependency on this one,
330
            in addition to or instead of the normal module dependency declaration
331
            (e.g. tokens to require)?
332
            <hint>
333
                Provide a sample of the actual lines you would add to a module manifest
334
                to declare a dependency, for example OpenIDE-Module-Requires: some.token.
335
                If other modules should not depend on this module, or should just use a
336
                simple regular module dependency, you can just answer "nothing". If you
337
                intentionally expose a semistable API to clients using implementation
338
                dependencies, you should mention that here (but there is no need to give
339
                an example of usage).
340
            </hint>
341
        </question>
342
-->
343
 <answer id="deploy-dependencies">
344
  <p>
345
   XXX no answer for deploy-dependencies
346
  </p>
347
 </answer>
348
349
350
351
<!--
352
        <question id="deploy-jar" when="impl">
353
            Do you deploy just module JAR file(s) or other files as well?
354
            <hint>
355
            Usually a module consist of one JAR file (perhaps with Class-Path
356
            extensions) and also a configuration file that enables it. If you
357
            have any other files, use
358
            &lt;api group="java.io.File" name="yourname" type="export" category="friend"&gt;...&lt;/api&gt;
359
            to define the location, name and stability of your files (of course
360
            changing "yourname" and "friend" to suit your needs).
361
            
362
            If it uses more than one JAR, describe where they are located, how
363
            they refer to each other. 
364
            If it consist of module JAR(s) and other files, please describe
365
            what is their purpose, why other files are necessary. Please 
366
            make sure that installation/uninstallation leaves the system 
367
            in state as it was before installation.
368
            </hint>
369
        </question>
370
-->
371
 <answer id="deploy-jar">
372
  <p>
373
   XXX no answer for deploy-jar
374
  </p>
375
 </answer>
376
377
378
379
<!--
380
        <question id="deploy-nbm" when="impl">
381
            Can you deploy an NBM via the Update Center?
382
            <hint>
383
            If not why?
384
            </hint>
385
        </question>
386
-->
387
 <answer id="deploy-nbm">
388
  <p>
389
   XXX no answer for deploy-nbm
390
  </p>
391
 </answer>
392
393
394
395
<!--
396
        <question id="deploy-packages" when="init">
397
            Are packages of your module made inaccessible by not declaring them
398
            public?
399
            
400
            <hint>
401
            By default NetBeans build harness treats all packages are private.
402
            If you export some of them - either as public or friend packages,
403
            you should have a reason. If the reason is described elsewhere
404
            in this document, you can ignore this question.
405
            </hint>
406
        </question>
407
-->
408
 <answer id="deploy-packages">
409
  <p>
410
   XXX no answer for deploy-packages
411
  </p>
412
 </answer>
413
414
415
416
<!--
417
        <question id="deploy-shared" when="final">
418
            Do you need to be installed in the shared location only, or in the user directory only,
419
            or can your module be installed anywhere?
420
            <hint>
421
            Installation location shall not matter, if it does explain why.
422
            Consider also whether <code>InstalledFileLocator</code> can help.
423
            </hint>
424
        </question>
425
-->
426
 <answer id="deploy-shared">
427
  <p>
428
   XXX no answer for deploy-shared
429
  </p>
430
 </answer>
431
432
433
434
<!--
435
        <question id="exec-ant-tasks" when="impl">
436
            Do you define or register any ant tasks that other can use?
437
            
438
            <hint>
439
            If you provide an ant task that users can use, you need to be very
440
            careful about its syntax and behaviour, as it most likely forms an
441
	          API for end users and as there is a lot of end users, their reaction
442
            when such API gets broken can be pretty strong.
443
            </hint>
444
        </question>
445
-->
446
 <answer id="exec-ant-tasks">
447
  <p>
448
   XXX no answer for exec-ant-tasks
449
  </p>
450
 </answer>
451
452
453
454
<!--
455
        <question id="exec-classloader" when="impl">
456
            Does your code create its own class loader(s)?
457
            <hint>
458
            A bit unusual. Please explain why and what for.
459
            </hint>
460
        </question>
461
-->
462
 <answer id="exec-classloader">
463
  <p>
464
   XXX no answer for exec-classloader
465
  </p>
466
 </answer>
467
468
469
470
<!--
471
        <question id="exec-component" when="impl">
472
            Is execution of your code influenced by any (string) property
473
            of any of your components?
474
            
475
            <hint>
476
            Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code>
477
            or <code>PropertyDescriptor.getValue</code>, etc. are used to influence
478
            a behavior of some code. This of course forms an interface that should
479
            be documented. Also if one depends on some interface that an object
480
            implements (<code>component instanceof Runnable</code>) that forms an
481
            API as well.
482
            </hint>
483
        </question>
484
-->
485
 <answer id="exec-component">
486
  <p>
487
   XXX no answer for exec-component
488
  </p>
489
 </answer>
490
491
492
493
<!--
494
        <question id="exec-introspection" when="impl">
495
            Does your module use any kind of runtime type information (<code>instanceof</code>,
496
            work with <code>java.lang.Class</code>, etc.)?
497
            <hint>
498
            Check for cases when you have an object of type A and you also
499
            expect it to (possibly) be of type B and do some special action. That
500
            should be documented. The same applies on operations in meta-level
501
            (Class.isInstance(...), Class.isAssignableFrom(...), etc.).
502
            </hint>
503
        </question>
504
-->
505
 <answer id="exec-introspection">
506
  <p>
507
   XXX no answer for exec-introspection
508
  </p>
509
 </answer>
510
511
512
513
<!--
514
        <question id="exec-privateaccess" when="final">
515
            Are you aware of any other parts of the system calling some of 
516
            your methods by reflection?
517
            <hint>
518
            If so, describe the "contract" as an API. Likely private or friend one, but
519
            still API and consider rewrite of it.
520
            </hint>
521
        </question>
522
-->
523
 <answer id="exec-privateaccess">
524
  <p>
525
   XXX no answer for exec-privateaccess
526
  </p>
527
 </answer>
528
529
530
531
<!--
532
        <question id="exec-process" when="impl">
533
            Do you execute an external process from your module? How do you ensure
534
            that the result is the same on different platforms? Do you parse output?
535
            Do you depend on result code?
536
            <hint>
537
            If you feed an input, parse the output please declare that as an API.
538
            </hint>
539
        </question>
540
-->
541
 <answer id="exec-process">
542
  <p>
543
   XXX no answer for exec-process
544
  </p>
545
 </answer>
546
547
548
549
<!--
550
        <question id="exec-property" when="impl">
551
            Is execution of your code influenced by any environment or
552
            Java system (<code>System.getProperty</code>) property?
553
            On a similar note, is there something interesting that you
554
            pass to <code>java.util.logging.Logger</code>? Or do you observe
555
            what others log?
556
            <hint>
557
            If there is a property that can change the behavior of your 
558
            code, somebody will likely use it. You should describe what it does 
559
            and the <a href="http://openide.netbeans.org/tutorial/api-design.html#life">stability category</a>
560
            of this API. You may use
561
            <pre>
562
                &lt;api type="export" group="property" name="id" category="private" url="http://..."&gt;
563
                    description of the property, where it is used, what it influence, etc.
564
                &lt;/api&gt;            
565
            </pre>
566
            </hint>
567
        </question>
568
-->
569
 <answer id="exec-property">
570
  <p>
571
   XXX no answer for exec-property
572
  </p>
573
 </answer>
574
575
576
577
<!--
578
        <question id="exec-reflection" when="impl">
579
            Does your code use Java Reflection to execute other code?
580
            <hint>
581
            This usually indicates a missing or insufficient API in the other
582
            part of the system. If the other side is not aware of your dependency
583
            this contract can be easily broken.
584
            </hint>
585
        </question>
586
-->
587
 <answer id="exec-reflection">
588
  <p>
589
   XXX no answer for exec-reflection
590
  </p>
591
 </answer>
592
593
594
595
<!--
596
        <question id="exec-threading" when="init">
597
            What threading models, if any, does your module adhere to? How the
598
            project behaves with respect to threading?
599
            <hint>
600
                Is your API threadsafe? Can it be accessed from any threads or
601
                just from some dedicated ones? Any special relation to AWT and
602
                its Event Dispatch thread? Also
603
                if your module calls foreign APIs which have a specific threading model,
604
                indicate how you comply with the requirements for multithreaded access
605
                (synchronization, mutexes, etc.) applicable to those APIs.
606
                If your module defines any APIs, or has complex internal structures
607
                that might be used from multiple threads, declare how you protect
608
                data against concurrent access, race conditions, deadlocks, etc.,
609
                and whether such rules are enforced by runtime warnings, errors, assertions, etc.
610
                Examples: a class might be non-thread-safe (like Java Collections); might
611
                be fully thread-safe (internal locking); might require access through a mutex
612
                (and may or may not automatically acquire that mutex on behalf of a client method);
613
                might be able to run only in the event queue; etc.
614
                Also describe when any events are fired: synchronously, asynchronously, etc.
615
                Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress)
616
            </hint>
617
        </question>
618
-->
619
 <answer id="exec-threading">
620
  <p>
621
   XXX no answer for exec-threading
622
  </p>
623
 </answer>
624
625
626
627
<!--
628
        <question id="format-clipboard" when="impl">
629
            Which data flavors (if any) does your code read from or insert to
630
            the clipboard (by access to clipboard on means calling methods on <code>java.awt.datatransfer.Transferable</code>?
631
            
632
            <hint>
633
            Often Node's deal with clipboard by usage of <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
634
            Check your code for overriding these methods.
635
            </hint>
636
        </question>
637
-->
638
 <answer id="format-clipboard">
639
  <p>
640
   XXX no answer for format-clipboard
641
  </p>
642
 </answer>
643
644
645
646
<!--
647
        <question id="format-dnd" when="impl">
648
            Which protocols (if any) does your code understand during Drag &amp; Drop?
649
            <hint>
650
            Often Node's deal with clipboard by usage of <code>Node.drag, Node.getDropType</code>. 
651
            Check your code for overriding these methods. Btw. if they are not overridden, they
652
            by default delegate to <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
653
            </hint>
654
        </question>
655
-->
656
 <answer id="format-dnd">
657
  <p>
658
   XXX no answer for format-dnd
659
  </p>
660
 </answer>
661
662
663
664
<!--
665
        <question id="format-types" when="impl">
666
            Which protocols and file formats (if any) does your module read or write on disk,
667
            or transmit or receive over the network? Do you generate an ant build script?
668
            Can it be edited and modified? 
669
            
670
            <hint>
671
            <p>
672
            Files can be read and written by other programs, modules and users. If they influence
673
            your behaviour, make sure you either document the format or claim that it is a private
674
            api (using the &lt;api&gt; tag). 
675
            </p>
676
            
677
            <p>
678
            If you generate an ant build file, this is very likely going to be seen by end users and
679
            they will be attempted to edit it. You should be ready for that and provide here a link
680
            to documentation that you have for such purposes and also describe how you are going to
681
            understand such files during next release, when you (very likely) slightly change the 
682
            format.
683
            </p>
684
            </hint>
685
        </question>
686
-->
687
 <answer id="format-types">
688
  <p>
689
   XXX no answer for format-types
690
  </p>
691
 </answer>
692
693
694
695
<!--
696
        <question id="lookup-lookup" when="init">
697
            Does your module use <code>org.openide.util.Lookup</code>
698
            or any similar technology to find any components to communicate with? Which ones?
699
            
700
            <hint>
701
            NetBeans is build around a generic registry of services called
702
            lookup. It is preferable to use it for registration and discovery
703
            if possible. See
704
            <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html">
705
            The Solution to Comunication Between Components
706
            </a>. If you do not plan to use lookup and insist usage
707
            of other solution, then please describe why it is not working for
708
            you.
709
            <br/>
710
            When filling the final version of your arch document, please
711
            describe the interfaces you are searching for, where 
712
            are defined, whether you are searching for just one or more of them,
713
            if the order is important, etc. Also classify the stability of such
714
            API contract. Use &lt;api group=&amp;lookup&amp; /&gt; tag, so
715
            your information gets listed in the summary page of your javadoc.
716
            </hint>
717
        </question>
718
-->
719
 <answer id="lookup-lookup">
720
  <p>
721
   XXX no answer for lookup-lookup
722
  </p>
723
 </answer>
724
725
726
727
<!--
728
        <question id="lookup-register" when="final">
729
            Do you register anything into lookup for other code to find?
730
            <hint>
731
            Do you register using layer file or using a declarative annotation such as <code>@ServiceProvider</code>?
732
            Who is supposed to find your component?
733
            </hint>
734
        </question>
735
-->
736
 <answer id="lookup-register">
737
  <p>
738
   XXX no answer for lookup-register
739
  </p>
740
 </answer>
741
742
743
744
<!--
745
        <question id="lookup-remove" when="final">
746
            Do you remove entries of other modules from lookup?
747
            <hint>
748
            Why? Of course, that is possible, but it can be dangerous. Is the module
749
            your are masking resource from aware of what you are doing?
750
            </hint>
751
        </question>
752
-->
753
 <answer id="lookup-remove">
754
  <p>
755
   XXX no answer for lookup-remove
756
  </p>
757
 </answer>
758
759
760
761
<!--
762
        <question id="perf-exit" when="final">
763
            Does your module run any code on exit?
764
        </question>
765
-->
766
 <answer id="perf-exit">
767
  <p>
768
   XXX no answer for perf-exit
769
  </p>
770
 </answer>
771
772
773
774
<!--
775
        <question id="perf-huge_dialogs" when="final">
776
            Does your module contain any dialogs or wizards with a large number of
777
            GUI controls such as combo boxes, lists, trees, or text areas?
778
        </question>
779
-->
780
 <answer id="perf-huge_dialogs">
781
  <p>
782
   XXX no answer for perf-huge_dialogs
783
  </p>
784
 </answer>
785
786
787
788
<!--
789
        <question id="perf-limit" when="init">
790
            Are there any hard-coded or practical limits in the number or size of
791
            elements your code can handle?
792
            <hint>
793
                Most of algorithms have increasing memory and speed complexity
794
                with respect to size of data they operate on. What is the critical
795
                part of your project that can be seen as a bottleneck with
796
                respect to speed or required memory? What are the practical
797
                sizes of data you tested your project with? What is your estimate
798
                of potential size of data that would cause visible performance
799
                problems? Is there some kind of check to detect such situation
800
                and prevent "hard" crashes - for example the CloneableEditorSupport
801
                checks for size of a file to be opened in editor
802
                and if it is larger than 1Mb it shows a dialog giving the
803
                user the right to decide - e.g. to cancel or commit suicide.
804
            </hint>
805
        </question>
806
-->
807
 <answer id="perf-limit">
808
  <p>
809
   XXX no answer for perf-limit
810
  </p>
811
 </answer>
812
813
814
815
<!--
816
        <question id="perf-mem" when="final">
817
            How much memory does your component consume? Estimate
818
            with a relation to the number of windows, etc.
819
        </question>
820
-->
821
 <answer id="perf-mem">
822
  <p>
823
   XXX no answer for perf-mem
824
  </p>
825
 </answer>
826
827
828
829
<!--
830
        <question id="perf-menus" when="final">
831
            Does your module use dynamically updated context menus, or
832
            context-sensitive actions with complicated and slow enablement logic?
833
            <hint>
834
                If you do a lot of tricks when adding actions to regular or context menus, you can significantly
835
                slow down display of the menu, even when the user is not using your action. Pay attention to
836
                actions you add to the main menu bar, and to context menus of foreign nodes or components. If
837
                the action is conditionally enabled, or changes its display dynamically, you need to check the
838
                impact on performance. In some cases it may be more appropriate to make a simple action that is
839
                always enabled but does more detailed checks in a dialog if it is actually run.
840
            </hint>
841
        </question>
842
-->
843
 <answer id="perf-menus">
844
  <p>
845
   XXX no answer for perf-menus
846
  </p>
847
 </answer>
848
849
850
851
<!--
852
        <question id="perf-progress" when="final">
853
            Does your module execute any long-running tasks?
854
            
855
            <hint>Long running tasks should never block 
856
            AWT thread as it badly hurts the UI
857
            <a href="http://performance.netbeans.org/responsiveness/issues.html">
858
            responsiveness</a>.
859
            Tasks like connecting over
860
            network, computing huge amount of data, compilation
861
            be done asynchronously (for example
862
            using <code>RequestProcessor</code>), definitively it should 
863
            not block AWT thread.
864
            </hint>
865
        </question>
866
-->
867
 <answer id="perf-progress">
868
  <p>
869
   XXX no answer for perf-progress
870
  </p>
871
 </answer>
872
873
874
875
<!--
876
        <question id="perf-scale" when="init">
877
            Which external criteria influence the performance of your
878
            program (size of file in editor, number of files in menu, 
879
            in source directory, etc.) and how well your code scales?
880
            <hint>
881
            Please include some estimates, there are other more detailed 
882
            questions to answer in later phases of implementation. 
883
            </hint>
884
        </question>
885
-->
886
 <answer id="perf-scale">
887
  <p>
888
   XXX no answer for perf-scale
889
  </p>
890
 </answer>
891
892
893
894
<!--
895
        <question id="perf-spi" when="init">
896
            How the performance of the plugged in code will be enforced?
897
            <hint>
898
            If you allow foreign code to be plugged into your own module, how
899
            do you enforce that it will behave correctly and quickly and will not
900
            negatively influence the performance of your own module?
901
            </hint>
902
        </question>
903
-->
904
 <answer id="perf-spi">
905
  <p>
906
   XXX no answer for perf-spi
907
  </p>
908
 </answer>
909
910
911
912
<!--
913
        <question id="perf-startup" when="final">
914
            Does your module run any code on startup?
915
        </question>
916
-->
917
 <answer id="perf-startup">
918
  <p>
919
   XXX no answer for perf-startup
920
  </p>
921
 </answer>
922
923
924
925
<!--
926
        <question id="perf-wakeup" when="final">
927
            Does any piece of your code wake up periodically and do something
928
            even when the system is otherwise idle (no user interaction)?
929
        </question>
930
-->
931
 <answer id="perf-wakeup">
932
  <p>
933
   XXX no answer for perf-wakeup
934
  </p>
935
 </answer>
936
937
938
939
<!--
940
        <question id="resources-file" when="final">
941
            Does your module use <code>java.io.File</code> directly?
942
            
943
            <hint>
944
            NetBeans provide a logical wrapper over plain files called 
945
            <code>org.openide.filesystems.FileObject</code> that
946
            provides uniform access to such resources and is the preferred
947
            way that should be used. But of course there can be situations when
948
            this is not suitable.
949
            </hint>
950
        </question>
951
-->
952
 <answer id="resources-file">
953
  <p>
954
   XXX no answer for resources-file
955
  </p>
956
 </answer>
957
958
959
960
<!--
961
        <question id="resources-layer" when="final">
962
            Does your module provide own layer? Does it create any files or
963
            folders in it? What it is trying to communicate by that and with which 
964
            components?
965
            
966
            <hint>
967
            NetBeans allows automatic and declarative installation of resources 
968
            by module layers. Module register files into appropriate places
969
            and other components use that information to perform their task
970
            (build menu, toolbar, window layout, list of templates, set of
971
            options, etc.). 
972
            </hint>
973
        </question>
974
-->
975
 <answer id="resources-layer">
976
  <p>
977
   XXX no answer for resources-layer
978
  </p>
979
 </answer>
980
981
982
983
<!--
984
        <question id="resources-mask" when="final">
985
            Does your module mask/hide/override any resources provided by other modules in
986
            their layers?
987
            
988
            <hint>
989
            If you mask a file provided by another module, you probably depend
990
            on that and do not want the other module to (for example) change
991
            the file's name. That module shall thus make that file available as an API
992
            of some stability category.
993
            </hint>
994
        </question>
995
-->
996
 <answer id="resources-mask">
997
  <p>
998
   XXX no answer for resources-mask
999
  </p>
1000
 </answer>
1001
1002
1003
1004
<!--
1005
        <question id="resources-preferences" when="final">
1006
            Does your module uses preferences via Preferences API? Does your module use NbPreferences or
1007
            or regular JDK Preferences ? Does it read, write or both ? 
1008
            Does it share preferences with other modules ? If so, then why ?
1009
            <hint>
1010
                You may use
1011
                    &lt;api type="export" group="preferences"
1012
                    name="preference node name" category="private"&gt;
1013
                    description of individual keys, where it is used, what it
1014
                    influences, whether the module reads/write it, etc.
1015
                    &lt;/api&gt;
1016
                Due to XML ID restrictions, rather than /org/netbeans/modules/foo give the "name" as org.netbeans.modules.foo.
1017
                Note that if you use NbPreferences this name will then be the same as the code name base of the module.
1018
            </hint>
1019
        </question>
1020
-->
1021
 <answer id="resources-preferences">
1022
  <p>
1023
   XXX no answer for resources-preferences
1024
  </p>
1025
 </answer>
1026
1027
1028
1029
<!--
1030
        <question id="resources-read" when="final">
1031
            Does your module read any resources from layers? For what purpose?
1032
            
1033
            <hint>
1034
            As this is some kind of intermodule dependency, it is a kind of API.
1035
            Please describe it and classify according to 
1036
            <a href="http://openide.netbeans.org/tutorial/api-design.html#categories">
1037
            common stability categories</a>.
1038
            </hint>
1039
        </question>
1040
-->
1041
 <answer id="resources-read">
1042
  <p>
1043
   XXX no answer for resources-read
1044
  </p>
1045
 </answer>
1046
1047
1048
1049
<!--
1050
        <question id="security-grant" when="final">
1051
            Does your code grant additional rights to some other code?
1052
            <hint>Avoid using a class loader that adds extra
1053
            permissions to loaded code unless really necessary.
1054
            Also note that your API implementation
1055
            can also expose unneeded permissions to enemy code by
1056
            calling AccessController.doPrivileged().</hint>
1057
        </question>
1058
-->
1059
 <answer id="security-grant">
1060
  <p>
1061
   XXX no answer for security-grant
1062
  </p>
1063
 </answer>
1064
1065
1066
1067
<!--
1068
        <question id="security-policy" when="final">
1069
            Does your functionality require modifications to the standard policy file?
1070
            <hint>Your code might pass control to third-party code not
1071
            coming from trusted domains. This could be code downloaded over the
1072
            network or code coming from libraries that are not bundled
1073
            with NetBeans. Which permissions need to be granted to which domains?</hint>
1074
        </question>
1075
-->
1076
 <answer id="security-policy">
1077
  <p>
1078
   XXX no answer for security-policy
1079
  </p>
1080
 </answer>
1081
1082
</api-answers>
(-)a/core.ide/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.core.ide/1
2
OpenIDE-Module: org.netbeans.core.ide/1
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/ide/resources/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/core/ide/resources/Bundle.properties
4
OpenIDE-Module-Specification-Version: 1.13
4
OpenIDE-Module-Specification-Version: 1.15
5
AutoUpdate-Show-In-Client: false
5
AutoUpdate-Show-In-Client: false
6
OpenIDE-Module-Layer: org/netbeans/core/ide/resources/layer.xml
6
OpenIDE-Module-Layer: org/netbeans/core/ide/resources/layer.xml
(-)a/core.ide/nbproject/project.properties (+3 lines)
Lines 45-47 Link Here
45
    shortcuts.pdf
45
    shortcuts.pdf
46
javac.compilerargs=-Xlint -Xlint:-serial
46
javac.compilerargs=-Xlint -Xlint:-serial
47
javac.source=1.5
47
javac.source=1.5
48
cp.extra=${nb_all}/apisupport.harness/external/openjdk-javac-6-b12.jar
49
50
javadoc.arch=${basedir}/arch.xml
(-)a/core.ide/nbproject/project.xml (-1 / +11 lines)
Lines 61-66 Link Here
61
                    </run-dependency>
61
                    </run-dependency>
62
                </dependency>
62
                </dependency>
63
                <dependency>
63
                <dependency>
64
                    <code-name-base>org.openide.filesystems</code-name-base>
65
                    <build-prerequisite/>
66
                    <compile-dependency/>
67
                    <run-dependency>
68
                        <specification-version>7.21</specification-version>
69
                    </run-dependency>
70
                </dependency>
71
                <dependency>
64
                    <code-name-base>org.openide.nodes</code-name-base>
72
                    <code-name-base>org.openide.nodes</code-name-base>
65
                    <build-prerequisite/>
73
                    <build-prerequisite/>
66
                    <compile-dependency/>
74
                    <compile-dependency/>
Lines 85-91 Link Here
85
                    </run-dependency>
93
                    </run-dependency>
86
                </dependency>
94
                </dependency>
87
            </module-dependencies>
95
            </module-dependencies>
88
            <public-packages/>
96
            <public-packages>
97
                <package>org.netbeans.api.core.ide</package>
98
            </public-packages>
89
        </data>
99
        </data>
90
    </configuration>
100
    </configuration>
91
</project>
101
</project>
(-)fab8ea7d1591 (+86 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.api.core.ide;
41
42
import java.lang.annotation.ElementType;
43
import java.lang.annotation.Retention;
44
import java.lang.annotation.RetentionPolicy;
45
import java.lang.annotation.Target;
46
import org.openide.nodes.AbstractNode;
47
import org.openide.nodes.Node;
48
49
/** Annotation applicable to any class that extends {@link Node} or
50
 * static method that returns {@link Node}. Its presence means that
51
 * the node shall appear in the <em>Services</em> tab.
52
 *
53
 * @author Jaroslav Tulach <jtulach@netbeans.org>
54
 */
55
@Retention(RetentionPolicy.SOURCE)
56
@Target({ ElementType.METHOD, ElementType.TYPE })
57
public @interface ServiceTabNodeRegistration {
58
    /** @return programatic name of the node */
59
    String name();
60
    /** Human readable name. Use <code>#KEY</code> to reference a key in
61
     * <code>Bundle.properties</code> file next to the node class
62
     * or factory method.
63
     *
64
     * @return human readable name or reference to bundle
65
     */
66
    String displayName();
67
68
    /** Description of the node. Use <code>#KEY</code> to reference a key in
69
     * <code>Bundle.properties</code> file next to the node class
70
     * or factory method.
71
     *
72
     * @return human readable short description or readable to bundle
73
     */
74
    String shortDescription() default "";
75
76
    /** Icon to use for the node. The icon can have additional variants
77
     * see {@link AbstractNode#setIconBaseWithExtension(java.lang.String)}
78
     * for more info.
79
     *
80
     */
81
    String iconResource();
82
83
    /** Ordering location of the {@link Node}.
84
     */
85
    int position() default Integer.MAX_VALUE;
86
}
(-)fab8ea7d1591 (+95 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2008 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.core.ide;
41
42
import java.util.Set;
43
import javax.annotation.processing.Processor;
44
import javax.annotation.processing.RoundEnvironment;
45
import javax.annotation.processing.SupportedAnnotationTypes;
46
import javax.annotation.processing.SupportedSourceVersion;
47
import javax.lang.model.SourceVersion;
48
import javax.lang.model.element.Element;
49
import javax.lang.model.element.ElementKind;
50
import javax.lang.model.element.ExecutableElement;
51
import javax.lang.model.element.Modifier;
52
import javax.lang.model.element.TypeElement;
53
import javax.lang.model.type.TypeMirror;
54
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
55
import org.omg.PortableServer.POA;
56
import org.openide.filesystems.annotations.LayerBuilder.File;
57
import org.openide.filesystems.annotations.LayerGeneratingProcessor;
58
import org.openide.filesystems.annotations.LayerGenerationException;
59
import org.openide.nodes.Node;
60
import org.openide.util.lookup.ServiceProvider;
61
62
/**
63
 * processor for {@link ServiceTabNodeRegistration} annotation.
64
 * @author Jaroslav Tulach
65
 */
66
@ServiceProvider(service=Processor.class)
67
@SupportedSourceVersion(SourceVersion.RELEASE_6)
68
@SupportedAnnotationTypes("org.netbeans.api.core.ide.ServiceTabNodeRegistration")//NOI18N
69
public class ServiceTabProcessor extends LayerGeneratingProcessor {
70
    @Override
71
    protected boolean handleProcess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) throws LayerGenerationException {
72
        if (roundEnv.processingOver()) {
73
            return false;
74
        }
75
        for (Element e : roundEnv.getElementsAnnotatedWith(ServiceTabNodeRegistration.class)) {
76
            ServiceTabNodeRegistration reg = e.getAnnotation(ServiceTabNodeRegistration.class);
77
            File f = layer(e).
78
                instanceFile("UI/Runtime", null, Node.class).
79
                stringvalue("iconResource", reg.iconResource()).
80
                stringvalue("name", reg.name()).
81
                methodvalue("instanceCreate", "org.openide.nodes.NodeOp", "factory").
82
                bundlevalue("displayName", reg.displayName()).
83
                instanceAttribute("original", Node.class);
84
            if (!"".equals(reg.shortDescription())) {
85
                f.bundlevalue("shortDescription", reg.shortDescription());
86
            }
87
            if (reg.position() != Integer.MAX_VALUE) {
88
                f.intvalue("position", reg.position());
89
            }
90
            f.write();
91
        }
92
        return true;
93
    }
94
95
}
(-)fab8ea7d1591 (+117 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.core.ide;
41
42
import java.awt.Image;
43
import java.beans.BeanInfo;
44
import java.util.Collection;
45
import org.junit.After;
46
import org.junit.Before;
47
import org.junit.Test;
48
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
49
import org.openide.nodes.AbstractNode;
50
import org.openide.nodes.Children;
51
import org.openide.nodes.Node;
52
import org.openide.util.ImageUtilities;
53
import org.openide.util.lookup.Lookups;
54
import static org.junit.Assert.*;
55
56
/**
57
 *
58
 * @author Jaroslav Tulach <jtulach@netbeans.org>
59
 */
60
public class ServiceTabProcessorTest {
61
62
    @Before
63
    public void setUp() {
64
    }
65
66
    @After
67
    public void tearDown() {
68
    }
69
70
    @Test
71
    public void testNodesGeneratedCorrectly() throws Exception {
72
        Collection<? extends Node> arr = Lookups.forPath("UI/Runtime").lookupAll(Node.class);
73
        assertEquals("One node is there: " + arr, 1, arr.size());
74
        Node n = arr.iterator().next();
75
76
        assertEquals("my1", n.getName());
77
        assertEquals("disp1", n.getDisplayName());
78
        assertEquals("By default short description delegates to displayName", n.getDisplayName(), n.getShortDescription());
79
80
        Image img1 = ImageUtilities.loadImage("org/netbeans/core/ide/TestIcon1.png");
81
        Image img2 = ImageUtilities.loadImage("org/netbeans/core/ide/TestIcon2.png");
82
83
        assertSame("icon1 is in use", img1, n.getIcon(BeanInfo.ICON_COLOR_16x16));
84
85
        Node[] subNodes = n.getChildren().getNodes(true);
86
        assertEquals("Two subnodes", 2, subNodes.length);
87
88
        // now everything is initialized
89
90
        assertEquals("my2", n.getName());
91
        assertEquals("disp2", n.getDisplayName());
92
        assertEquals("short2", n.getShortDescription());
93
        assertSame("icon2 is in use", img2, n.getIcon(BeanInfo.ICON_COLOR_16x16));
94
95
    }
96
97
    @ServiceTabNodeRegistration(
98
        name="my1", displayName="org.netbeans.core.ide.TestBundle#NAME", position=10,
99
        iconResource="org/netbeans/core/ide/TestIcon1.png"
100
    )
101
    public static class MyNode extends AbstractNode {
102
        public MyNode() {
103
            this(true);
104
        }
105
        private MyNode(boolean addChildren) {
106
            super(new Children.Array());
107
            setName("my2");
108
            setDisplayName("disp2");
109
            setShortDescription("short2");
110
            setIconBaseWithExtension("org/netbeans/core/ide/TestIcon2.png");
111
112
            if (addChildren) {
113
                getChildren().add(new Node[] { new MyNode(false), new MyNode(false) });
114
            }
115
        }
116
    }
117
}
(-)fab8ea7d1591 (+39 lines)
Added Link Here
1
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
2
#
3
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
4
#
5
# The contents of this file are subject to the terms of either the GNU
6
# General Public License Version 2 only ("GPL") or the Common
7
# Development and Distribution License("CDDL") (collectively, the
8
# "License"). You may not use this file except in compliance with the
9
# License. You can obtain a copy of the License at
10
# http://www.netbeans.org/cddl-gplv2.html
11
# or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
12
# specific language governing permissions and limitations under the
13
# License.  When distributing the software, include this License Header
14
# Notice in each file and include the License file at
15
# nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
16
# particular file as subject to the "Classpath" exception as provided
17
# by Sun in the GPL Version 2 section of the License file that
18
# accompanied this code. If applicable, add the following below the
19
# License Header, with the fields enclosed by brackets [] replaced by
20
# your own identifying information:
21
# "Portions Copyrighted [year] [name of copyright owner]"
22
#
23
# If you wish your version of this file to be governed by only the CDDL
24
# or only the GPL Version 2, indicate your decision by adding
25
# "[Contributor] elects to include this software in this distribution
26
# under the [CDDL or GPL Version 2] license." If you do not indicate a
27
# single choice of license, a recipient has the option to distribute
28
# your version of this file under either the CDDL, the GPL Version 2 or
29
# to extend the choice of license to its licensees as provided above.
30
# However, if you add GPL Version 2 code and therefore, elected the GPL
31
# Version 2 license, then the option applies only if the new code is
32
# made subject to such option by the copyright holder.
33
#
34
# Contributor(s):
35
#
36
# Portions Copyrighted 2009 Sun Microsystems, Inc.
37
38
39
NAME=disp1
(-)a/db/nbproject/project.xml (-1 / +6 lines)
Lines 151-158 Link Here
151
                    <build-prerequisite/>
151
                    <build-prerequisite/>
152
                    <compile-dependency/>
152
                    <compile-dependency/>
153
                    <run-dependency>
153
                    <run-dependency>
154
                        <specification-version>6.2</specification-version>
154
                        <specification-version>7.9</specification-version>
155
                    </run-dependency>
155
                    </run-dependency>
156
                </dependency>
157
                <dependency>
158
                    <code-name-base>org.netbeans.core.ide</code-name-base>
159
                    <build-prerequisite/>
160
                    <compile-dependency/>
156
                </dependency>
161
                </dependency>
157
                <dependency>
162
                <dependency>
158
                    <code-name-base>org.openide.util</code-name-base>
163
                    <code-name-base>org.openide.util</code-name-base>
(-)a/db/src/org/netbeans/modules/db/explorer/node/RootNode.java (-1 / +8 lines)
Lines 41-46 Link Here
41
41
42
import java.beans.PropertyChangeEvent;
42
import java.beans.PropertyChangeEvent;
43
import java.beans.PropertyChangeListener;
43
import java.beans.PropertyChangeListener;
44
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
44
import org.netbeans.api.db.explorer.node.BaseNode;
45
import org.netbeans.api.db.explorer.node.BaseNode;
45
import org.netbeans.api.db.explorer.node.ChildNodeFactory;
46
import org.netbeans.api.db.explorer.node.ChildNodeFactory;
46
import org.netbeans.lib.ddl.impl.SpecificationFactory;
47
import org.netbeans.lib.ddl.impl.SpecificationFactory;
Lines 69-77 Link Here
69
70
70
    /**
71
    /**
71
     * Gets the singleton instance.
72
     * Gets the singleton instance.
72
     * 
73
     *            
73
     * @return the singleton instance
74
     * @return the singleton instance
74
     */
75
     */
76
    @ServiceTabNodeRegistration(
77
        name="Databases",
78
        displayName="org/netbeans/modules/db/resources/Bundle#RootNode_DISPLAYNAME",
79
        iconResource="org/netbeans/modules/db/resources/database.gif",
80
        position=101
81
    )
75
    public static RootNode instance() {
82
    public static RootNode instance() {
76
        if (instance == null) { 
83
        if (instance == null) { 
77
            NodeDataLookup lookup = new NodeDataLookup();
84
            NodeDataLookup lookup = new NodeDataLookup();
(-)a/db/src/org/netbeans/modules/db/resources/mf-layer.xml (-21 lines)
Lines 550-576 Link Here
550
550
551
    </folder>
551
    </folder>
552
552
553
    <!-- UI -->
554
    <folder name="UI">
555
        <folder name="Runtime">
556
            <!--
557
           <file name="org-netbeans-modules-db-explorer-nodes-RootNode.instance">
558
             <attr name="instanceClass" stringvalue="org.netbeans.modules.db.explorer.nodes.RootNode"/>
559
             <attr name="instanceCreate" methodvalue="org.netbeans.modules.db.explorer.nodes.RootNode.getInstance"/>
560
               <attr name="position" intvalue="100"/>
561
            </file>
562
           -->
563
           <!-- uncomment this block to include the new explorer tree -->
564
           <file name="org-netbeans-modules-db-explorer-node-RootNode.instance">
565
             <attr name="instanceClass" stringvalue="org.netbeans.modules.db.explorer.node.RootNode"/>
566
             <attr name="instanceCreate" methodvalue="org.netbeans.modules.db.explorer.node.RootNode.instance"/>
567
               <attr name="position" intvalue="101"/>
568
            </file>
569
            <!-- -->
570
        </folder> <!-- Runtime -->
571
572
    </folder> <!-- UI -->
573
574
    <folder name="xml">
553
    <folder name="xml">
575
        <folder name="entities">
554
        <folder name="entities">
576
            <folder name="NetBeans">
555
            <folder name="NetBeans">
(-)a/hudson/nbproject/project.xml (-1 / +6 lines)
Lines 120-127 Link Here
120
                    <build-prerequisite/>
120
                    <build-prerequisite/>
121
                    <compile-dependency/>
121
                    <compile-dependency/>
122
                    <run-dependency>
122
                    <run-dependency>
123
                        <specification-version>7.1</specification-version>
123
                        <specification-version>7.9</specification-version>
124
                    </run-dependency>
124
                    </run-dependency>
125
                </dependency>
126
                <dependency>
127
                    <code-name-base>org.netbeans.core.ide</code-name-base>
128
                    <build-prerequisite/>
129
                    <compile-dependency/>
125
                </dependency>
130
                </dependency>
126
                <dependency>
131
                <dependency>
127
                    <code-name-base>org.openide.text</code-name-base>
132
                    <code-name-base>org.openide.text</code-name-base>
(-)a/hudson/src/org/netbeans/modules/hudson/layer.xml (-9 lines)
Lines 19-31 Link Here
19
            </file>
19
            </file>
20
        </folder>
20
        </folder>
21
    </folder>
21
    </folder>
22
    <folder name="UI">
23
        <folder name="Runtime">
24
            <file name="org-netbeans-modules-hudson-ui-nodes-HudsonRootNode.instance">
25
                <attr name="instanceClass" stringvalue="org.netbeans.modules.hudson.ui.nodes.HudsonRootNode"/>
26
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.hudson.ui.nodes.HudsonRootNode.getDefault"/>
27
                <attr name="position" intvalue="488"/>
28
            </file>
29
        </folder>     
30
    </folder>
31
</filesystem>
22
</filesystem>
(-)a/hudson/src/org/netbeans/modules/hudson/ui/nodes/HudsonRootNode.java (+7 lines)
Lines 45-50 Link Here
45
import java.util.Collections;
45
import java.util.Collections;
46
import java.util.List;
46
import java.util.List;
47
import javax.swing.Action;
47
import javax.swing.Action;
48
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
48
import org.netbeans.modules.hudson.api.HudsonChangeListener;
49
import org.netbeans.modules.hudson.api.HudsonChangeListener;
49
import org.netbeans.modules.hudson.impl.HudsonInstanceImpl;
50
import org.netbeans.modules.hudson.impl.HudsonInstanceImpl;
50
import org.netbeans.modules.hudson.impl.HudsonManagerImpl;
51
import org.netbeans.modules.hudson.impl.HudsonManagerImpl;
Lines 84-89 Link Here
84
     *
85
     *
85
     * @return default instance of HudsonRootNode
86
     * @return default instance of HudsonRootNode
86
     */
87
     */
88
    @ServiceTabNodeRegistration(
89
        name="hudson",
90
        displayName="org.netbeans.modules.hudson.ui.nodes.Bundle#LBL_HudsonNode",
91
        iconResource="org/netbeans/modules/hudson/ui/resources/hudson.png",
92
        position=488
93
    )
87
    public static HudsonRootNode getDefault() {
94
    public static HudsonRootNode getDefault() {
88
        synchronized(LOCK_INIT) {
95
        synchronized(LOCK_INIT) {
89
            if (null == defaultInstance)
96
            if (null == defaultInstance)
(-)a/nbbuild/build.properties (+1 lines)
Lines 160-165 Link Here
160
config.javadoc.stable=\
160
config.javadoc.stable=\
161
    api.annotations.common,\
161
    api.annotations.common,\
162
    autoupdate.services,\
162
    autoupdate.services,\
163
    core.ide,\
163
    openide.util,\
164
    openide.util,\
164
    openide.actions,\
165
    openide.actions,\
165
    openide.awt,\
166
    openide.awt,\
(-)a/nbbuild/hudson/core-main (+1 lines)
Lines 20-25 Link Here
20
    testmodule autoupdate.services
20
    testmodule autoupdate.services
21
    testmodule autoupdate.ui
21
    testmodule autoupdate.ui
22
    testmodule core.execution
22
    testmodule core.execution
23
    testmodule core.ide
23
    testmodule core.kit
24
    testmodule core.kit
24
    testmodule core.multiview
25
    testmodule core.multiview
25
    testmodule core.output2
26
    testmodule core.output2
(-)a/nbbuild/javadoctools/links.xml (+1 lines)
Lines 183-185 Link Here
183
<link href="${javadoc.docs.org-netbeans-modules-mobility-project}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-modules-mobility-project"/>
183
<link href="${javadoc.docs.org-netbeans-modules-mobility-project}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-modules-mobility-project"/>
184
<link href="${javadoc.docs.org-netbeans-api-annotations-common}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-api-annotations-common"/>
184
<link href="${javadoc.docs.org-netbeans-api-annotations-common}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-api-annotations-common"/>
185
<link href="${javadoc.docs.org-netbeans-modules-kenai-ui}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-modules-kenai-ui"/>
185
<link href="${javadoc.docs.org-netbeans-modules-kenai-ui}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-modules-kenai-ui"/>
186
<link href="${javadoc.docs.org-netbeans-core-ide}" offline="true" packagelistloc="${netbeans.javadoc.dir}/org-netbeans-core-ide"/>
(-)a/nbbuild/javadoctools/properties.xml (+1 lines)
Lines 181-183 Link Here
181
<property name="javadoc.docs.org-netbeans-modules-mobility-project" value="${javadoc.web.root}/org-netbeans-modules-mobility-project"/>
181
<property name="javadoc.docs.org-netbeans-modules-mobility-project" value="${javadoc.web.root}/org-netbeans-modules-mobility-project"/>
182
<property name="javadoc.docs.org-netbeans-api-annotations-common" value="${javadoc.web.root}/org-netbeans-api-annotations-common"/>
182
<property name="javadoc.docs.org-netbeans-api-annotations-common" value="${javadoc.web.root}/org-netbeans-api-annotations-common"/>
183
<property name="javadoc.docs.org-netbeans-modules-kenai-ui" value="${javadoc.web.root}/org-netbeans-modules-kenai-ui"/>
183
<property name="javadoc.docs.org-netbeans-modules-kenai-ui" value="${javadoc.web.root}/org-netbeans-modules-kenai-ui"/>
184
<property name="javadoc.docs.org-netbeans-core-ide" value="${javadoc.web.root}/org-netbeans-core-ide"/>
(-)a/nbbuild/javadoctools/replaces.xml (+1 lines)
Lines 181-183 Link Here
181
<replacefilter token="@org-netbeans-modules-mobility-project@" value="${javadoc.docs.org-netbeans-modules-mobility-project}"/>
181
<replacefilter token="@org-netbeans-modules-mobility-project@" value="${javadoc.docs.org-netbeans-modules-mobility-project}"/>
182
<replacefilter token="@org-netbeans-api-annotations-common@" value="${javadoc.docs.org-netbeans-api-annotations-common}"/>
182
<replacefilter token="@org-netbeans-api-annotations-common@" value="${javadoc.docs.org-netbeans-api-annotations-common}"/>
183
<replacefilter token="@org-netbeans-modules-kenai-ui@" value="${javadoc.docs.org-netbeans-modules-kenai-ui}"/>
183
<replacefilter token="@org-netbeans-modules-kenai-ui@" value="${javadoc.docs.org-netbeans-modules-kenai-ui}"/>
184
<replacefilter token="@org-netbeans-core-ide@" value="${javadoc.docs.org-netbeans-core-ide}"/>
(-)a/openide.nodes/apichanges.xml (+18 lines)
Lines 46-51 Link Here
46
<apidef name="nodes">Nodes API</apidef>
46
<apidef name="nodes">Nodes API</apidef>
47
</apidefs>
47
</apidefs>
48
<changes>
48
<changes>
49
    <change id="NodeOp.factory">
50
        <api name="nodes"/>
51
        <summary>Support for declarative Node registrations</summary>
52
        <version major="7" minor="9"/>
53
        <date day="1" month="4" year="2009"/>
54
        <author login="jtulach"/>
55
        <compatibility addition="yes" binary="compatible" source="compatible" semantic="compatible"/>
56
        <description>
57
            <p>
58
            <a href="@TOP@/org/openide/nodes/NodeOp.html#factory">NodeOp.factory</a>
59
            is new method, particularly useful from
60
            <a href="@org-openide-modules@/org/openide/modules/doc-files/api.html#how-layer">layers</a>
61
            that allows declarative definition of a root node.
62
            </p>
63
        </description>
64
        <class package="org.openide.nodes" name="NodeOp"/>
65
        <issue number="161286"/>
66
    </change>
49
    <change id="ChildFactory.Detachable">
67
    <change id="ChildFactory.Detachable">
50
        <api name="nodes"/>
68
        <api name="nodes"/>
51
        <summary>Adding ChildFactory.Detachable to allow ChildFactory implementations to
69
        <summary>Adding ChildFactory.Detachable to allow ChildFactory implementations to
(-)a/openide.nodes/nbproject/project.properties (-1 / +1 lines)
Lines 44-47 Link Here
44
javadoc.arch=${basedir}/arch.xml
44
javadoc.arch=${basedir}/arch.xml
45
javadoc.apichanges=${basedir}/apichanges.xml
45
javadoc.apichanges=${basedir}/apichanges.xml
46
46
47
spec.version.base=7.8.0
47
spec.version.base=7.9.0
(-)fab8ea7d1591 (+103 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.openide.nodes;
41
42
import java.util.List;
43
import java.util.Map;
44
import javax.swing.Action;
45
46
/** Lazy delegating node.
47
 *
48
 * @author Jaroslav Tulach <jtulach@netbeans.org>
49
 */
50
final class LazyNode extends FilterNode {
51
    private Map map;
52
53
    LazyNode(Map map) {
54
        this(new ChFactory(), map);
55
    }
56
    private LazyNode(ChFactory factory, Map map) {
57
        super(new AbstractNode(Children.create(factory, true)));
58
        factory.node = this;
59
        this.map = map;
60
        
61
        AbstractNode an = (AbstractNode)getOriginal();
62
63
        an.setName((String) map.get("name")); // NOI18N
64
        an.setDisplayName((String) map.get("displayName")); // NOI18N
65
        an.setShortDescription((String) map.get("shortDescription")); // NOI18N
66
        an.setIconBaseWithExtension((String)map.get("iconResource")); // NOI18N
67
    }
68
69
    @Override
70
    public Action[] getActions(boolean context) {
71
        switchToOriginal();
72
        return super.getActions(context);
73
    }
74
75
76
    final void switchToOriginal() {
77
        Node n;
78
        synchronized (this) {
79
            if (map == null) {
80
                return;
81
            }
82
            n = (Node)map.get("original"); // NOI18N
83
            map = null;
84
        }
85
        changeOriginal(n, true);
86
    }
87
88
    private static final class ChFactory extends ChildFactory<Object> {
89
        LazyNode node;
90
91
        @Override
92
        protected boolean createKeys(List<Object> toPopulate) {
93
            LazyNode n = node;
94
            node = null;
95
            if (n != null) {
96
                n.switchToOriginal();
97
                return true;
98
            } else {
99
                return false;
100
            }
101
        }
102
    }
103
}
(-)a/openide.nodes/src/org/openide/nodes/NodeOp.java (+52 lines)
Lines 442-447 Link Here
442
        return WeakListeners.create(NodeListener.class, l, source);
442
        return WeakListeners.create(NodeListener.class, l, source);
443
    }
443
    }
444
444
445
    /** Creates a <q>lazy node</q> - a node that displays basic information
446
     * about the original node behind it, without touching it. As soon as
447
     * the node is expanded, or a pop up menu is invoked on it, it switches
448
     * to the real delegates and since then everything is being bridged to
449
     * the real node.
450
     * <p>
451
     * This method is especially useful when used from 
452
     * <a href="@org-openide-modules@/org/openide/modules/doc-files/api.html#how-layer">layers</a>.
453
     * Use following
454
     * XML snippet to register your node into Services tab:
455
     * <pre>
456
     * &lt;folder name="UI"&gt;
457
     *   &lt;folder name="Runtime"&gt;
458
     *     &lt;file name="org-yourorg-yourpgk-YourNode.instance"&gt;
459
     *       &lt;attr name="instanceCreate" methodvalue="org.openide.nodes.NodeOp.factory"/&gt;
460
     *       &lt;attr name="name" stringvalue="YourNode"/&gt;
461
     *       &lt;attr name="displayName" bundlevalue="org.yourorg.yourpkg.Bundle#NAME-KEY"/&gt;
462
     *       &lt;attr name="shortDescription" bundlevalue="org.yourorg.yourpkg.Bundle#SHORT-KEY"/&gt;
463
     *       &lt;attr name="iconResource" stringvalue="org/yourorg/yourpkg/image.png"/&gt;
464
     *       &lt;attr name="original" newvalue="org.yourorg.yourpkg.YourNode"/&gt;
465
     *     &lt;file/&gt;
466
     *   &lt;folder/&gt;
467
     * &lt;folder/&gt;
468
     * </pre>
469
     *
470
     * @param original the real node behind the one created
471
     * @param name programatic name of the node
472
     * @param displayName human readable name of the node
473
     * @param shortDescription short description for the node
474
     * @param iconResource path to icon to use as in {@link AbstractNode#setIconBaseWithExtension(java.lang.String)}
475
     * @return new node with preset defaults that can delegate to original
476
     *
477
     * @since 7.9
478
     */
479
    public static Node factory(
480
        Node original,
481
        String name, String displayName, String shortDescription,
482
        String iconResource
483
    ) {
484
        Map<Object,Object> map = new HashMap<Object,Object>();
485
        map.put("original", original); // NOI18N
486
        map.put("name", name); // NOI18N
487
        map.put("displayName", displayName); // NOI18N
488
        map.put("shortDescription", shortDescription); // NOI18N
489
        map.put("iconResource", iconResource); // NOI18N
490
        return new LazyNode(map);
491
    }
492
493
    static Node factory(Map<?,?> map) {
494
        return new LazyNode(map);
495
    }
496
445
    /** Utility method to remove dependency of this package on
497
    /** Utility method to remove dependency of this package on
446
     * org.openide.actions. This method takes names of classes from
498
     * org.openide.actions. This method takes names of classes from
447
     * that package and creates their instances.
499
     * that package and creates their instances.
(-)fab8ea7d1591 (+186 lines)
Added Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.openide.nodes;
41
42
import java.util.HashMap;
43
import javax.swing.Action;
44
import org.junit.After;
45
import org.junit.AfterClass;
46
import org.junit.Before;
47
import org.junit.BeforeClass;
48
import org.junit.Test;
49
import org.openide.util.HelpCtx;
50
import org.openide.util.actions.CallbackSystemAction;
51
import org.openide.util.actions.SystemAction;
52
import static org.junit.Assert.*;
53
54
/**
55
 *
56
 * @author Jaroslav Tulach <jtulach@netbeans.org>
57
 */
58
public class LazyNodeTest {
59
60
    public LazyNodeTest() {
61
    }
62
63
    @BeforeClass
64
    public static void setUpClass() throws Exception {
65
    }
66
67
    @AfterClass
68
    public static void tearDownClass() throws Exception {
69
    }
70
71
    @Before
72
    public void setUp() {
73
    }
74
75
    @After
76
    public void tearDown() {
77
    }
78
79
    @Test
80
    public void testCreateOriginalAfterNodeExpansion() {
81
        doCreateOriginal(true);
82
    }
83
84
    @Test
85
    public void testCreateOriginalAfterGetActions() {
86
        doCreateOriginal(false);
87
    }
88
89
    private void doCreateOriginal(boolean askForChildren) {
90
        AbstractNode realNode = new AbstractNode(new Children.Array()) {
91
            @Override
92
            public Action[] getActions(boolean context) {
93
                return getActions();
94
            }
95
96
            @SuppressWarnings("deprecation")
97
            @Override
98
            public SystemAction[] getActions() {
99
                return new SystemAction[] {
100
                    A1.get(A1.class),
101
                    A2.get(A2.class),
102
                    A3.get(A3.class)
103
                };
104
            }
105
        };
106
        realNode.setName("RealNode");
107
        realNode.setDisplayName("Real Node");
108
        realNode.setShortDescription("Real Node for Test");
109
        realNode.getChildren().add(new Node[] {
110
            new AbstractNode(Children.LEAF),
111
            new AbstractNode(Children.LEAF),
112
            new AbstractNode(Children.LEAF),
113
        });
114
115
        CntHashMap chm = new CntHashMap("original");
116
        chm.put("name", "ANode");
117
        chm.put("displayName", "A Node");
118
        chm.put("shortDescription", "A Node for Test");
119
        chm.put("iconResource", "org/openide/nodes/beans.gif");
120
        chm.put("original", realNode);
121
122
        Node instance = NodeOp.factory(chm);
123
        assertEquals("ANode", instance.getName());
124
        assertEquals("A Node", instance.getDisplayName());
125
        assertEquals("A Node for Test", instance.getShortDescription());
126
        assertEquals("No real node queried yet", 0, chm.cnt);
127
128
        if (askForChildren) {
129
            Node[] arr = instance.getChildren().getNodes(true);
130
            assertEquals("Three children", 3, arr.length);
131
        } else {
132
            Action[] arr = instance.getActions(true);
133
            assertEquals("Three actions", 3, arr.length);
134
        }
135
        
136
        assertEquals("Real node queried now", 1, chm.cnt);
137
138
        assertEquals("RealNode", instance.getName());
139
        assertEquals("Real Node", instance.getDisplayName());
140
        assertEquals("Real Node for Test", instance.getShortDescription());
141
    }
142
143
    private static class CntHashMap extends HashMap<Object,Object> {
144
        private final Object keyToWatch;
145
        int cnt;
146
147
        public CntHashMap(Object keyToWatch) {
148
            this.keyToWatch = keyToWatch;
149
        }
150
151
        @Override
152
        public Object get(Object key) {
153
            if (keyToWatch.equals(key)) {
154
                cnt++;
155
            }
156
            return super.get(key);
157
        }
158
159
160
    }
161
162
    public static class A1 extends CallbackSystemAction {
163
        @Override
164
        public String getName() {
165
            return "A1";
166
        }
167
168
        @Override
169
        public HelpCtx getHelpCtx() {
170
            throw new UnsupportedOperationException("Not supported yet.");
171
        }
172
173
    }
174
    public static final class A2 extends A1 {
175
        @Override
176
        public String getName() {
177
            return "A2";
178
        }
179
    }
180
    public static final class A3 extends A1 {
181
        @Override
182
        public String getName() {
183
            return "A3";
184
        }
185
    }
186
}
(-)a/server/nbproject/project.xml (-1 / +6 lines)
Lines 100-107 Link Here
100
                    <build-prerequisite/>
100
                    <build-prerequisite/>
101
                    <compile-dependency/>
101
                    <compile-dependency/>
102
                    <run-dependency>
102
                    <run-dependency>
103
                        <specification-version>7.3</specification-version>
103
                        <specification-version>7.9</specification-version>
104
                    </run-dependency>
104
                    </run-dependency>
105
                </dependency>
106
                <dependency>
107
                    <code-name-base>org.netbeans.core.ide</code-name-base>
108
                    <build-prerequisite/>
109
                    <compile-dependency/>
105
                </dependency>
110
                </dependency>
106
                <dependency>
111
                <dependency>
107
                    <code-name-base>org.openide.util</code-name-base>
112
                    <code-name-base>org.openide.util</code-name-base>
(-)a/server/src/org/netbeans/modules/server/resources/layer.xml (-10 lines)
Lines 43-58 Link Here
43
-->
43
-->
44
44
45
<filesystem>
45
<filesystem>
46
    <folder name="UI">
47
        <folder name="Runtime">
48
            <file name="ServerRegistry3.instance">
49
                <attr name="instanceCreate" methodvalue="org.netbeans.modules.server.ui.node.RootNode.getInstance"/>
50
                <attr name="instanceClass" stringvalue="org.netbeans.modules.server.ui.node.RootNode"/>
51
                <attr name="position" intvalue="400"/>
52
            </file>
53
       </folder>
54
    </folder>
55
    
56
    <folder name="Menu">
46
    <folder name="Menu">
57
        <folder name="Tools">
47
        <folder name="Tools">
58
            <file name="ServerManagerAction3.instance">
48
            <file name="ServerManagerAction3.instance">
(-)a/server/src/org/netbeans/modules/server/ui/node/RootNode.java (+8 lines)
Lines 49-54 Link Here
49
import javax.swing.Action;
49
import javax.swing.Action;
50
import javax.swing.event.ChangeEvent;
50
import javax.swing.event.ChangeEvent;
51
import javax.swing.event.ChangeListener;
51
import javax.swing.event.ChangeListener;
52
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
52
import org.netbeans.api.server.ServerInstance;
53
import org.netbeans.api.server.ServerInstance;
53
import org.netbeans.modules.server.ServerRegistry;
54
import org.netbeans.modules.server.ServerRegistry;
54
import org.netbeans.spi.server.ServerInstanceProvider;
55
import org.netbeans.spi.server.ServerInstanceProvider;
Lines 75-80 Link Here
75
        setIconBaseWithExtension(SERVERS_ICON);
76
        setIconBaseWithExtension(SERVERS_ICON);
76
    }
77
    }
77
78
79
    @ServiceTabNodeRegistration(
80
        name = "servers",
81
        displayName = "org.netbeans.modules.server.ui.node.Bundle#Server_Registry_Node_Name",
82
        shortDescription = "org.netbeans.modules.server.ui.node.Bundle#Server_Registry_Node_Short_Description",
83
        iconResource = "org/netbeans/modules/server/ui/resources/servers.png",
84
        position = 400
85
    )
78
    public static synchronized RootNode getInstance() {
86
    public static synchronized RootNode getInstance() {
79
        if (node == null) {
87
        if (node == null) {
80
            ChildFactory factory = new ChildFactory();
88
            ChildFactory factory = new ChildFactory();
(-)a/websvc.saas.ui/manifest.mf (-1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module: org.netbeans.modules.websvc.saas.ui
2
OpenIDE-Module: org.netbeans.modules.websvc.saas.ui
3
OpenIDE-Module-Layer: org/netbeans/modules/websvc/saas/ui/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/ui/Bundle.properties
3
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/ui/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.2
4
OpenIDE-Module-Specification-Version: 1.2
6
AutoUpdate-Show-In-Client: false
5
AutoUpdate-Show-In-Client: false
(-)a/websvc.saas.ui/nbproject/project.xml (-1 / +15 lines)
Lines 30-35 Link Here
30
                    <run-dependency>
30
                    <run-dependency>
31
                        <release-version>1</release-version>
31
                        <release-version>1</release-version>
32
                        <specification-version>1.6</specification-version>
32
                        <specification-version>1.6</specification-version>
33
                    </run-dependency>
34
                </dependency>
35
                <dependency>
36
                    <code-name-base>org.netbeans.modules.websvc.jaxwsmodelapi</code-name-base>
37
                    <build-prerequisite/>
38
                    <compile-dependency/>
39
                    <run-dependency>
40
                        <release-version>1</release-version>
41
                        <specification-version>1.0</specification-version>
33
                    </run-dependency>
42
                    </run-dependency>
34
                </dependency>
43
                </dependency>
35
                <dependency>
44
                <dependency>
Lines 103-110 Link Here
103
                    <build-prerequisite/>
112
                    <build-prerequisite/>
104
                    <compile-dependency/>
113
                    <compile-dependency/>
105
                    <run-dependency>
114
                    <run-dependency>
106
                        <specification-version>7.3</specification-version>
115
                        <specification-version>7.9</specification-version>
107
                    </run-dependency>
116
                    </run-dependency>
117
                </dependency>
118
                <dependency>
119
                    <code-name-base>org.netbeans.core.ide</code-name-base>
120
                    <build-prerequisite/>
121
                    <compile-dependency/>
108
                </dependency>
122
                </dependency>
109
                <dependency>
123
                <dependency>
110
                    <code-name-base>org.openide.text</code-name-base>
124
                    <code-name-base>org.openide.text</code-name-base>
(-)a/websvc.saas.ui/src/org/netbeans/modules/websvc/saas/ui/layer.xml (-53 lines)
Removed Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!--
3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
5
Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
6
7
8
The contents of this file are subject to the terms of either the GNU
9
General Public License Version 2 only ("GPL") or the Common
10
Development and Distribution License("CDDL") (collectively, the
11
"License"). You may not use this file except in compliance with the
12
License. You can obtain a copy of the License at
13
http://www.netbeans.org/cddl-gplv2.html
14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15
specific language governing permissions and limitations under the
16
License.  When distributing the software, include this License Header
17
Notice in each file and include the License file at
18
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
19
particular file as subject to the "Classpath" exception as provided
20
by Sun in the GPL Version 2 section of the License file that
21
accompanied this code. If applicable, add the following below the
22
License Header, with the fields enclosed by brackets [] replaced by
23
your own identifying information:
24
"Portions Copyrighted [year] [name of copyright owner]"
25
26
Contributor(s):
27
28
The Original Software is NetBeans. The Initial Developer of the Original
29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
30
Microsystems, Inc. All Rights Reserved.
31
32
If you wish your version of this file to be governed by only the CDDL
33
or only the GPL Version 2, indicate your decision by adding
34
"[Contributor] elects to include this software in this distribution
35
under the [CDDL or GPL Version 2] license." If you do not indicate a
36
single choice of license, a recipient has the option to distribute
37
your version of this file under either the CDDL, the GPL Version 2 or
38
to extend the choice of license to its licensees as provided above.
39
However, if you add GPL Version 2 code and therefore, elected the GPL
40
Version 2 license, then the option applies only if the new code is
41
made subject to such option by the copyright holder.
42
-->
43
44
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
45
<filesystem>
46
    <folder name="UI">
47
        <folder name="Runtime">
48
            <file name="org-netbeans-modules-websvc-saas-ui-nodes-SaasServicesRootNode.instance">
49
                <attr name="position" intvalue="210"/>
50
            </file>
51
        </folder>
52
    </folder>
53
</filesystem>
(-)a/websvc.saas.ui/src/org/netbeans/modules/websvc/saas/ui/nodes/SaasServicesRootNode.java (+8 lines)
Lines 43-48 Link Here
43
import java.beans.PropertyChangeEvent;
43
import java.beans.PropertyChangeEvent;
44
import java.util.List;
44
import java.util.List;
45
import javax.swing.Action;
45
import javax.swing.Action;
46
import org.netbeans.api.core.ide.ServiceTabNodeRegistration;
46
import org.netbeans.modules.websvc.saas.model.SaasGroup;
47
import org.netbeans.modules.websvc.saas.model.SaasGroup;
47
import org.netbeans.modules.websvc.saas.model.SaasServicesModel;
48
import org.netbeans.modules.websvc.saas.model.SaasServicesModel;
48
import org.netbeans.modules.websvc.saas.ui.actions.AddGroupAction;
49
import org.netbeans.modules.websvc.saas.ui.actions.AddGroupAction;
Lines 60-65 Link Here
60
 *
61
 *
61
 * @author nam
62
 * @author nam
62
 */
63
 */
64
@ServiceTabNodeRegistration(
65
    position=210,
66
    name="rootSaasGroup",
67
    displayName="org.netbeans.modules.websvc.saas.ui.nodes.Bundle#Web_Services",
68
    shortDescription="org.netbeans.modules.websvc.saas.ui.nodes.Bundle#Web_Services_Desc",
69
    iconResource="org/netbeans/modules/websvc/saas/ui/resources/webservicegroup.png"
70
)
63
public class SaasServicesRootNode extends AbstractNode {
71
public class SaasServicesRootNode extends AbstractNode {
64
    
72
    
65
    public SaasServicesRootNode() {
73
    public SaasServicesRootNode() {

Return to bug 161286