Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am vsavicks on github.
  • I am vsavicks (https://keybase.io/vsavicks) on keybase.
  • I have a public key ASDYUspqkuzkSlGS8fegUTJXYdYHiJ7fjICykOi8ikGqYQo

To claim this, I am signing this object:

@vsavicks
vsavicks / gist:8346089
Created January 10, 2014 02:39
How to get hold of the resource error markers
// show error markers if added
IResource resource = (IResource) diagramEditor.getEditorInput().getAdapter(IResource.class);
if (resource == null)
return null;
IMarker[] problems = null;
int depth = IResource.DEPTH_INFINITE;
try {
problems = resource.findMarkers(IMarker.PROBLEM, true, depth);
for (IMarker marker : problems) {
System.err.println(marker.getAttribute(IMarker.MESSAGE));
@vsavicks
vsavicks / GMF Gen Shortcuts
Created October 11, 2013 10:27
How to tell gmfgen to generate the shortcuts capability.
'Contains Shortcuts To' - Set of domain meta-model file extensions. Elements of the corresponding models could be shortcutted on this diagram.
'Shortcuts Provided For' - Set of domain meta-model names. Elements of this diagram domain model could be added as a shortcuts to the diagrams of the specified domains.
@vsavicks
vsavicks / Generated EMF comments
Created August 17, 2013 01:50
How to add comments to generated EMF code
Right click the element for which you wish to add the java doc, and add EAnnotation and set the Source to "http://www.eclipse.org/emf/2002/GenModel". Add a details entry to the EAnnotation and set the key to 'documentation' and value to the comment that you want to be generated.
@vsavicks
vsavicks / Eclipse runtime problem fix
Last active December 20, 2015 01:59
Fixing the Eclipse runtime problem: "java.lang.IllegalStateException: Unable to acquire application service. Ensure that the org.eclipse.core.runtime bundle is resolved and started (see config.ini)." To fix: add following arguments to the PDE target config program arguments
Dosgi.bundles=org.eclipse.core.runtime@start,org.eclipse.equinox.common@start
@vsavicks
vsavicks / Dynamic palette tool in GMF
Last active December 17, 2015 01:59
Adding a custom tool to a palette toolbar programmatically (GMF)
PaletteRoot paletteRoot = ((DiagramEditor) diagramEditor).getDiagramGraphicalViewer().getEditDomain().getPaletteViewer().getPaletteRoot();
for (Object e : paletteRoot.getChildren()) {
if (e instanceof PaletteToolbar) {
ToolEntry entry = new ToolEntry("Import", "Import a component", ComponentsDiagramEditorPlugin.findImageDescriptor("/ac.soton.fmusim.components/icons/Import.gif"), null) {};
((DiagramEditor) diagramEditor).getDiagramGraphicalViewer().getEditDomain().getPaletteViewer().addPaletteListener(new PaletteListener(){
@Override
public void activeToolChanged(PaletteViewer palette,
ToolEntry tool) {