|
|
|
List of the main features:
The editor consists of a library part (located under editor/lib and described in a separate arch document) and the module part (under src subfolder) that depends on NetBeans APIs specified in this document.
Question (arch-usecases): Describe the main use cases of the new API. Who will use it under what circumstances? What kind of code would typically need to be written to use the module? Answer: No answer Question (arch-time): What are the time estimates of the work? Answer: No answer Question (arch-quality): How will the quality of your code be tested and how are future regressions going to be prevented? Answer: No answer Question (arch-where): Where one can find sources for your module? WARNING: Question with id="arch-where" has not been answered!org-netbeans-modules-editor.jar
- standard module jar file
Question (deploy-nbm):
Can you deploy an NBM via the Update Center?
Answer:
Yes.
Question (deploy-shared):
Do you need to be installed in the shared location only, or in the user directory only,
or can your module be installed anywhere?
Answer:
Module can be installed anywhere.
Question (deploy-packages):
Are packages of your module made inaccessible by not declaring them
public?
Answer:
Description of public packages:
org.netbeans.modules.editor
- NetBeans-specific editor infrastructure
org.netbeans.modules.editor.html
- NetBeans-specific editor infrastructure
org.netbeans.modules.editor.java
- NetBeans-specific java editor infrastructure
org.netbeans.modules.editor.options
- Editor generic options support plus options for ../editor.plain, html and java editors
org.netbeans.modules.editor.plain
- NetBeans-specific plain text editor infrastructure
java.io.File
directly?
Answer:
No.
Question (resources-layer):
Does your module provide own layer? Does it create any files or
folders in it? What it is trying to communicate by that and with which
components?
Answer:
Yes, files are created for menus, actions, shortcuts, annotations,
settings storage:
JavaFastOpenAction
) registered into /Actions/Edit
and its shortcut into /Shortcuts folder.
Files and subfolders of Editors/|mime-type|:
<file name="EditorKit.instance"> <attr name="instanceClass" stringvalue="org.netbeans.modules.html.editor.HTMLKit"/> </file>
Popup menu items (actions) can be registered in the Popup
subfolder.
Both system actions and editor's actions can be added to the popup.
The actions can be ordered using a standard filesystem ordering attributes.
<folder name="Editors/Popup"> <file name="org-openide-actions-CutAction.instance"> <attr name="position" intvalue="100"/> </file> <file name="org-openide-actions-CopyAction.instance"> <attr name="position" intvalue="110"/> </file> </folder>
Editors/Popup
folder.
The editor actions are referenced by their name (Action.NAME
property;
mandatory for all editor actions). For example the code below will add
the editor action for code formatting.
<folder name="Editors/Popup"> <file name="format"/> </folder>
Since version 1.39 the editor actions, ie the actions that are installed
to every JEditorPane that acts as a Netbeans editor,
can be registered in the Actions
subfolder.
<folder name="Editors"> <folder name="text"> <folder name="x-java"> <folder name="Actions"> <file name="org-netbeans-modules-java-editor-imports-FastImportAction.instance" /> </folder> </folder> </folder> </folder>
SideBar
subfolder.
Their appearance can be specified using two optional attributes - location
(accepting values "North"
, "South"
, "East"
and
"West"
) and boolean scrollable
. Default values are
"West"
and "true"
(i.e. the side bar component
will appear in the row header of a JScrollPane
displaying
the editor's JEditoPane
).
<folder name="SideBar"> <file name="org-netbeans-editor-GlyphGutter.instance"/> <file name="org-netbeans-editor-StatusBar$StatusBarFactory.instance"> <attr name="location" stringvalue="South"/> <attr name="scrollable" boolvalue="false"/> </file> </folder>
Please see layer.xml for further details.
The org.netbeans.lib.editor.hyperlink.spi.HyperlinkProvider
instances can be registered by editors for the particular mime-types
into Editors/|mime-type|/HyperlinkProviders.
There can be multiple providers registered and their order
will be respected during querying by the hyperlinking infrastructure
(first provider which recognizes the given offset as a hyperlinking point
will be used).
org.openide.util.Lookup
or any similar technology to find any components to communicate with? Which ones?
Answer:
In src/org/netbeans/modules/editor/EditorModule.java: Lookup.getDefault().lookup(DataLoaderPool.class)
In src/org/netbeans/modules/editor/EditorModule.java: Lookup.getDefault().lookup(DataLoaderPool.class))
In src/org/netbeans/modules/editor/EditorModule.java: Lookup.getDefault().lookup(WindowManager.class)
In src/org/netbeans/modules/editor/NbEditorKit.java: Lookup.getDefault().lookup(Keymap.class)
In src/org/netbeans/modules/editor/NbEditorKit.java: Lookup.getDefault().lookup(ClassLoader.class)
In src/org/netbeans/modules/editor/NbEditorUtilities.java: Lookup.getDefault().lookup(ErrorManager.class)
In src/org/netbeans/modules/editor/NbImplementationProvider.java: Lookup.getDefault().lookup(ClassLoader.class)
In src/org/netbeans/modules/editor/options/BaseOptions.java: Lookup.getDefault().lookup(getDefaultIndentEngineClass())
In src/org/netbeans/modules/editor/options/ColoringArrayEditorPanel.java: Lookup.getDefault().lookup(ClassLoader.class)
In src/org/netbeans/modules/editor/options/KeyBindingsEditorPanel.java: Lookup.getDefault().lookup(ClassLoader.class);
In src/org/netbeans/modules/editor/options/MIMEOptionFile.java: Lookup.getDefault().lookup(ModuleInfo.class);
Question (lookup-register):
Do you register anything into lookup for other code to find?
Answer:
org.netbeans.modules.editor.hyperlink.LayerHyperlinkProviderManager
is registered using META-INF/services
.
org.netbeans.lib.editor.hyperlink.HyperlinkProviderManager
allowing to instantiate the org.netbeans.lib.editor.hyperlink.spi.HyperlinkProvider
instances from the xml layer of the System FS for particular mime-types.
Question (lookup-remove):
Do you remove entries of other modules from lookup?
Answer:
No.
System.getProperty
) property?
On a similar note, is there something interesting that you
pass to java.util.logging.Logger
? Or do you observe
what others log?
Answer:
javax.swing.text.Document.getProperty()
)
that influence the document execution:
org.openide.text
package.
DataObject
or FileObject
from which the Document
content was loaded.
org.openide.text
package.
java.io.Reader
by an EditorKit.read()
.
Following component client properties incluence the component behavior:
No.
Question (exec-classloader): Does your code create its own class loader(s)? Answer: No. Question (exec-reflection): Does your code use Java Reflection to execute other code? Answer: Reflection is used for:context
field is accessed by reflection
from MultiKeymap.
Question (exec-privateaccess):
Are you aware of any other parts of the system calling some of
your methods by reflection?
Answer:
No.
Question (exec-process):
Do you execute an external process from your module? How do you ensure
that the result is the same on different platforms? Do you parse output?
Do you depend on result code?
Answer:
No.
Question (exec-introspection):
Does your module use any kind of runtime type information (instanceof
,
work with java.lang.Class
, etc.)?
Answer:
No.
Question (exec-threading):
What threading models, if any, does your module adhere to? How the
project behaves with respect to threading?
Answer:
Threading model of the document model adheres to javax.swing.text.Document interface. There can be multiple reader threads accessing the document simultaneously but only one mutating thread at the time.
Document.render(Runnable) must be used for all the readonly operations accessing the document. The editor fully supports org.openide.text.NbDocument.runAtomic() and NbDocument.runAtomicAsUser() extensions that allow transactions on top of the document.
All the UI-related tasks adhere to Swing/AWT conventions i.e. they must be performed in EQ thread.
Question (security-policy): Does your functionality require modifications to the standard policy file? Answer:XXX no answer for security-policy
Question (security-grant): Does your code grant additional rights to some other code? Answer:XXX no answer for security-grant
java.awt.datatransfer.Transferable
?
Answer: