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