Skip to content

Commit

Permalink
add a try .. catch to avoid editor error when using Dynamic API (refs #…
Browse files Browse the repository at this point in the history
  • Loading branch information
gdaniel committed Jan 10, 2017
1 parent bdca826 commit 139afa0
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
import org.eclipse.emf.edit.ui.util.EditUIUtil;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlAdapter;
Expand Down Expand Up @@ -152,6 +153,15 @@ public void controlResized(ControlEvent event) {

NeoLogger.info("NeoEMF Editor Opened in {0}", Duration.between(begin, end));
}

@Override
public void setSelection(ISelection selection) {
try {
super.setSelection(selection);
} catch(NoSuchMethodError e) {
NeoLogger.warn("Captured aNoSuchMethod error when changing the selection, please check this is not related to Dynamic EMF, which is not supported for now in the editor.");
}
}

@Override
public void dispose() {
Expand Down

0 comments on commit 139afa0

Please sign in to comment.