Friday, June 27, 2014

Eclipse contribute to "Show view" menu for an existing perspective

How to contribute to "Show view" menu for an existing perspective

In this post I show how to add a shortcut to your own perspective to Window -> Show View menu in a particular perspective.

In fact you just have to define in your plugin.xml (see  Eclipse Doc. PerspectiveExtensions)
  • a perspectiveExtensions point
  • specify the perspective tagrget id
  • add a shortcut to your view.
It gives for a shortcut in Java perspective :

<extension point="org.eclipse.ui.perspectiveExtensions">
    <perspectiveExtension targetID = "org.eclipse.jdt.ui.JavaPerspective">
        <viewShortcut id="my.view.id"/>
    </perspectiveExtension>
</extension>

If you want to do this in your own perspective you can use this too or define in the createInitialLayout method of your perspective (implementing IPerspectiveFactory, see Eclipse doc IperspectiveFactory)

 public void createInitialLayout(IPageLayout pageLayout)
  { 
  pageLayout.addShowViewShortcut("my.view.id");
  }




Tuesday, June 3, 2014

Playing with kineticjs



Explanations

This post present a small Kineticjs experiment. And a JS integration in Google blog experiment. The small js above allow:
  • to zoom in and out the rectangle
  • to move the rectangle by selecting it

Encountered problems to be investigate and Todos (may be...)

  • scale function does not work
  • usage of JQuery $() function (to be removed)
  • refactor duplicated code
  • Use kineticJs drag start event

Ref

Notes using CDN here

  • The url for kineticjs could be found at https://github.com/ericdrowell/KineticJS/wiki/Version-Archive. Page extract : All of the versions below are hosted on the Amazon CloudFront CDN (Content Delivery Network), which means that you can hotlink to the URLs and enjoy fast response times no matter where you are in the world.
  • for JQuery the url could be found at http://jquery.com/download/