From 9c41946eb43d5dc3808fa56f03f5a15b42be1f43 Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Sat, 15 Apr 2023 13:07:10 +0200 Subject: [PATCH] ResourceNavigator not available in new eclipse versions #265 --- .../eclipse/easyshell/plugin/commands/DefineCommands.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/commands/DefineCommands.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/commands/DefineCommands.java index 7fd285b..3104dae 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/commands/DefineCommands.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/commands/DefineCommands.java @@ -41,7 +41,6 @@ public class DefineCommands extends ExtensionContributionFactory { public DefineCommands() { } - @SuppressWarnings("deprecation") @Override public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) { if (GeneralDataStore.instance().getData().getMenuPopup() != CheckBox.yes) { @@ -49,7 +48,7 @@ public void createContributionItems(IServiceLocator serviceLocator, IContributio } IWorkbenchPart activePart = serviceLocator.getService(IWorkbenchPart.class); boolean isResourceNavigator = false; - isResourceNavigator = activePart instanceof org.eclipse.ui.views.navigator.ResourceNavigator; + isResourceNavigator = activePart != null && "org.eclipse.ui.views.navigator.ResourceNavigator".equals(activePart.getClass().getCanonicalName()); if ((isResourceNavigator == isForResourceNavigator())) { ResourceType resType = ResourceUtils.getCommonResourceType(activePart); if (resType != null) {