Thursday, July 14, 2011

Removing horizontal line above compartment

In addFixedChild method of EditPart that contains compartment extract figure that is added to the pane (primary figure) and set its border to null.

Monday, July 11, 2011

Eclipse builders

When creating builder as in every other extension point make sure that IDs of builder and IDs in extension point match up. Otherwise your builders will not work and you will not know what went wrong. One place to check is project properties (right-click project -> properties -> Builders. If your build is listed as "Missing Builder" then chances are IDs are screwed up.

Friday, July 8, 2011

EMF Ecore model inheritance

Let's say you have a common.ecore with Node element. You create person.ecore in another plugin and want Person->Node inheritance. To do this create your person.ecore and load common.ecore from "Sample Ecore Editor" menu. Continue creating Person element and setting super type as node. Now, when it's time generate genmodel for person.ecore on package selection page of wizard you will see packages for person and common. Make sure you don't select common checkbox and instead choose common.ecore from "Reference generator models" pane. If you don't then person model will expect common to be on the same level as itself and you don't want that.

Thursday, June 30, 2011

setting build.id in about.mappings

http://www.eclipse.org/forums/index.php/t/216978/

https://bugs.eclipse.org/bugs/show_bug.cgi?id=309144

Pass -Dbuild.id= when you perform your site.p2 action

The Buckminster property expansion falls back to Eclipse variable
expansion so this should work:

build_id = ${env_var:BUILD_ID}

That timestamp will differ between projects. It finds the last
modification in the subtree and uses that so it's not suitable to use as
a build_id.

Wednesday, June 29, 2011

Find ImageDescriptor

public static ImageDescriptor findImageDescriptor(String path) {
  final IPath p = new Path(path);
  if (p.isAbsolute() && p.segmentCount() > 1) {
   return AbstractUIPlugin.imageDescriptorFromPlugin(p.segment(0), p
     .removeFirstSegments(1).makeAbsolute().toString());
  } else {
   return getBundledImageDescriptor(p.makeAbsolute().toString());
  }
 }

Friday, June 24, 2011

Change default messages when using EMF Validation Framework

The easiest way to do it if feature names are no issue is to create fragment with host o.e.emf.ecore and define plugin_en.properties file with values for message keys changed to your needs.

Tuesday, June 21, 2011

plugin.properties fails to replace referenced key string

If this happens make sure Bundle-Localization: plugin is in Manifest.mf

Blogger Syntax Highliter