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