Copyright © IBM Corp., 2006-2008. All rights reserved; made available under the EPL v1.0 | March 17, 2008 Extending the XML and SSE editors from the Web.

Slides:



Advertisements
Similar presentations
Ganymede Simultaneous Release Review © 2008 by Borland Software Corp., made available under the EPL v1.0 MDT UML2Tools 0.8 Ganymede Simultaneous Release.
Advertisements

Copyright © IBM Corp., All rights reserved. The presentation is licensed under Creative Commons Att. Nc Nd 2.5 license. RESTful Service Oriented.
Introduction to Eclipse plugin development for CSU 670 course project, Selector language (Xaspect) editor plugin implementation.
Copyright © IBM Corp., Introducing the new Web Tools JavaScript™ Features Phil Berkland IBM Software Group 9/26/2007.
Goals Give you a feeling of what Eclipse is.
SRDC Ltd. 1. Problem  Solutions  Various standardization efforts ◦ Document models addressing a broad range of requirements vs Industry Specific Document.
© by Pearson Education, Inc. All Rights Reserved.
1 Eclipse Example Guide Example : Java Editor. 2 Introduction l The Java Editor example : »demonstrates the standard features available for custom text.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse Web Tools Platform.
2006 JavaOne SM Conference | Session TS-4160 | © 2006 by IBM Create, Test, and Consume Web Services with the Eclipse Web Tools Platform Jeffrey Liu, Release.
Eclipse Introduction Dwight Deugo Nesa Matic
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of Creating Eclipse plug-ins.
1 Eclipse Platform Plug-in developper Guide PDG HowTos.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Standards for Technology in Automotive Retail STAR Workbench 1.0 Michelle Vidanes & Dave Carver STAR XML Data Architects, Certified Scrum Masters.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
UNIT-V The MVC architecture and Struts Framework.
Chapter 4 Dreamweaver: Part II The Web Warrior Guide to Web Design Technologies.
Kimberley Peter. Copyright © IBM Corp., All rights reserved. Source code in this presentation is made available under the EPL, v1.0, remainder of.
Copyright © IBM Corp., All rights reserved. Plastic Surgery For Eclipse: Custom SWT Widgets, RCP Customization, and more Benjamin Pasero.
® IBM Software Group © 2012 IBM Corporation OPTIM Data Studio – Jon Sayles, IBM/Rational November, 2012.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
© 2005 by IBM; made available under the EPL v1.0 | March 1, 2005 Tim deBoer Gorkem Ercan Extend WTP Server Tools for your.
© 2012 LogiGear Corporation. All Rights Reserved Robot framework.
Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 | March 20, 2008 | Short Talk Standards based systems management: An.
Using JavaBeans and Custom Tags in JSP Lesson 3B / Slide 1 of 37 J2EE Web Components Pre-assessment Questions 1.The _____________ attribute of a JSP page.
© 2006 IBM Corporation IBM WebSphere Portlet Factory Architecture.
© 2006 by IBM; made available under the EPL v1.0 | October 11, 2006 | Tour of the Web Tools Platform (WTP) Project David Williams Eclipse WST Project Lead.
Introduction to Eclipse Plug-in Development. Who am I? Scott Kellicker Java, C++, JNI, Eclipse.
Copyright © IBM Corp., All rights reserved. This presentation is licensed under Creative Commons Att. Nc Nd 2.5 license. OpenDocument Format.
Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 | March 19, 2008 | Short Talk Extending TPTP for TTCN-3 Paul Slauenwhite.
Copyright © IBM Corp., The Eclipse™ Babel Project Translation Server Kit Lo IBM™ Corporation.
HTML Concepts and Techniques Fourth Edition Project 12 Creating and Using XML Documents.
© 2005 by IBM; made available under the EPL v1.0 | June 9, 2005 David Williams WTP Source Editing Open House.
Copyright © IBM Corp., All rights reserved. From SWT to RCP: Experiences implementing RSSOwl 2.0 with RCP Benjamin Pasero.
© 2008 by Matt Flaherty & Mary Ruddy; made available under the EPL v1.0 Security & Identity : From present to future Matt Flaherty, IBM Mary Ruddy, Meristic.
ABC of Platform Workspace | Copyright © IBM Corp., All rights reserved. Source code in this presentation is made available under the EPL, v1.0, remainder.
ABC of Platform Workspace | Copyright © IBM Corp., ABC of Platform Workspace Szymon Brandys Tomasz Zarna IBM Krakow Software Lab.
ModelPedia Model Driven Engineering Graphical User Interfaces for Web 2.0 Sites Centro de Informática – CIn/UFPe ORCAS Group Eclipse GMF Fábio M. Pereira.
Copyright © IBM Corp., | March | Creating Robust Scalable DSLs with UML Tutorial (172) James Bruck, Christian Damus IBM Rational Software.
Copyright © IBM Corp., Introduction to the Eclipse™ Babel Project Kit Lo IBM™ Corporation.
Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 | March 18, 2008 | Nitin Dahyabhai What can the WTP Snippets View do.
Functional Testing with Eclipse TPTP | Copyright © IBM Corp., All rights reserved. Source code in this presentation is made available under.
© 2008 by Shawn Spiars; made available under the EPL v1.0 | March 17, 2008 Case Study – Phurnace Software and RCP Shawn Spiars Lead UI Developer Phurnace.
XP Tutorial 7 Creating a Flash Web Site. XP New Perspectives on Macromedia Flash 82 Objectives Plan and create a Flash Web site Create a Flash template.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
© 2002 IBM Corporation Transaction Processing Facility TPF Users Group Acapulco May 2004 © 2004 IBM Corporation Pete Nicholls IBM Toronto Lab TPF Toolkit.
® IBM Software Group © 2007 IBM Corporation Module 1: Getting Started with Rational Software Architect Essentials of Modeling with IBM Rational Software.
© 2006 by IBM; made available under the EPL v1.0 | March 20, 2006 | Jeffrey Liu Release Lead IBM Rational Managing APIs with Eclipse API Scanner.
Copyright (c) 2006 IBM Corporation; made available under the EPL v1.0 Update Policy ~ Where we are in 3.2.
Chapter 27 Getting “Web-ified” (Web Applications) Clearly Visual Basic: Programming with Visual Basic nd Edition.
® IBM Software Group © 2007 IBM Corporation Module 3: Creating UML Diagrams Essentials of Modeling with IBM Rational Software Architect, V7.5.
© 2009 by IBM; made available under the EPL v1.0 | Feb 1, 2009 Seneca 2009 Tim deBoer Gorkem Ercan Extend WTP Server Tools.
10 Copyright © 2004, Oracle. All rights reserved. Building ADF View Components.
APACHE STRUTS ASHISH SINGH TOMAR ast2124. OUTLINE Introduction The Model-View-Controller Design Pattern Struts’ implementation of the MVC Pattern Additional.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
1 Eclipse Example Guide Example : Java Editor. 2 Introduction l The Java Editor example : »demonstrates the standard features available for custom text.
© 2013 IBM Corporation IBM UrbanCode Deploy v6.0.1 Support Enablement Training Source Configuration and Database Upgrades Michael Malinowski
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
© 2007 by IBM; made available under the EPL v1.0 | Jan 9 th, 2007 Darin Wright IBM Rational Software Debug Platform 3.3.
I Copyright © 2004, Oracle. All rights reserved. Introduction.
David Hatten Developer, UrbanCode 17 October 2013
Project Objectives Lay out Web pages Create layers
Kristy Foster – L2 Software Engineer March 18, 2014
COSC-4840 Software Engineering
The JSF Tools Project – WTP (internal) release review
Presentation transcript:

Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 | March 17, 2008 Extending the XML and SSE editors from the Web Tools Platform Project Nitin Dahyabhai IBM Rational Software Based on materials prepared with David Williams and Amy Wu

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Agenda and Topics to Cover Introduction An Anatomy of Text Editors Extending Text Editors Eclipse Content Types Improving the Text Editing Experience Architecture of Structured Source Editing (SSE) Models  Structured Models  Structured Documents Improving the Structured Text Editing Experience Extending the Structured Text Editor  Dual Selection  Editor Configuration Reusing the Structured Text Editor Debugging Tools and Tips Examples and Exercises Questions and your code

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Introduction What is WTP Source Editing? Where does SSE fit in?

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Architecture – high level Purpose of Structured Source Editing (SSE) is intended to be a thin layer on top of Eclipse text infrastructure  Aides some things  Some things just different (or better?!)  Especially for “mark up” type languages  Especially for “mixed content”

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 An Anatomy of Text Editors

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 An Anatomy of Text Editors Document providers take the editor inputs and allow text editors to open and save the document contents, as well as react to changes in the input. Text IDocument

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Extending Text Editors Eclipse platform framework provides extension points to contribute actions  org.eclipse.ui.editorActions - contribute actions to editor menu bar and toolbar  org.eclipse.ui.popupMenus - contribute actions to context menu

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Action class Implement org.eclipse.ui.IEditorActionDelegate to contribute action to editor public class MyActionDelegate implements IEditorActionDelegate { public void setActiveEditor(IAction action, IEditorPart targetEditor) { // TODO Auto-generated method stub } public void run(IAction action) { // TODO Auto-generated method stub } public void selectionChanged(IAction action, ISelection selection) { // TODO Auto-generated method stub }

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Action Targets

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Action targetID Need to specify "targetID" where your action will be placed org.eclipse.ui.editorActions  targetID is the editor id of the editor you are contributing your action to. org.eclipse.ui.popupMenus  targetID is the context menu id of the editor you are contributing your action to  Structured Text Editors have some targetID's already set up in various popup menus for clients to use  Structured Text Editors' popup menu ids are generated in the following format: [content type].[editor type keyword].[place to contribute keyword]

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 But wait, what are content types?

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Eclipse Content Types Eclipse base documentation: A central content type catalog for Eclipse Beyond file type via file extensions  User settable “family” of file types  Can be influenced by actual contents of file Determines “encoding rules” through IContentDescription Can associate editors, validators, etc. Content Types are hierarchical, a fact which should not be discounted. It’s common to define your own contentType, say for a specialized form of XML, based on some specific DTD, and then associate it with your editor

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Possible Content Types/Editor Types/Popup Menus Possible content types:  org.eclipse.core.runtime.xml  org.eclipse.wst.html.core.htmlsource  org.eclipse.jst.jsp.core.jspsource  org.eclipse.wst.css.core.csssource  org.eclipse.wst.dtd.core.dtdsource Possible editor types:  source - source page editor Possible places to contribute:  EditorContext - editor popup menu  RulerContext - editor vertical ruler popup menu  OutlineContext - outline view popup menu

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Action targetID Examples Contribute action to the editor context menu of the XML editor  targetID="org.eclipse.core.runtime.xml.source.EditorContext“ Contribute action to the vertical ruler context menu of the HTML editor  targetID="org.eclipse.wst.html.core.htmlsource.source.RulerContex t“ Contribute action to the outline view’s context menu of the DTD editor  targetID="org.eclipse.wst.dtd.core.dtdsource.source.OutlineContext “ Contribute action to menu bar/toolbar for the JSP editor  targetID="org.eclipse.jst.jsp.core.jspsource.source“ Contribute action to menu bar/toolbar for the CSS editor  targetID=“org.eclipse.wst.css.core.csssource.source”

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Additional Information on Actions in Editors Eclipse Article: contribution/Contributing%20Actions%20to%20the%20Eclip se%20Workbench.html Help Documentation: org.eclipse.ui.editorActions extension point schema org.eclipse.ui.popupMenus extension point schema

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Improving the Text Editor Experience Templates  Pieces of text or code which help the user enter reoccurring patterns into a text editor  Invoked via content assist for predetermined contexts

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 User Created Templates Users create templates via Templates preference page

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Contributing Additional Templates Contribute additional templates via extension point  org.eclipse.ui.editors.templates Specify  Template pattern  Template context

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 The Snippets View The Snippets view shows a palette of reusable text snippets that can be dragged and dropped into all text editors. Improving the Text Editor Experience

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 User Created Snippets Users can create and organize their own snippets using the Customize dialog, or just copying and pasting text into the view Variables can be created in the snippet for the user to fill in when the snippet is dropped into an editor Drawers can be automatically shown and hidden based on the active editor’s Eclipse Content Type Snippets are not tied to specific languages or their Content Assist support

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Contributing Additional Snippets Contribute additional drawers and snippets via extension point  org.eclipse.wst.common.snippets.SnippetContributions Plug-in developers can do all of this and more:  Tailored dialog when dropped into SSE text editors  Custom behavior when double-clicked Snippets component home page:

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Architecture of SSE Models Partition Types Structured Documents  Structured Document Events  Structured Document Regions Structured Models (focusing on DOM models)  Structured Model Manager  Adapters and notifications

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Partition types 1.Partitions divide a text document into different areas, for example Java source code and JavaDoc comments. 2.There is no 2, a language provider can partition their documents any way they want, as many ways as they want using different partitioners.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Structured Documents Builds on the standard text IDocument Uses partitions to map functionality to function providers Further divides the text of a document into document regions and syntax-level language-specific text regions.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Structured Models Accessed with a Model Manager through StructuredModelManager.getModelManager(); Every Structured Model contains a Structured Document Structured Models are usually “shared”, a “get” will create one if one doesn’t already exist Models are gotten “for Read” or “for Edit” – ‘edit’ means you are interested in saving changes Always use try {get}..finally {release} – consider this a resource to be managed just like a native object For XML, HTML, and JSP models, IDOMModel.getDocument() gives W3C DOM Document Changes in the Model and Document are synchronized in both directions. For thread control, use model.aboutToChange() and model.changed(); to bracket more than one modification

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Changing the Text Document by Changing the text 1.Use IDocument APIs 2.There’s no 2, again, although you can also supply a “change source”.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Changing the Text Document by Changing the DOM 1.Use Standard DOM APIs (if and when possible)  Mostly compliant with DOM Levels 1 and 2 2.Note some intentional deviations from the XML Recommendations:  We maintain existing EOLs (XML Spec says to convert all, even CR-LF, to LF)  Unless reformatted, we preserve white-space, resulting in many white-space-only Text Nodes  We “mis-use” PI for XMLDecl

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Improving the Structured Text Editing Experience Without extending the editor!  Content Models: DTDs, XML Schema, JSP Custom Tag Libraries  XML Catalog XML Catalog Custom editors are no substitute for well designed documents (and languages) – with their legal content well defined

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Dual Selection in Structured Text Editors IEditorActionDelegates operate on ISelection, and StructuredTextEditor provides an ISelection combining:  ITextSelection  IStructuredSelection ITextSelection - current text selection (just as in other ITextEditors)  Used by new matching bracket navigation IStructuredSelection - corresponding model objects for the selected text positions, object types vary depending on the language being edited  Used by new sibling navigation

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Working with Selection Register views as listener of the ISelectionService Eclipse.org Article on Using the Selection ServiceUsing the Selection Service Beware selection notification loops Design Document on Selection and the StructuredTextEditor:

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Extending the Structured Text Editor Start out simple  StructuredTextEditor is a text editor  Common editor input types are supported  External files supported  Syntax coloring often Just Works

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Extending the Structured Text Editor Built-in Drag and Drop Content Outlines Property Sheets As-you-type validation Designed to work well in multi-page editors But wait, there’s more! Some more advanced features And none of it by subclassing StructuredTextEditor

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Extending the Structured Text Editor using Editor Configuration Customize Structured text editor for different/new content types  org.eclipse.wst.sse.ui.editorConfiguration Configurations include:  Structured text viewer configuration  Outline view configuration  Properties view configuration Configuration class hierarchy mimics and maps to the Content Type hierarchy

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Structured Text Viewer Configuration Customizes various aspects of the Structured text editor including:  content assist  hyperlink navigation  autoedit  many more!

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Creating a Structured Text Viewer Configuration Must subclass org.eclipse.wst.sse.ui.StructuredTextViewerConfi guration You can utilize existing configurations:  Subclass  Instantiate and delegate to new instances

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Existing Structured Text Viewer Configurations Existing Structured Text Viewer Configurations in WTP  org.eclipse.wst.xml.ui.StructuredTextViewerConfigurat ionXML  org.eclipse.wst.html.ui.StructuredTextViewerConfigura tionHTML  org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurat ionJSP  org.eclipse.wst.css.ui.StructuredTextViewerConfigurat ionCSS  org.eclipse.wst.dtd.ui.StructuredTextViewerConfigurat ionDTD  org.eclipse.wst.xsd.ui.internal.editor.StructuredText ViewerConfigurationXSD  org.eclipse.wst.wsdl.ui.internal.StructuredTextViewer ConfigurationWSDL

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Source Viewer Configuration via EditorConfiguration Extension point: org.eclipse.wst.sse.ui.editorConfiguration  sourceViewerConfiguration element Specify:  Your implementation of StructuredTextViewerConfiguration  Content type associated with your configuration

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Example of EditorConfiguration <sourceViewerConfiguration class=" org.eclipse.wst.html.ui.StructuredTextViewerConfigurationHTML “ target=" org.eclipse.wst.html.core.htmlsource "/>

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Additional Information on Source Viewer Configuration Design Document: ditorConfiguration.html Help Documentation: org.eclipse.wst.sse.ui.editorConfiguration extension point schema JavaDoc:  org.eclipse.jface.text.source.SourceViewerConfiguration  All its subclasses  org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration  All its subclasses

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Content Outline Configuration Customize aspects of the Outline view  Which objects shown in the tree and their labels  Additional pull-down and context menu contributions  New toolbar contributions  Key handling  Drag and Drop support  And more! Must subclass org.eclipse.wst.sse.ui.views.contentoutline.ContentOutlineCo nfiguration

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Property Sheet Configuration Customize aspects of the Properties view  Which properties are shown for selected objects  Additional pull-down menu and toolbar contributions  And more! Only supports the classic Property Sheet for now, not the Tabbed Property Sheet Must subclass org.eclipse.wst.sse.ui.views.properties.PropertySheetConfigu ration

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Extending the Structured Text Editor In-editor validation extension point org.eclipse.wst.sse.ui.sourcevalidation  Validates as-you-type, in the background  Reuses Validation component APIs  Implement IValidator to validate entire contents of file, associating the validator to specific content-types and partition types  Implement ISourceValidator from org.eclipse.wst.sse.ui to validate specific text regions as the content is edited See validation.html for more information. validation.html

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Examples of Utilizing Existing Configurations StructuredTextViewerConfigurationWSDL subclasses StructuredTextViewerConfigurationXML to add its own WSDLHyperlinkDetector StructuredTextViewerConfigurationJSP creates new instances of:  StructuredTextViewerConfigurationHTML  StructuredTextViewerConfigurationXML  JavaSourceViewerConfiguration and retrieves their processors to be reused in JSP content.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Limitations of this approach No per-language functionality without overall enablement.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Reusing the Structured Text Editor Start out simple – StructuredTextEditor is a text editor after all Regular editor input types are supported, including external files Editor Configuration is still used StructuredTextEditor returns adapters for many common workbench functions

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Tools and Debugging Tips – Editor Information Dialog Presents read-only information about the editor and its contents. Enable org.eclipse.wst.sse.ui/actioncontr ibutor/debugstatusfields trace option in Eclipse Application Launch configuration. Double-click on bracketed selection range in status bar while editor is open.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Tools and Debugging Tips – Editor Information Dialog Selection information IDocument and IDocumentProvider implementations in use IEditorInput class Content-Type reported by IStructuredModel Partitions according to each partitioning Annotations and their properties Document and Text Regions Adapters for INodeNotifiers

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Exercises Theme: Improve the users’ experience for editing web.xml files How to proceed: Start with and examine either the Deployment Descriptor Editor Plug-in Project template or step through the Extending the XML Editor Cheat Sheets to create a skeleton for adding your own features If we have time left over, feel free to ask about or show your “real world” examples

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Get involved! Newsgroup: news://news.eclipse.org/eclipse.webtoolsnews://news.eclipse.org/eclipse.webtools SSE home page: Bugzilla: Product: Web Tools Bug Day: Community outreach

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Bug reports, feature requests, code and documentation contributions are always welcome.

Extending the XML and SSE editors from the WTP Project | Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 Legal Notices  Copyright © IBM Corp., All rights reserved. Source code in this presentation is made available under the EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.  IBM and the IBM logo are trademarks or registered trademarks of IBM Corporation, in the United States, other countries or both.  Rational and the Rational logo are trademarks or registered trademarks of International Business Machines Corporation in the United States, other countries or both.  Java and all Java-based marks, among others, are trademarks or registered trademarks of Sun Microsystems in the United States, other countries or both.  Eclipse and the Eclipse logo are trademarks of Eclipse Foundation, Inc.  Other company, product and service names may be trademarks or service marks of others.  THE INFORMATION DISCUSSED IN THIS PRESENTATION IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. WHILE EFFORTS WERE MADE TO VERIFY THE COMPLETENESS AND ACCURACY OF THE INFORMATION, IT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, AND IBM SHALL NOT BE RESPONSIBLE FOR ANY DAMAGES ARISING OUT OF THE USE OF, OR OTHERWISE RELATED TO, SUCH INFORMATION. ANY INFORMATION CONCERNING IBM'S PRODUCT PLANS OR STRATEGY IS SUBJECT TO CHANGE BY IBM WITHOUT NOTICE.