Skip to content

Instantly share code, notes, and snippets.

@kthoms
Created February 13, 2012 20:52
Show Gist options
  • Save kthoms/1820295 to your computer and use it in GitHub Desktop.
Save kthoms/1820295 to your computer and use it in GitHub Desktop.
public class DmodelCustomOpenModelElementFeature extends DmodelCustomOpenModelElementFeatureBase {
@Inject IURIEditorOpener opener;
public DmodelCustomOpenModelElementFeature(IFeatureProvider fp) {
super(fp);
opener = Activator.get(IURIEditorOpener.class);
}
@Override
public boolean canExecute(ICustomContext context) {
return getBusinessObjectForPictogramElement(context.getInnerPictogramElement()) != null;
}
@Override
public String getName() {
return "Element öffnen";
}
@Override
public void execute(ICustomContext context, EObject object) {
opener.open(EcoreUtil.getURI(object), true);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment