Posts

Showing posts with the label pde

Eclipse Plug-in Development:Working with Project Facet

Image
Every project may have one or more natures. Each nature brings set of properties to the project.For example a Java project has “src” directory and “bin” as build directory or you may want to associate a set of libraries to your custom project. Faceted Project Framework provides a powerful mechanism for extending the capabilities of the Web Tools Platform. Project facets are typically used as a way of adding functionality to a project. When a facet is added to the project it can perform any necessary setup actions such as copying resources, installing builders, adding natures, etc. Facets can also be used as markers for enabling user interface elements. This post explains defining a facet and using it. Prerequisites : Install WST eclipse plug-in Add dependencies to MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Sample Bundle-SymbolicName: com.facet.sample; singleton:=true Bundle-Version: 1.0.0 .qualifier Bundle-Activator: com .facet .sample .Activato...

Eclipse PDE: Everything about Editor Part 5

Image
Code Completion using Content Assist This post explains about completion proposal feature of eclipse editor framework. This is part of Everything About Editor series. Content assist provides content assist help to developer while writing code in editor. It helps from static suggestion of language keyword to methods suggestion for dynamic reference on hitting “Ctrl-Space” or entering  any of activator character like ‘.’. Following two interfaces plays key role in implementing code completion for customer editor. ICompletionProposal – Responsible for providing set of proposals text, associated icons etc. IContentAssistProcessor – Responsible for calculating the completion proposals at a point in the editor. It also defines character on which it shoud auto-activate. In this example we are going to see providing content assist then user enters ‘#’. To achieve this we need to implement IComppletionProposal that will return set of proposals as well as tells framework which c...

Eclipse PDE: Everything about Editor Part 4

Auto-Edit Strategy This post of Everything About Editor series explains about editors auto complete feature. Auto edit feature of any editor helps developer while writing code, for example in java editor of eclipse provides auto complete features for string quotes , open braces etc. When you type open curly braces ‘{‘ , eclipse java editor auto inserts closing curly braces considering line and indentation. Here I am going to implement auto-edit strategy for open single , double quotes and opening curly braces ‘{‘. To use auto edits, you must implement the org.eclipse.jface.text.IAutoEditStrategy interface, which contains just one method: void customizeDocumentCommand(IDocument document,DocumentCommand command); This is called each time you make a change to the document with the DocumentCommand object containing the information about that change. So, adding indents or making any change to the text being changed is as simple as modifying the DocumentCommand object. 1. Implement IA...