If the selection between the editor does not directly correspond to the selection in the Quick Outline, an implementation of <code>org.eclipse.wst.sse.ui.IContentSelectionProvider</code> should be provided by the quick outline configuration. For example, if a text node is selected in the XML editor, XML's quick outline configuration will use its content selection provider to select the parent element of the text node for display in the Quick Outline.

=== DOM Conformity ===

=== DOM Conformity ===

Revision as of 13:52, 11 March 2010

This page to to collect miscellaneous notes and pointers to changes coming up in the WTP 3.2 release. Its purpose it to be a central "jumping off" point for those adopters of WTP 3.1 that are moving to WTP 3.2. Most of this information may be already contained in various mailing lists and Bugzilla reports, but it is believed best to have a central place to get people started. Adopters: if you run into trouble or notice things that are not covered here, please let us know (wtp-dev is a good place). Web Tools is a Platform and we strive to provide compatible API evolution with clear migration instructions, etc., for the future.

One thing we have learned in the past is that some adopters do not move with us to every new release. Some early adopters went from 0.7 directly to 1.5, for example. Unfortunately, it is difficult to present the information in that way, covering perhaps multiple changes across different version ranges.

Note: as these notes develop and grow in number, they may occasionally be re-organized into categories, etc.

Server tools

The new changes introduce a new method getPath(IModule) inside of ModuleDelegate, this new method provide a way to get the path relative to its parent of the given module contained within the application. A default implementation that returns 'null' was provided but adopters should strongly consider to provide a proper implementation.

Common Components

218438 The org.eclipse.wst.common.ui.provisional.editors workaround package has been removed. Its classes offered a workaround to a post selection firing problem that has long since been fixed in the Eclipse Platform.

The version of org.eclipse.wst.common.snippets has been incremented to 1.2.0 due to enhancement 282114.

Java EE

org.eclipse.jst.j2ee.core - Added support for Java EE 6, changed over to using javax.xml.namespace.QName for ServiceRef, EnvEntryType is not really used now in EnvEntry (any type can be used now, so it is a String), previously generic types now have specific type associations, plugin version id was bumped to 1.2.0 - see bug 252615 for details/comments.

Source Editing

Versions

Bundle

Version change

Trigger

org.eclipse.wst.jsdt.core

1.0.200 -> 1.1.0

279674279804280082 Removal of unused constants from provisional org.eclipse.wst.jsdt.core.compiler.IProblem interface, the provisional org.eclipse.wst.jsdt.core.ITypeParameter interface in its entirety, and other vestigial types inherited from JDT

294088 (Automatically close paired characters in the editor) and 247221 (Non-validation annotations for the StructuredTextEditor)

Code Folding

(PROVISIONAL)

Code folding in the Structured Source Editors (HTML, XML, JSP, CSS, DTD) has been completely re-factored. The previous code folding implementation used the Node Adapter framework the new code folding uses the Reconciling Strategy framework, see 281380 for the reasons behind this change.

If an implementer wishes to write their own folding strategy for a structured source editor then they must create an extension such as:

class - must be a class that extends org.eclipse.wst.sse.ui.internal.projection.AbstractStructuredFoldingStrategy

There are two abstract methods that the implementer must implement, and both are typically short, for examples see:

org.eclipse.wst.css.ui.internal.projection.CSSFoldingStrategy

org.eclipse.wst.dtd.ui.internal.projection.DTDFoldingStrategy

org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy

target - is a structured source editor content type ID

any given content type ID can only have one associated folding strategy, if more then one extension specifies the same content type ID then whichever extension gets loaded first is the one that is used.

Notes:

As of right now the XML, HTML, and JSP editors all use the XMLFoldingStrategy as their folding strategy.

Comment Handlers

The comment handlers have been re-factored so that they do not always use HTML style comment blocks even when not trying to comment HTML 86520. The new comment handler framework is based on the old one only with more abstraction so that it is easier to create comment handlers for different content types. There are now separate comment handlers for XML, HTML, JSP and CSS files all extending from the newly created org.eclipse.wst.sse.ui.internal.handlers.AbstractStructuredCommentHandler See 86520 for more details on the fix.

Instances of AbstractStructuredCommentHandler using static methods from StaticStructuredCommentHandlers for XML, HTML, JSP and CSS content types.

Character Pairing

The Structured Text Editor now supports character pairing. This allows for immediate insertion of a "paired" character following a user-input character. Additional functionality includes closing the pairing when the paired character is entered, completing the pair by pressing enter, or tabbing to the position after the inserted character.

Below is an example of a character pairing that will function on the files with a content type of org.eclipse.core.runtime.xml but only for two specific partitions org.eclipse.wst.xml.XML_DEFAULT and org.eclipse.wst.xml.XML_DECL.

The class provided by inserter must extend org.eclipse.wst.sse.ui.typing.AbstractCharacterPairInserter. This class is responsible for identifying which characters will trigger pairing, what character is paired with that trigger, and if the trigger should execute. See org.eclipse.wst.xml.ui.internal.text.CharacterPairInserter for an implementation used in the XML editor.

Semantic Highlighting

The semantic highlighting framework has been extended. org.eclipse.wst.sse.ui.ISemanticHighlightingExtension provides the user with a new method of determining if a region of the editor is consumable by the highlighting strategy based on the org.eclipse.wst.sse.core.internal.provisional.IndexedRegion that contains the region.

Additionally, a semantic highlighting strategy can now have its style determined based on the value of a single preference key instead of several keys as before. To do this, the attribute styleStringKey must be added to the semanticHighlighting extension point element. This key identifies a preference value in the format of RGB foreground (#rrggbb) | RGB background (#rrggbb) | bold (true/false) | italic (true/false) | strikethrough (true/false) | underline (true/false)

Quick Outline

Structured Source Editors now support Quick Outlines. The Quick Outline allows for representation of the model in an outline where elements of the outline can be filtered based on the content of the filter text box. A Quick Outline requires an implementation of org.eclipse.wst.sse.ui.quickoutline.AbstractQuickOutlineConfiguration that provides the Quick Outline with a content provider, label provider, and optionally, a content selection provider that translates the selection between the editor and the outline.

The Quick Outline is an editor configuration for a Structured Text Editor whose target is a specific content type. Below is the editor configuration for XML's Quick Outline.

If the selection between the editor does not directly correspond to the selection in the Quick Outline, an implementation of org.eclipse.wst.sse.ui.IContentSelectionProvider should be provided by the quick outline configuration. For example, if a text node is selected in the XML editor, XML's quick outline configuration will use its content selection provider to select the parent element of the text node for display in the Quick Outline.

DOM Conformity

244415 Attribute nodes now return the correct namespace for the XML prefix.

272378 Element nodes no longer return null for getAttribute/getAttributeNS when the element does not have that attribute