SIDEBAR
»
S
I
D
E
B
A
R
«
Using expressions in your extension points
Sep 7th, 2010 by Eugene Ostroukhov

Originally I meant to create a reference of the Eclipse expressions and properties available in SDK but there is already such article in Eclipse Wiki. I would strongly recommend bookmarking that article – it is an excellent reference. I would like to describe how you could leverage the expressions in your extension points (when you declare extension points as opposed to providing extensions to platform extension points). There are several reasons to use expressions as a part of your extension point:

  1. Lazy initialization – expression can be tested without activating the plugin that contributed the extension.
  2. External declaration – expressions are declared in the plugin.xml and that sometimes makes it easier to maintain them.
  3. Flexible and pluggable language. Users can leverage org.eclipse.core.expressions.definitions extension point to declare reusable expressions. Users can also leverage org.eclipse.core.expressions.propertyTesters to declare property testers that contain complex logic.

To use expression in your extension point you will need to update your extension point schema file (exsd file) to declare expression language elements. The easiest way is by referencing expression language schema:

<include schemaLocation="schema://org.eclipse.core.expressions/schema/expressionLanguage.exsd"/>

This will import all the elements so you can use them in the extension elements editor:

Expression elmeents in the extension element editorNote that you can specify any expression element as the expression root. I would recommend to using the “enablement” element as this would let you get all changes to expression languages as they appear in the subsequent Eclipse releases. Plug-in developers will see the expressions in the PDE editor after extension point definition is updated.

To test the expression you will need to parse the expression:

IConfigurationElement[] children = configurationElement.getChildren("enablement");
if (children.length == 1) {
    expression = ExpressionConverter.getDefault().perform(children[0]);
}

Then you will have to create “evaluation context” and evaluate the expression. Evaluation context provides all the variables that are available to the expression – like “activeWorkbenchWindow” and others in the commands framework. You may spacify one object as a “default” (it is “project” variable in my snippet):

final EvaluationResult result = expression.evaluate(new EvaluationContext(null, project));

“result” will be one of FALSE, TRUE and NOT_LOADED. NOT_LOADED is mostly when the user references the propery tester from inactive plug-in and tells the framework to avoid plug-in activation to instantiate just the property tester.

After this point the user will be able to use the expressions with your extension point just the same way they are used in extension points declared by core Eclipse.


Tools for Mobile Web
Jul 27th, 2010 by Eugene Ostroukhov

We (the Symbian Foundation) proposed a new project – Tools for Mobile Web. We offer our code as a basis for this new Eclipse project and now that we released version 1.0 of our product we would like to focus on this contribution. I would like to better explain what we would like to see out of this project. We did several presentations already so there are some common questions we had to answer.

What is “mobile web”?

In the scope of this project “mobile web” means “mobile web runtimes” that are present on most modern popular smartphones. Developers can use web technologies (HTML, CSS and JavaScript) to create mobile applications. These applications are quite different from the regular web pages in that they are not served from a web site but are installed on the device not unlike regular “native” mobile applications. They can be distributed through the OVI store or other platform-dependent application stores. These application have a broader access to device capabilities – they can access GPS and accelerometer sensor readings, use device-specific UI (i.e. software buttons on Symbian phones), read address book or be notified when SMS or MMS message was received.

Simulator can run web runtime applications and provides basic controls to trigger events

Device simulator

But there is Web Tools Project already!

TWM does not mean to reimplement WTP functionality. We build on top of the WTP reusing all the powerful tools in provides (like JSDT). We focus on adding functionality that is specific to mobile development – like deployment to phone or mobile API simulation.

Will you add support for JQuery UI (or <your other favorite JS library>)?

Our focus is on adding mobile development-specific functionality. We do not plan to implement functionality that users consider “missing” from the WTP. On the other hand we hope to cooperate with WTP and possibly contribute to such areas. Once the WTP gets support for the library then TMW will “inherit” it.

We are watching closely JavaScript frameworks that are more specific to mobile application development. We already added support for PhoneGap framework and we may add support for other frameworks as they mature and gain popularity.

Is there any timeframe on when the tools will be available?

You can already download Tools that support Symbian WRT development. They are feature complete and EPL licensed so we encourage you to try them whether you are a JavaScript developer looking to expand to mobile platforms or an Eclipse enthusiast interested in IDEs for mobile. Currently we are focused on refactoring our code to add support for any number of the runtimes and to prepare it for migration to eclipse.org. From that point we will continue development of both Symbian-specific and runtime-agnostic parts.

What about support for other platforms?

We have implemented support for PhoneGap APIs but we only package applications for Symbian platform. Aplix already stepped up to contribute support for BONDI runtime. We expect other interested parties to contribute support for other platforms.

What can the IDE do?

It is a fully integrated IDE that supports application development cycle from creating a new application project to deployment on the device or packaging for distribution.

IDE main screen

Main screen

Our editing experience is based on WTP were we extended JSDT with the support for mobile libraries and added CSS validator and application manifest validator.

Another important part is the simulator and debugger that are built into our IDE. It can be used as a live preview of your application or as a runtime for debugging. Our primary goal was to reduce overhead of the mobile application development so we chose to use desktop browser (Chrome) to ensure maximum debugger performance. We understand that this approach is not completely accurate but it had proven to be “good enough” for debugging of the vast majority of the tasks. We plan on adding on-device debugging in one of the next releases.

How do I start using this IDE?

Follow this link for up-to-date information on using our IDE. Do not hesitate to contact us on our forums or submit bugs to bugtracker.

How is this IDE related to other solutions for WRT development (i.e. Nokia plug-in for Aptana, Dreamweaver)?

Our code owes to a large degree to Nokia code contribution. Our initial goal was to achieve feature-parity with Aptana-based solution. We added several important features including PhoneGap support and acceleration events simulation that were not available in the original code.

Why open-source?
Jun 4th, 2010 by Eugene Ostroukhov

The first questions developers ask about out new Mobile Web IDE is “why do we need another solution?” This question is really justified provided there are already several established alternatives in all shapes and sizes.

Our answer is that we wanted to have a completely open-sourced tools – and that leads to another question. “Why should we (as users) care?” Now that open-source is not that much of a buzz-word it used to be most users don’t really care if they can see the source code – they are more concerned with usability and ROI. This is what we hope to achieve with our project:

  1. Single all-in-one download for every platform. All you need to install our IDE is to download ZIP file for your platform and to unzip it anywhere on your filesystem.
  2. Use latest-and-greatest upstream projects available from the community. We use JSDT for JavaScript editing, Chrome Java SDK for debugging, W3C CSS validator for validation.
  3. Use our codebase for an effort to provide a reference IDE for mobile web development. We want to contribute our project to serve as a basis for Eclipse project that will foster development of similar IDEs for different runtimes. Currently all major mobile platforms provide a way to create and deploy applications using web technologies. Until this point there was a separate IDE for each platform and we hope our project will encourage cooperation and ultimately result in better tools and consistent user experience.

We have a lot of plans that should justify having “yet another” Mobile Web IDE even more:

  1. Support other mobile APIs. Currently we are working on out-of-box PhoneGap support but we will also consider other APIs and runtimes.
  2. Improve preview and simulation. We are working on support for more sensors and mobile APIs.
  3. Streamline UI.

So we encourage you to give the IDE a try. You can post your comments and suggestions to our forum. We would be grateful for any bug reports posted to our bugtracker.

“Participate in community!” they said…
Dec 11th, 2009 by Eugene Ostroukhov

I see a lot of discussion in the blogs on how to invite new developers to participate. They all are talking about people being reluctant to do development, making the eclipse.org site interface more inviting – but really, is this the biggest problem? I wonder, does anybody think obscure location of the CVS URL would really stop anybody from trying to enhance the favorite framework?

Consider this (the ones that I remember):

Bug 287887 – I haven’t seen response like “why would anybody want this” or else. The patch was submitted 3 months ago.

Bug 155479 – several commercial projects would like to see it. Patch was submitted in April.

Bug 166906 – pretty irritating bug. The patch was submitted four years ago.

Note – these are patches to make Eclipse better from the end-user POV. It’s not the patches to make Eclipse frameworks more open for extension so we can build better products on top of it – I’m pretty sure that most commercial developers know that there is next to no chance to get such change into Eclipse.org.

The result is quite simple. I joined a new company recently and from the start I say – do not expect the Eclipse.org to cooperate. We need to consider a way to branch projects we use – before we reach the point it is not possible to deliver proper product to our customers because the framework was not designed to support something.

I believe there should be a strict policy in Eclipse.org for handling patches – i.e. the projects should commit to responding for the patch in 2 weeks or one month – and either describe what’s wrong or to incorporate the patch into main repository. Otherwise there will be many Eclipses – Git makes it really simple.

And I’m not mentioning this: 262846 – pure enhancement to make simple API for the popular feature. I submitted this one in February – and I missed some Eclipse.org deadline. The result? Even in the best-case scenario I won’t be able to use this in my commercial product till Summer 2010 – 1.5 years. That’s if we don’t consider that the chances of this bug being committed are still slim. So why bother? 1.5 years is a long time.

Release names
Nov 17th, 2009 by Eugene Ostroukhov

I wonder if I’m the only one who can’t remember fancy names for Eclipse releases – Europa, Ganymede, Galileo, Helios. I think it’s not really good that there’s no easy way to memorize them (I wonder if they were meant to be in alphabetical order – if not for “Ganymede” and “Galileo”). Eclipse releases annually – so why doesn’t it has name like “Eclipse 2007″?

So:

Name Platform/JDT/PDE CDT WTP BIRT Site
Callisto 3.2 3.1 1.5 2.1 link
Europa 3.3 4.0 2.0 2.2 link
Ganymede 3.4 5.0 3.0 2.3 link
Galileo 3.5 6.0 3.1 2.5 link
Helios 3.6 link
WTP Frameworks Not Only For Web
Oct 15th, 2009 by Eugene Ostroukhov

WTP is a huge codebase with a lot of ready solutions for the problems that many Eclipse plug-in developers face. Unfortunately to me it looks like these solutions are not picked up as the people consider WTP only to concern with web site authoring. I would like to list some frameworks I believe are useful in all areas where Eclipse is adopted:

1. Faceted Project Framework

(Link to tutorial)

facetsEssentialy Facets are project natures – only on steroids. Project natures can easily be added to a project and you can test if the project has specific nature – but the facets framework provides so much more:

1. Well defined facet lifecycle. Facet can be added, removed, upgraded you can define interdependence between facets. All done using clean API.

2. UI. You don’t need to implement your own menu action cramming the toolbars and confusing the user. You can contribute wizard pages that users will be able to invoke either when creating new project or when editing project properties. Sure, it is still possible to create custom action, wizard, etc.

As far as I understood this framework will be a basis for a projects framework in E4. I believe that will really streamline Eclipse user experience in many ways.

2. Structured Source Editing Framework

(Link to subproject page)

sseExtremely great source editors for XML, XSL, JSP, HTML, CSS, XSD – and other files. The editor has rich navigation & editing features JDT user would expect and is also extremely extensible. If you need to create an editor for XML-based file type you can pick the SSE XML editor and start customizing in small increments – outline view, content assistant, auto edit strategies, formatting, validation, hyperlinks. SSE editors can be embedded into multipage editors. Model management facilities can be used outside of the editor itself (i.e. from some toolbar action) and will help avoid conflicts when user did some change to the file that is already opened in the editor.

It is also possible to use custom parser to create editor for non-XML files.

I believe that SSE is long overdue in core Eclipse platform – PDE editor and ANT script would really benefit from reacher source editing capabilities (i.e. formatting).

3. Validation Framework

(Extension point description)

validation

This framework provides a clean and easy way to add build-time validation to workspace resources. This way project will have only one validation builder attached to it and it is easy to change the set of validators between product versions. The framework will handle dull tasks like markers management (i.e. there’s no need to remove the markers after the user fixed the problem) and properly call the validator on manual or auto build. There is also UI to manage validators on workspace and project levels.

Export Limitation?
Jul 6th, 2009 by Eugene Ostroukhov

I live in Ukraine. I use Amazon for ages – but at last I found top-secret book that it seems like can’t be exported from US:

emfbook

I know no other Eclipse/Java/Cocoa/whatever book that can’t be exported from US. There should be something really big in this one – if only I find some bookstore that would smuggle it here for a decent delivery price…

»  Substance:WordPress   »  Style:Ahren Ahimsa