<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
The API of the module consist of the all packages in the module. The module does not
expose an SPI nor are there any pluggable parts.
</p>
</answer>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
<p>
Standard unit tests will be used for testing. Tests should particularly cover synchronization
between various views.
</p>
</answer>
<answer id="arch-usecases">
<p> XML/Multiview offers suppport for implementing editors with multiple views for xml files.
<usecase id="basic-usage" name="Basic usage">
To implement an xml multiview editor using the framework, you need to provide the following components:
<ul>
<li>
An appropriate data loader that recognizes required MIME type.
</li>
<li>
A data object that should extend <tt>XmlMultiviewDataObject</tt>. This object
is responsible for parsing the underlying xml document and for providing means to access the model.
</li>
<li>
A model synchonizer that extends <tt>XmlMultiViewDataSynchronizer</tt>. The model
synchonizer takes care of performing synchronization between the model and binary
data and it is responsible for writing the model.
</li>
<li>
A tool bar multiview element that extends <tt>ToolBarMultiViewElement</tt> for each design view.
This component is responsible for repainting the view when necessary and generally it also
provides the actions that can be performed in each view. Alternatively you can also use
<tt>TreePanelMultiViewElement</tt>.
</li>
<li>
A panel for each element to displayed in design view, should extend <tt>SectionInnerPanel</tt>.
This panel is responsible for registering components that modify the model with SectionInnerPanel
and for setting values into the model by overriding setValue method. It should also
validate the model and display appropriate error messages if needed. This panel is created by
<tt>InnerPanelFactory</tt>.
</li>
</ul>
An example implementation is included in the unit test packages of the module,
see <tt>org.netbeans.modules.xml.multiview.test</tt>.
</usecase>
<usecase id="how-to-synchronizer" name="How to implement a model synchronizer?">
<p>To provide synchronization between the model and data you need to implement a model synchronizer that should
extend <tt>XmlMultiViewDataSynchronizer</tt>. In the implementation of <tt>updateDataFromModel</tt>
you are required to implement writing of the model to the disk <b>and</b> update the data cache. For example: </p>
<pre>
protected void updateDataFromModel(Object model, FileLock lock, boolean modify) {
...
Writer out = new StringWriter();
// write model
((MyModel) model).write(out);
out.close();
// update data cache
getDataCache().setData(lock, out.toString(), modify);
...
}
</pre>
<p> In the implementation of <tt>reloadDataFromModel</tt>
you are required implement reloading of the model from the disk. </p>
</usecase>
<usecase id="how-to-xmldataobject" name="How to implement an xml multiview data object?">
As noted above, the data object you want to associate with the multiview, must extend <tt>XmlMultiViewDataObject</tt>.
You should provide the design views you want to enable in the implementation of the <tt>getMultiViewDesc()</tt>
method (see the part about how to implement a design multiview description below).
</usecase>
<usecase id="how-to-designviewdesc" name="How to implement a design multiview description?">
Your design view description should extend <tt>DesignViewMultiViewDesc</tt> that
implements <tt>org.netbeans.core.spi.multiview.MultiViewDescription</tt>. As the name implies, it
represents a description of a design view in a multiview editor. In the implementation
of the abstract <tt>createElement</tt> method you should create an appropriate view element (see next item).
</usecase>
<usecase id="how-to-multiviewelement" name="How to implement a multiview element?">
<tt>MultiViewElement</tt> provides UI components for the multiview component. The XML/multiview provides three types
of multiview elements, namely <tt>ToolBarMultiViewElement, TreePanelMultiViewElement and XmlMultiViewElement</tt>.
Basic usage of each is described below. <br/>
<ul>
<li><tt>ToolBarMultiViewElement</tt> - to implement your own ToolBarMultiViewElement, you need to
provide appropriate <tt>SectionView</tt> in your <tt>getSectionView()</tt> method. Furthermore,
you might want to override <tt>componentShowing()</tt> method and reinitialize the view
if something has changed. To know whether something has changed, you can listen on property changes
of the underlying model or alternatively you can always reinitialize the view. If you choose to
listen on property changes you might want to create a <tt>Task</tt> (using <tt>RequestProcessor.create</tt>)
with an appropriate delay to avoid reinitializing the view multiple time when there are several property
changes within a short period.</li>
<li><tt>TreePanelMultiViewElement</tt></li>
<li><tt>XmlMultiViewElement</tt> - default implementation of the xml view.</li>
</ul>
</usecase>
<usecase id="how-to-sectionview" name="How to use section view?">
<tt>SectionView</tt> represents the view associated with a <tt>MultiViewElement</tt>. It contains the
actual sections to be displayed. Your implementation should add the sections you need by using
<tt>addSection(NodeSectionPanel section)</tt>. Note that there is also <tt>SectionContainer</tt>
that can be used for grouping <tt>SectionPanel</tt>s and that the actual panel associated with
each <tt>SectionPanel</tt> is created by your implementation <tt>InnerPanelFactory</tt>. You can set
the <tt>InnerPanelFactory</tt> implementation to the <tt>SectionView</tt> implementation by using
<tt>setInnerPanelFactory(InnerPanelFactory factory)</tt> method.
</usecase>
<usecase id="how-to-sectionpanel" name="How to use section panel?">
The XML/multiview provides a base class, <tt>SectionInnerPanel</tt>, for panels to be used in visual views. You can
provide your own subclass of <tt>SectionInnerPanel</tt> by making your implementation of <tt>InnerPanelFactory</tt>
to return appropriate panels. Usually panels contain UI components that represent the state of the model. Moreover,
they might also need to modify the model (unless you mean to provide only a read-only view). For that purpose
<tt>SectionInnerPanel</tt> has several methods that can be used to register components that modify the model. There
are two variants of these methods, <tt>addModifier(JComponent)</tt> and <tt>addImmediateModifier(JComponent)</tt>
(more specifically, there is an overloaded version for several subtypes of JComponent). After a component is registered
using either of the variants, <tt>setValue(Object)</tt> method gets called when the state
of the components changes. The difference between these two variants is that in case of <tt>addModifier(JComponent)</tt>
<tt>setValue(Object)</tt> gets called when the component loses focus, whereas <tt>addImmediateModifier(Jcomponent)</tt>
causes <tt>setValue(Object)</tt> immediately when the state of the component has changed.
</usecase>
<usecase id="how-to-sectionnode" name="SectionInnerPanel vs. SectionNodeInnerPanel">
The module provides two "styles" of building visual views. The first approach has been discussed above, the second
approach is to utilize various *Node classes that the module provides, such as SectionNode, SectionNodeView and
SectionNodeInnerPanel. For the most part everything discussed above applies to the latter approach also, basically using
it is more suitable for UIs that have several
expandable nested panels. For example, the editor for ejb-jar.xml (for EJB 2.x) uses this approach.
</usecase>
</p>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
The J2EE Multiview Editor Framework is intended to be an infrastructure
(or workshop) for building various design editors in Netbeans 4.1 (or higher).
</p>
<p>
The need to logically and visually organize applications is not confined
to the project, but permeates the entire development experience. At the module-level,
developers and analysts want to understand the relationship of the various components.
At the component-level, developers benefit from a quick summary of their component,
without needing to scan one or more source files. For example, the ability
to combine the Java or XML source view of a component with its metadata and
deployment descriptor information is a huge problem in the descriptor-happy world of J2EE.
</p>
<p>
Design Editors, supplementing and integrated with the Java or XML source editor,
are being created for several key components in J2EE. In particular, an EJB Design Editor
will make the horrendous task of property and deployment descriptor editing more manageable.
Further, a Web Services Design Editor will streamline the process of creating web services,
making J2EE and Netbeans IDE more accessible to the growing "Web Services" segment of the developer community.
\ </p>
</answer>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
The module does not store any settings.
</p>
</answer>
<!-- <questionid="dep-jrejdk"when="final"> DoyourequiretheJDKoristheJREenough? </question>
-->
<answer id="dep-jrejdk">
<p>
The module has not been tested with JRE.
</p>
</answer>
<!-- <questionid="dep-non-nb"when="init"> WhatotherprojectsoutsideNetBeansdoesthisonedependon? <hint> Somenon-NetBeansprojectsarepackagedasNetBeansmodules (see<ahref="http://libs.netbeans.org/">libraries</a>)and itispreferredtousethisapproachwhenmoremodulesmay dependonsuchthird-partylibrary. </hint> </question>
-->
<answer id="dep-non-nb">
<p>
The module does not depend on any projects outside NetBeans.
</p>
</answer>
<!-- <questionid="dep-platform"when="init"> Onwhichplatformsdoesyourmodulerun?Doesitruninthesame wayoneach? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
<p>
The module is pure Java and should run on any platform that has an approriate VM available.
</p>
</answer>
<!-- <questionid="format-clipboard"when="impl"> Whichdataflavors(ifany)doesyourcodereadfromorinsertto theclipboard(byaccesstoclipboardonmeanscallingmethodson<code>java.awt.datatransfer.Transferable</code>? <hint> OftenNode'sdealwithclipboardbyusageof<code>Node.clipboardCopy,Node.clipboardCutandNode.pasteTypes</code>. Checkyourcodeforoverridingthesemethods. </hint> </question>
-->
<answer id="format-clipboard">
<p>
There are no clipboard operations in the module.
</p>
</answer>
<!-- <questionid="format-dnd"when="impl"> Whichprotocols(ifany)doesyourcodeunderstandduringDrag&Drop? <hint> OftenNode'sdealwithclipboardbyusageof<code>Node.drag,Node.getDropType</code>. Checkyourcodeforoverridingthesemethods.Btw.iftheyarenotoverridden,they bydefaultdelegateto<code>Node.clipboardCopy,Node.clipboardCutandNode.pasteTypes</code>. </hint> </question>
-->
<answer id="format-dnd">
<p>
No support for drag and drop.
</p>
</answer>
<!-- <questionid="perf-limit"when="init"> Arethereanyhard-codedorpracticallimitsinthenumberorsizeof elementsyourcodecanhandle? </question>
-->
<answer id="perf-limit">
<p>
There are pracical limits on how many elements it is reasonable to include
in each tab, but the framework itself doesn't limit their amount in any way.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
XXX no answer for perf-mem
</p>
</answer>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.