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 167205
Collapse All | Expand All

(-)a/cnd/src/org/netbeans/modules/cnd/resources/mf-layer.xml (+3 lines)
Lines 122-127 Link Here
122
                <attr name="template" boolvalue="true"/>
122
                <attr name="template" boolvalue="true"/>
123
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-c.html"/>
123
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-c.html"/>
124
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
124
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
125
                <attr name="templateCanEdit" boolvalue="true"/>
125
                <attr name="templateCategory" stringvalue="c-types"/>
126
                <attr name="templateCategory" stringvalue="c-types"/>
126
            </file>
127
            </file>
127
            
128
            
Lines 157-162 Link Here
157
                <attr name="template" boolvalue="true"/>
158
                <attr name="template" boolvalue="true"/>
158
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-cc.html"/>
159
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-cc.html"/>
159
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
160
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
161
                <attr name="templateCanEdit" boolvalue="true"/>
160
                <attr name="templateCategory" stringvalue="cpp-types"/>
162
                <attr name="templateCategory" stringvalue="cpp-types"/>
161
            </file>
163
            </file>
162
            
164
            
Lines 311-316 Link Here
311
                <attr name="template" boolvalue="true"/>
313
                <attr name="template" boolvalue="true"/>
312
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-f90.html"/>
314
                <attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/cnd/resources/empty-f90.html"/>
313
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
315
                <attr name="templateWizardIterator" newvalue="org.netbeans.modules.cnd.editor.filecreation.CCFSrcFileIterator"/>
316
                <attr name="templateCanEdit" boolvalue="true"/>
314
                <attr name="templateCategory" stringvalue="fortran-types"/>
317
                <attr name="templateCategory" stringvalue="fortran-types"/>
315
            </file>
318
            </file>
316
            <file name="fortranFixedFormatFile.f" url="templates/fortran/fixed-fortran-f.template">
319
            <file name="fortranFixedFormatFile.f" url="templates/fortran/fixed-fortran-f.template">
(-)b8470e9b3bac (+1091 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="mentlicher@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 implements Favorites tab and Template Manager.
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
   XXX no answer for arch-quality
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
   XXX no answer for arch-time
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
   XXX no answer for arch-usecases
97
  </p>
98
 </answer>
99
100
101
102
<!--
103
        <question id="arch-what" when="init">
104
            What is this project good for?
105
            <hint>
106
            Please provide here a few lines describing the project, 
107
            what problem it should solve, provide links to documentation, 
108
            specifications, etc.
109
            </hint>
110
        </question>
111
-->
112
 <answer id="arch-what">
113
  <p>
114
   XXX no answer for arch-what
115
  </p>
116
 </answer>
117
118
119
120
<!--
121
        <question id="arch-where" when="impl">
122
            Where one can find sources for your module?
123
            <hint>
124
                Please provide link to the Hg web client at
125
                http://hg.netbeans.org/
126
                or just use tag defaultanswer generate='here'
127
            </hint>
128
        </question>
129
-->
130
 <answer id="arch-where">
131
  <defaultanswer generate='here' />
132
 </answer>
133
134
135
136
<!--
137
        <question id="compat-deprecation" when="init">
138
            How the introduction of your project influences functionality
139
            provided by previous version of the product?
140
            <hint>
141
            If you are planning to deprecate/remove/change any existing APIs,
142
            list them here accompanied with the reason explaining why you
143
            are doing so.
144
            </hint>
145
        </question>
146
-->
147
 <answer id="compat-deprecation">
148
  <p>
149
   none.
150
  </p>
151
 </answer>
152
153
154
155
<!--
156
        <question id="compat-i18n" when="impl">
157
            Is your module correctly internationalized?
158
            <hint>
159
            Correct internationalization means that it obeys instructions 
160
            at <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html">
161
            NetBeans I18N pages</a>.
162
            </hint>
163
        </question>
164
-->
165
 <answer id="compat-i18n">
166
  <p>
167
   Yes.
168
  </p>
169
 </answer>
170
171
172
173
<!--
174
        <question id="compat-standards" when="init">
175
            Does the module implement or define any standards? Is the 
176
            implementation exact or does it deviate somehow?
177
        </question>
178
-->
179
 <answer id="compat-standards">
180
  <p>
181
   No.
182
  </p>
183
 </answer>
184
185
186
187
<!--
188
        <question id="compat-version" when="impl">
189
            Can your module coexist with earlier and future
190
            versions of itself? Can you correctly read all old settings? Will future
191
            versions be able to read your current settings? Can you read
192
            or politely ignore settings stored by a future version?
193
            
194
            <hint>
195
            Very helpful for reading settings is to store version number
196
            there, so future versions can decide whether how to read/convert
197
            the settings and older versions can ignore the new ones.
198
            </hint>
199
        </question>
200
-->
201
 <answer id="compat-version">
202
  <p>
203
   Yes.
204
  </p>
205
 </answer>
206
207
208
209
<!--
210
        <question id="dep-jre" when="final">
211
            Which version of JRE do you need (1.2, 1.3, 1.4, etc.)?
212
            <hint>
213
            It is expected that if your module runs on 1.x that it will run 
214
            on 1.x+1 if no, state that please. Also describe here cases where
215
            you run different code on different versions of JRE and why.
216
            </hint>
217
        </question>
218
-->
219
 <answer id="dep-jre">
220
  <p>
221
   XXX no answer for dep-jre
222
  </p>
223
 </answer>
224
225
226
227
<!--
228
        <question id="dep-jrejdk" when="final">
229
            Do you require the JDK or is the JRE enough?
230
        </question>
231
-->
232
 <answer id="dep-jrejdk">
233
  <p>
234
   JRE is enough.
235
  </p>
236
 </answer>
237
238
239
240
<!--
241
        <question id="dep-nb" when="init">
242
            What other NetBeans projects and modules does this one depend on?
243
            <hint>
244
            Depending on other NetBeans projects influnces the ability of
245
            users of your work to customize their own branded version of
246
            NetBeans by enabling and disabling some modules. Too
247
            much dependencies restrict this kind of customization. If that
248
            is your case, then you may want to split your functionality into
249
            pieces of autoload, eager and regular modules which can be
250
            enabled independently. Usually the answer to this question
251
            is generated from your <code>project.xml</code> file, but
252
            if it is not guessed correctly, you can suppress it by
253
            specifying &lt;defaultanswer generate="none"/&gt; and
254
            write here your own. Please describe such projects as imported APIs using
255
            the <code>&lt;api name="identification" type="import or export" category="stable" url="where is the description" /&gt;</code>.
256
            By doing this information gets listed in the summary page of your
257
            javadoc.
258
            </hint>
259
        </question>
260
-->
261
 <answer id="dep-nb">
262
  <defaultanswer generate='here' />
263
 </answer>
264
265
266
267
<!--
268
        <question id="dep-non-nb" when="init">
269
            What other projects outside NetBeans does this one depend on?
270
            
271
            <hint>
272
            Depending on 3rd party libraries is always problematic,
273
            especially if they are not open source, as that complicates
274
            the licensing scheme of NetBeans. Please enumerate your
275
            external dependencies here, so it is correctly understood since
276
            the begining what are the legal implications of your project.
277
            Also please note that
278
            some non-NetBeans projects are packaged as NetBeans modules
279
            (see <a href="http://libs.netbeans.org/">libraries</a>) and
280
            it is preferred to use this approach when more modules may
281
            depend and share such third-party libraries.
282
            </hint>
283
        </question>
284
-->
285
 <answer id="dep-non-nb">
286
  <p>
287
   Freemarker org.netbeans.libs.freemarker.
288
  </p>
289
 </answer>
290
291
292
293
<!--
294
        <question id="dep-platform" when="init">
295
            On which platforms does your module run? Does it run in the same
296
            way on each?
297
            <hint>
298
            If you plan any dependency on OS or any usage of native code,
299
            please describe why you are doing so and describe how you envision
300
            to enforce the portability of your code.
301
            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
302
            enabled modules</a> which together with autoload/eager modules
303
            can allow you to enable to provide the best OS aware support
304
            on certain OSes while providing compatibility bridge on the not
305
            supported ones.
306
            Also please list the supported
307
            OSes/HW platforms and mentioned the lovest version of JDK required
308
            for your project to run on. Also state whether JRE is enough or
309
            you really need JDK.
310
            </hint>
311
        </question>
312
-->
313
 <answer id="dep-platform">
314
  <p>
315
   It runs on any platform.
316
  </p>
317
 </answer>
318
319
320
321
<!--
322
        <question id="deploy-dependencies" when="final">
323
            What do other modules need to do to declare a dependency on this one,
324
            in addition to or instead of the normal module dependency declaration
325
            (e.g. tokens to require)?
326
            <hint>
327
                Provide a sample of the actual lines you would add to a module manifest
328
                to declare a dependency, for example OpenIDE-Module-Requires: some.token.
329
                If other modules should not depend on this module, or should just use a
330
                simple regular module dependency, you can just answer "nothing". If you
331
                intentionally expose a semistable API to clients using implementation
332
                dependencies, you should mention that here (but there is no need to give
333
                an example of usage).
334
            </hint>
335
        </question>
336
-->
337
 <answer id="deploy-dependencies">
338
  <p>
339
   XXX no answer for deploy-dependencies
340
  </p>
341
 </answer>
342
343
344
345
<!--
346
        <question id="deploy-jar" when="impl">
347
            Do you deploy just module JAR file(s) or other files as well?
348
            <hint>
349
            Usually a module consist of one JAR file (perhaps with Class-Path
350
            extensions) and also a configuration file that enables it. If you
351
            have any other files, use
352
            &lt;api group="java.io.File" name="yourname" type="export" category="friend"&gt;...&lt;/api&gt;
353
            to define the location, name and stability of your files (of course
354
            changing "yourname" and "friend" to suit your needs).
355
            
356
            If it uses more than one JAR, describe where they are located, how
357
            they refer to each other. 
358
            If it consist of module JAR(s) and other files, please describe
359
            what is their purpose, why other files are necessary. Please 
360
            make sure that installation/uninstallation leaves the system 
361
            in state as it was before installation.
362
            </hint>
363
        </question>
364
-->
365
 <answer id="deploy-jar">
366
  <p>
367
   XXX no answer for deploy-jar
368
  </p>
369
 </answer>
370
371
372
373
<!--
374
        <question id="deploy-nbm" when="impl">
375
            Can you deploy an NBM via the Update Center?
376
            <hint>
377
            If not why?
378
            </hint>
379
        </question>
380
-->
381
 <answer id="deploy-nbm">
382
  <p>
383
   XXX no answer for deploy-nbm
384
  </p>
385
 </answer>
386
387
388
389
<!--
390
        <question id="deploy-packages" when="init">
391
            Are packages of your module made inaccessible by not declaring them
392
            public?
393
            
394
            <hint>
395
            By default NetBeans build harness treats all packages are private.
396
            If you export some of them - either as public or friend packages,
397
            you should have a reason. If the reason is described elsewhere
398
            in this document, you can ignore this question.
399
            </hint>
400
        </question>
401
-->
402
 <answer id="deploy-packages">
403
  <p>
404
   XXX no answer for deploy-packages
405
  </p>
406
 </answer>
407
408
409
410
<!--
411
        <question id="deploy-shared" when="final">
412
            Do you need to be installed in the shared location only, or in the user directory only,
413
            or can your module be installed anywhere?
414
            <hint>
415
            Installation location shall not matter, if it does explain why.
416
            Consider also whether <code>InstalledFileLocator</code> can help.
417
            </hint>
418
        </question>
419
-->
420
 <answer id="deploy-shared">
421
  <p>
422
   XXX no answer for deploy-shared
423
  </p>
424
 </answer>
425
426
427
428
<!--
429
        <question id="exec-ant-tasks" when="impl">
430
            Do you define or register any ant tasks that other can use?
431
            
432
            <hint>
433
            If you provide an ant task that users can use, you need to be very
434
            careful about its syntax and behaviour, as it most likely forms an
435
	          API for end users and as there is a lot of end users, their reaction
436
            when such API gets broken can be pretty strong.
437
            </hint>
438
        </question>
439
-->
440
 <answer id="exec-ant-tasks">
441
  <p>
442
   No.
443
  </p>
444
 </answer>
445
446
447
448
<!--
449
        <question id="exec-classloader" when="impl">
450
            Does your code create its own class loader(s)?
451
            <hint>
452
            A bit unusual. Please explain why and what for.
453
            </hint>
454
        </question>
455
-->
456
 <answer id="exec-classloader">
457
  <p>
458
   No.
459
  </p>
460
 </answer>
461
462
463
464
<!--
465
        <question id="exec-component" when="impl">
466
            Is execution of your code influenced by any (string) property
467
            of any of your components?
468
            
469
            <hint>
470
            Often <code>JComponent.getClientProperty</code>, <code>Action.getValue</code>
471
            or <code>PropertyDescriptor.getValue</code>, etc. are used to influence
472
            a behavior of some code. This of course forms an interface that should
473
            be documented. Also if one depends on some interface that an object
474
            implements (<code>component instanceof Runnable</code>) that forms an
475
            API as well.
476
            </hint>
477
        </question>
478
-->
479
 <answer id="exec-component">
480
  <p>
481
   Templates Manager reads some file attributes of template files.
482
   They can also be stored in the module layer. Please see filesystems for more
483
   information about this.
484
  </p>
485
486
    <api type="import" group="property" name="templateCanEdit" category="stable" >
487
        If set to Boolean.TRUE the template file is allowed to be edited.
488
        If set to Boolean.FALSE the template file is not allowed to be edited.
489
        If not set, the template file is allowed to be edited iff the associated
490
        node provides <code>EditCookie</code> or <code>OpenCookie</code>.
491
    </api>
492
493
    <api type="import" group="property" name="templateEditable" category="stable" >
494
        Value of this attribute can be an instance of <code>Editable</code>,
495
        that is used to edit the teplate file.
496
    </api>
497
498
 </answer>
499
500
501
502
<!--
503
        <question id="exec-introspection" when="impl">
504
            Does your module use any kind of runtime type information (<code>instanceof</code>,
505
            work with <code>java.lang.Class</code>, etc.)?
506
            <hint>
507
            Check for cases when you have an object of type A and you also
508
            expect it to (possibly) be of type B and do some special action. That
509
            should be documented. The same applies on operations in meta-level
510
            (Class.isInstance(...), Class.isAssignableFrom(...), etc.).
511
            </hint>
512
        </question>
513
-->
514
 <answer id="exec-introspection">
515
  <p>
516
   XXX no answer for exec-introspection
517
  </p>
518
 </answer>
519
520
521
522
<!--
523
        <question id="exec-privateaccess" when="final">
524
            Are you aware of any other parts of the system calling some of 
525
            your methods by reflection?
526
            <hint>
527
            If so, describe the "contract" as an API. Likely private or friend one, but
528
            still API and consider rewrite of it.
529
            </hint>
530
        </question>
531
-->
532
 <answer id="exec-privateaccess">
533
  <p>
534
   No.
535
  </p>
536
 </answer>
537
538
539
540
<!--
541
        <question id="exec-process" when="impl">
542
            Do you execute an external process from your module? How do you ensure
543
            that the result is the same on different platforms? Do you parse output?
544
            Do you depend on result code?
545
            <hint>
546
            If you feed an input, parse the output please declare that as an API.
547
            </hint>
548
        </question>
549
-->
550
 <answer id="exec-process">
551
  <p>
552
   No.
553
  </p>
554
 </answer>
555
556
557
558
<!--
559
        <question id="exec-property" when="impl">
560
            Is execution of your code influenced by any environment or
561
            Java system (<code>System.getProperty</code>) property?
562
            On a similar note, is there something interesting that you
563
            pass to <code>java.util.logging.Logger</code>? Or do you observe
564
            what others log?
565
            <hint>
566
            If there is a property that can change the behavior of your 
567
            code, somebody will likely use it. You should describe what it does 
568
            and the <a href="http://openide.netbeans.org/tutorial/api-design.html#life">stability category</a>
569
            of this API. You may use
570
            <pre>
571
                &lt;api type="export" group="property" name="id" category="private" url="http://..."&gt;
572
                    description of the property, where it is used, what it influence, etc.
573
                &lt;/api&gt;            
574
            </pre>
575
            </hint>
576
        </question>
577
-->
578
 <answer id="exec-property">
579
  <p>
580
   No.
581
  </p>
582
 </answer>
583
584
585
586
<!--
587
        <question id="exec-reflection" when="impl">
588
            Does your code use Java Reflection to execute other code?
589
            <hint>
590
            This usually indicates a missing or insufficient API in the other
591
            part of the system. If the other side is not aware of your dependency
592
            this contract can be easily broken.
593
            </hint>
594
        </question>
595
-->
596
 <answer id="exec-reflection">
597
  <p>
598
   No.
599
  </p>
600
 </answer>
601
602
603
604
<!--
605
        <question id="exec-threading" when="init">
606
            What threading models, if any, does your module adhere to? How the
607
            project behaves with respect to threading?
608
            <hint>
609
                Is your API threadsafe? Can it be accessed from any threads or
610
                just from some dedicated ones? Any special relation to AWT and
611
                its Event Dispatch thread? Also
612
                if your module calls foreign APIs which have a specific threading model,
613
                indicate how you comply with the requirements for multithreaded access
614
                (synchronization, mutexes, etc.) applicable to those APIs.
615
                If your module defines any APIs, or has complex internal structures
616
                that might be used from multiple threads, declare how you protect
617
                data against concurrent access, race conditions, deadlocks, etc.,
618
                and whether such rules are enforced by runtime warnings, errors, assertions, etc.
619
                Examples: a class might be non-thread-safe (like Java Collections); might
620
                be fully thread-safe (internal locking); might require access through a mutex
621
                (and may or may not automatically acquire that mutex on behalf of a client method);
622
                might be able to run only in the event queue; etc.
623
                Also describe when any events are fired: synchronously, asynchronously, etc.
624
                Ideas: <a href="http://core.netbeans.org/proposals/threading/index.html#recommendations">Threading Recommendations</a> (in progress)
625
            </hint>
626
        </question>
627
-->
628
 <answer id="exec-threading">
629
  <p>
630
   XXX no answer for exec-threading
631
  </p>
632
 </answer>
633
634
635
636
<!--
637
        <question id="format-clipboard" when="impl">
638
            Which data flavors (if any) does your code read from or insert to
639
            the clipboard (by access to clipboard on means calling methods on <code>java.awt.datatransfer.Transferable</code>?
640
            
641
            <hint>
642
            Often Node's deal with clipboard by usage of <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
643
            Check your code for overriding these methods.
644
            </hint>
645
        </question>
646
-->
647
 <answer id="format-clipboard">
648
  <p>
649
   None.
650
  </p>
651
 </answer>
652
653
654
655
<!--
656
        <question id="format-dnd" when="impl">
657
            Which protocols (if any) does your code understand during Drag &amp; Drop?
658
            <hint>
659
            Often Node's deal with clipboard by usage of <code>Node.drag, Node.getDropType</code>. 
660
            Check your code for overriding these methods. Btw. if they are not overridden, they
661
            by default delegate to <code>Node.clipboardCopy, Node.clipboardCut and Node.pasteTypes</code>.
662
            </hint>
663
        </question>
664
-->
665
 <answer id="format-dnd">
666
  <p>
667
   None.
668
  </p>
669
 </answer>
670
671
672
673
<!--
674
        <question id="format-types" when="impl">
675
            Which protocols and file formats (if any) does your module read or write on disk,
676
            or transmit or receive over the network? Do you generate an ant build script?
677
            Can it be edited and modified? 
678
            
679
            <hint>
680
            <p>
681
            Files can be read and written by other programs, modules and users. If they influence
682
            your behaviour, make sure you either document the format or claim that it is a private
683
            api (using the &lt;api&gt; tag). 
684
            </p>
685
            
686
            <p>
687
            If you generate an ant build file, this is very likely going to be seen by end users and
688
            they will be attempted to edit it. You should be ready for that and provide here a link
689
            to documentation that you have for such purposes and also describe how you are going to
690
            understand such files during next release, when you (very likely) slightly change the 
691
            format.
692
            </p>
693
            </hint>
694
        </question>
695
-->
696
 <answer id="format-types">
697
  <p>
698
   None.
699
  </p>
700
 </answer>
701
702
703
704
<!--
705
        <question id="lookup-lookup" when="init">
706
            Does your module use <code>org.openide.util.Lookup</code>
707
            or any similar technology to find any components to communicate with? Which ones?
708
            
709
            <hint>
710
            NetBeans is build around a generic registry of services called
711
            lookup. It is preferable to use it for registration and discovery
712
            if possible. See
713
            <a href="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html">
714
            The Solution to Comunication Between Components
715
            </a>. If you do not plan to use lookup and insist usage
716
            of other solution, then please describe why it is not working for
717
            you.
718
            <br/>
719
            When filling the final version of your arch document, please
720
            describe the interfaces you are searching for, where 
721
            are defined, whether you are searching for just one or more of them,
722
            if the order is important, etc. Also classify the stability of such
723
            API contract. Use &lt;api group=&amp;lookup&amp; /&gt; tag, so
724
            your information gets listed in the summary page of your javadoc.
725
            </hint>
726
        </question>
727
-->
728
 <answer id="lookup-lookup">
729
  <p>
730
   To find <code>FileObject</code>, <code>DataObject</code>, <code>EditCookie</code> or <code>OpenCookie</code> from Node.
731
  </p>
732
 </answer>
733
734
735
736
<!--
737
        <question id="lookup-register" when="final">
738
            Do you register anything into lookup for other code to find?
739
            <hint>
740
            Do you register using layer file or using a declarative annotation such as <code>@ServiceProvider</code>?
741
            Who is supposed to find your component?
742
            </hint>
743
        </question>
744
-->
745
 <answer id="lookup-register">
746
  <p>
747
   No.
748
  </p>
749
 </answer>
750
751
752
753
<!--
754
        <question id="lookup-remove" when="final">
755
            Do you remove entries of other modules from lookup?
756
            <hint>
757
            Why? Of course, that is possible, but it can be dangerous. Is the module
758
            your are masking resource from aware of what you are doing?
759
            </hint>
760
        </question>
761
-->
762
 <answer id="lookup-remove">
763
  <p>
764
   No.
765
  </p>
766
 </answer>
767
768
769
770
<!--
771
        <question id="perf-exit" when="final">
772
            Does your module run any code on exit?
773
        </question>
774
-->
775
 <answer id="perf-exit">
776
  <p>
777
   No.
778
  </p>
779
 </answer>
780
781
782
783
<!--
784
        <question id="perf-huge_dialogs" when="final">
785
            Does your module contain any dialogs or wizards with a large number of
786
            GUI controls such as combo boxes, lists, trees, or text areas?
787
        </question>
788
-->
789
 <answer id="perf-huge_dialogs">
790
  <p>
791
   Template Manager, Favorites view. Only simple UI controls.
792
  </p>
793
 </answer>
794
795
796
797
<!--
798
        <question id="perf-limit" when="init">
799
            Are there any hard-coded or practical limits in the number or size of
800
            elements your code can handle?
801
            <hint>
802
                Most of algorithms have increasing memory and speed complexity
803
                with respect to size of data they operate on. What is the critical
804
                part of your project that can be seen as a bottleneck with
805
                respect to speed or required memory? What are the practical
806
                sizes of data you tested your project with? What is your estimate
807
                of potential size of data that would cause visible performance
808
                problems? Is there some kind of check to detect such situation
809
                and prevent "hard" crashes - for example the CloneableEditorSupport
810
                checks for size of a file to be opened in editor
811
                and if it is larger than 1Mb it shows a dialog giving the
812
                user the right to decide - e.g. to cancel or commit suicide.
813
            </hint>
814
        </question>
815
-->
816
 <answer id="perf-limit">
817
  <p>
818
   No.
819
  </p>
820
 </answer>
821
822
823
824
<!--
825
        <question id="perf-mem" when="final">
826
            How much memory does your component consume? Estimate
827
            with a relation to the number of windows, etc.
828
        </question>
829
-->
830
 <answer id="perf-mem">
831
  <p>
832
   XXX no answer for perf-mem
833
  </p>
834
 </answer>
835
836
837
838
<!--
839
        <question id="perf-menus" when="final">
840
            Does your module use dynamically updated context menus, or
841
            context-sensitive actions with complicated and slow enablement logic?
842
            <hint>
843
                If you do a lot of tricks when adding actions to regular or context menus, you can significantly
844
                slow down display of the menu, even when the user is not using your action. Pay attention to
845
                actions you add to the main menu bar, and to context menus of foreign nodes or components. If
846
                the action is conditionally enabled, or changes its display dynamically, you need to check the
847
                impact on performance. In some cases it may be more appropriate to make a simple action that is
848
                always enabled but does more detailed checks in a dialog if it is actually run.
849
            </hint>
850
        </question>
851
-->
852
 <answer id="perf-menus">
853
  <p>
854
   No.
855
  </p>
856
 </answer>
857
858
859
860
<!--
861
        <question id="perf-progress" when="final">
862
            Does your module execute any long-running tasks?
863
            
864
            <hint>Long running tasks should never block 
865
            AWT thread as it badly hurts the UI
866
            <a href="http://performance.netbeans.org/responsiveness/issues.html">
867
            responsiveness</a>.
868
            Tasks like connecting over
869
            network, computing huge amount of data, compilation
870
            be done asynchronously (for example
871
            using <code>RequestProcessor</code>), definitively it should 
872
            not block AWT thread.
873
            </hint>
874
        </question>
875
-->
876
 <answer id="perf-progress">
877
  <p>
878
   No.
879
  </p>
880
 </answer>
881
882
883
884
<!--
885
        <question id="perf-scale" when="init">
886
            Which external criteria influence the performance of your
887
            program (size of file in editor, number of files in menu, 
888
            in source directory, etc.) and how well your code scales?
889
            <hint>
890
            Please include some estimates, there are other more detailed 
891
            questions to answer in later phases of implementation. 
892
            </hint>
893
        </question>
894
-->
895
 <answer id="perf-scale">
896
  <p>
897
   XXX no answer for perf-scale
898
  </p>
899
 </answer>
900
901
902
903
<!--
904
        <question id="perf-spi" when="init">
905
            How the performance of the plugged in code will be enforced?
906
            <hint>
907
            If you allow foreign code to be plugged into your own module, how
908
            do you enforce that it will behave correctly and quickly and will not
909
            negatively influence the performance of your own module?
910
            </hint>
911
        </question>
912
-->
913
 <answer id="perf-spi">
914
  <p>
915
   No.
916
  </p>
917
 </answer>
918
919
920
921
<!--
922
        <question id="perf-startup" when="final">
923
            Does your module run any code on startup?
924
        </question>
925
-->
926
 <answer id="perf-startup">
927
  <p>
928
   No.
929
  </p>
930
 </answer>
931
932
933
934
<!--
935
        <question id="perf-wakeup" when="final">
936
            Does any piece of your code wake up periodically and do something
937
            even when the system is otherwise idle (no user interaction)?
938
        </question>
939
-->
940
 <answer id="perf-wakeup">
941
  <p>
942
   No.
943
  </p>
944
 </answer>
945
946
947
948
<!--
949
        <question id="resources-file" when="final">
950
            Does your module use <code>java.io.File</code> directly?
951
            
952
            <hint>
953
            NetBeans provide a logical wrapper over plain files called 
954
            <code>org.openide.filesystems.FileObject</code> that
955
            provides uniform access to such resources and is the preferred
956
            way that should be used. But of course there can be situations when
957
            this is not suitable.
958
            </hint>
959
        </question>
960
-->
961
 <answer id="resources-file">
962
  <p>
963
   No.
964
  </p>
965
 </answer>
966
967
968
969
<!--
970
        <question id="resources-layer" when="final">
971
            Does your module provide own layer? Does it create any files or
972
            folders in it? What it is trying to communicate by that and with which 
973
            components?
974
            
975
            <hint>
976
            NetBeans allows automatic and declarative installation of resources 
977
            by module layers. Module register files into appropriate places
978
            and other components use that information to perform their task
979
            (build menu, toolbar, window layout, list of templates, set of
980
            options, etc.). 
981
            </hint>
982
        </question>
983
-->
984
 <answer id="resources-layer">
985
  <p>
986
   Yes. Module layer with Favorites view and Templates action.
987
  </p>
988
 </answer>
989
990
991
992
<!--
993
        <question id="resources-mask" when="final">
994
            Does your module mask/hide/override any resources provided by other modules in
995
            their layers?
996
            
997
            <hint>
998
            If you mask a file provided by another module, you probably depend
999
            on that and do not want the other module to (for example) change
1000
            the file's name. That module shall thus make that file available as an API
1001
            of some stability category.
1002
            </hint>
1003
        </question>
1004
-->
1005
 <answer id="resources-mask">
1006
  <p>
1007
   No.
1008
  </p>
1009
 </answer>
1010
1011
1012
1013
<!--
1014
        <question id="resources-preferences" when="final">
1015
            Does your module uses preferences via Preferences API? Does your module use NbPreferences or
1016
            or regular JDK Preferences ? Does it read, write or both ? 
1017
            Does it share preferences with other modules ? If so, then why ?
1018
            <hint>
1019
                You may use
1020
                    &lt;api type="export" group="preferences"
1021
                    name="preference node name" category="private"&gt;
1022
                    description of individual keys, where it is used, what it
1023
                    influences, whether the module reads/write it, etc.
1024
                    &lt;/api&gt;
1025
                Due to XML ID restrictions, rather than /org/netbeans/modules/foo give the "name" as org.netbeans.modules.foo.
1026
                Note that if you use NbPreferences this name will then be the same as the code name base of the module.
1027
            </hint>
1028
        </question>
1029
-->
1030
 <answer id="resources-preferences">
1031
  <p>
1032
   No.
1033
  </p>
1034
 </answer>
1035
1036
1037
1038
<!--
1039
        <question id="resources-read" when="final">
1040
            Does your module read any resources from layers? For what purpose?
1041
            
1042
            <hint>
1043
            As this is some kind of intermodule dependency, it is a kind of API.
1044
            Please describe it and classify according to 
1045
            <a href="http://openide.netbeans.org/tutorial/api-design.html#categories">
1046
            common stability categories</a>.
1047
            </hint>
1048
        </question>
1049
-->
1050
 <answer id="resources-read">
1051
  <p>
1052
   Reads Template folder to allow to manage templates.
1053
  </p>
1054
 </answer>
1055
1056
1057
1058
<!--
1059
        <question id="security-grant" when="final">
1060
            Does your code grant additional rights to some other code?
1061
            <hint>Avoid using a class loader that adds extra
1062
            permissions to loaded code unless really necessary.
1063
            Also note that your API implementation
1064
            can also expose unneeded permissions to enemy code by
1065
            calling AccessController.doPrivileged().</hint>
1066
        </question>
1067
-->
1068
 <answer id="security-grant">
1069
  <p>
1070
   No.
1071
  </p>
1072
 </answer>
1073
1074
1075
1076
<!--
1077
        <question id="security-policy" when="final">
1078
            Does your functionality require modifications to the standard policy file?
1079
            <hint>Your code might pass control to third-party code not
1080
            coming from trusted domains. This could be code downloaded over the
1081
            network or code coming from libraries that are not bundled
1082
            with NetBeans. Which permissions need to be granted to which domains?</hint>
1083
        </question>
1084
-->
1085
 <answer id="security-policy">
1086
  <p>
1087
   No.
1088
  </p>
1089
 </answer>
1090
1091
</api-answers>
(-)a/favorites/nbproject/project.properties (+1 lines)
Lines 43-45 Link Here
43
javac.source=1.6
43
javac.source=1.6
44
test.config.stable.includes=\
44
test.config.stable.includes=\
45
    gui/core/favorites/BasicsTest.class 
45
    gui/core/favorites/BasicsTest.class 
46
javadoc.arch=${basedir}/arch.xml
(-)a/favorites/src/org/netbeans/modules/favorites/templates/TemplatesAction.java (-9 / +31 lines)
Lines 56-61 Link Here
56
import java.util.Iterator;
56
import java.util.Iterator;
57
import java.util.Set;
57
import java.util.Set;
58
import javax.swing.JButton;
58
import javax.swing.JButton;
59
import org.netbeans.api.actions.Editable;
59
import org.openide.awt.Mnemonics;
60
import org.openide.awt.Mnemonics;
60
import org.openide.cookies.EditCookie;
61
import org.openide.cookies.EditCookie;
61
import org.openide.cookies.OpenCookie;
62
import org.openide.cookies.OpenCookie;
Lines 77-82 Link Here
77
 */
78
 */
78
public class TemplatesAction extends CallableSystemAction {
79
public class TemplatesAction extends CallableSystemAction {
79
80
81
    private static final String CAN_EDIT_TEMPLATE = "templateCanEdit"; // NOI18N
82
83
    private static final String EDITABLE_TEMPLATE = "templateEditable"; // NOI18N
84
80
    /** Weak reference to the dialog showing singleton Template Manager. */
85
    /** Weak reference to the dialog showing singleton Template Manager. */
81
    private Reference<Dialog> dialogWRef = new WeakReference<Dialog> (null);
86
    private Reference<Dialog> dialogWRef = new WeakReference<Dialog> (null);
82
    
87
    
Lines 166-171 Link Here
166
            Iterator/*<Node>*/ it = nodes2open.iterator ();
171
            Iterator/*<Node>*/ it = nodes2open.iterator ();
167
            while (it.hasNext ()) {
172
            while (it.hasNext ()) {
168
                Node n = (Node) it.next ();
173
                Node n = (Node) it.next ();
174
                DataObject dobj = n.getLookup().lookup(DataObject.class);
175
                assert dobj != null : "DataObject for node " + n;
176
                FileObject fo = dobj.getPrimaryFile ();
177
                Object editableObj = fo.getAttribute(EDITABLE_TEMPLATE);
178
                if (editableObj instanceof Editable) {
179
                    ((Editable) editableObj).edit();
180
                    continue;
181
                }
169
                EditCookie ec = n.getLookup ().lookup (EditCookie.class);
182
                EditCookie ec = n.getLookup ().lookup (EditCookie.class);
170
                if (ec != null) {
183
                if (ec != null) {
171
                    ec.edit ();
184
                    ec.edit ();
Lines 185-207 Link Here
185
            if (ExplorerManager.PROP_SELECTED_NODES.equals (evt.getPropertyName ())) {
198
            if (ExplorerManager.PROP_SELECTED_NODES.equals (evt.getPropertyName ())) {
186
                Node [] nodes = (Node []) evt.getNewValue ();
199
                Node [] nodes = (Node []) evt.getNewValue ();
187
                boolean res = nodes != null && nodes.length > 0;
200
                boolean res = nodes != null && nodes.length > 0;
188
                int i = 0;
201
                for (int i = 0; res && i < nodes.length; i++) {
189
                while (res && i < nodes.length) {
190
                    Node n = nodes [i];
202
                    Node n = nodes [i];
203
                    DataObject dobj = n.getLookup().lookup(DataObject.class);
204
                    assert dobj != null : "DataObject for node " + n;
205
                    FileObject fo = dobj.getPrimaryFile ();
206
                    Object canEdit = fo.getAttribute(CAN_EDIT_TEMPLATE);
207
                    if (Boolean.TRUE.equals(canEdit)) {
208
                        res = true;
209
                        continue;
210
                    }
211
                    if (Boolean.FALSE.equals(canEdit)) {
212
                        res = false;
213
                        continue;
214
                    }
191
                    EditCookie ec = n.getLookup().lookup(EditCookie.class);
215
                    EditCookie ec = n.getLookup().lookup(EditCookie.class);
192
                    OpenCookie oc = n.getLookup().lookup(OpenCookie.class);
216
                    res = ec != null;
193
                    res = ec != null || oc != null;
217
                    if (!res) {
218
                        OpenCookie oc = n.getLookup().lookup(OpenCookie.class);
219
                        res = oc != null;
220
                    }
194
221
195
                    // 65037: Template Manager should not offer to Open in Editor an empty pseudotemplate
222
                    // 65037: Template Manager should not offer to Open in Editor an empty pseudotemplate
196
                    if (res) {
223
                    if (res) {
197
                        DataObject dobj = n.getLookup().lookup(DataObject.class);
198
                        assert dobj != null : "DataObject for node " + n;
199
                        FileObject fo = dobj.getPrimaryFile ();
200
                        File f = FileUtil.toFile (fo);
224
                        File f = FileUtil.toFile (fo);
201
                        res = f != null || fo.getSize () > 0;
225
                        res = f != null || fo.getSize () > 0;
202
                    }
226
                    }
203
204
                    i++;
205
                }
227
                }
206
                b.setEnabled (res);
228
                b.setEnabled (res);
207
            }
229
            }

Return to bug 167205