Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2016-08-09 10:25:50 +0000
committerGerrit Code Review @ Eclipse.org2016-08-28 15:46:41 +0000
commit7310db0b3b2e8ee805fedf4bfd16baf438c89332 (patch)
tree3dadff6a067e8d8bcbf837d8277dfac7749aef27 /plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox
parent7851474fe5f33de156c797942945a3e9c97cb0a8 (diff)
downloadorg.eclipse.papyrus-7310db0b3b2e8ee805fedf4bfd16baf438c89332.tar.gz
org.eclipse.papyrus-7310db0b3b2e8ee805fedf4bfd16baf438c89332.tar.xz
org.eclipse.papyrus-7310db0b3b2e8ee805fedf4bfd16baf438c89332.zip
Bug 443799 - Fix potential bugs identified by FindBugs in oep.infra.*
Bug 499554 - Oxygen release version number moved to 3.0.0. Change-Id: I8e112db7175a5b89eb9b37973639627a6c29e007
Diffstat (limited to 'plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox')
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/CombinedPopupAndViewBuilder.java4
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/ViewBuilder.java8
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/utils/ToolbooxImageUtils.java6
3 files changed, 11 insertions, 7 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/CombinedPopupAndViewBuilder.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/CombinedPopupAndViewBuilder.java
index f6621f36983..9a189e80fb7 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/CombinedPopupAndViewBuilder.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/CombinedPopupAndViewBuilder.java
@@ -74,10 +74,10 @@ public class CombinedPopupAndViewBuilder implements IBuilder {
// If the Notification view is not visible show temporary notification
if ((notificationView != null) && !(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().isPartVisible(notificationView))) {
createNotificationPopup(wrapper, toolkit);
+ return createNotificationLog(notificationView, wrapper, toolkit);
}
- // In any case, log the notification in the PapyrusNotificationView so that the user can consult this later.
- return createNotificationLog(notificationView, wrapper, toolkit);
+ return null;
}
/*
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/ViewBuilder.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/ViewBuilder.java
index 5ac8faacf14..6c47ba72824 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/ViewBuilder.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/notification/builders/ViewBuilder.java
@@ -70,9 +70,11 @@ public class ViewBuilder implements IBuilder {
}
}
}
- ViewNotification notification = new ViewNotification(viewCompo);
- viewCompo.setINotification(notification);
- return notification;
+ if (viewCompo != null) {
+ ViewNotification notification = new ViewNotification(viewCompo);
+ viewCompo.setINotification(notification);
+ return notification;
+ }
}
} catch (PartInitException e) {
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/utils/ToolbooxImageUtils.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/utils/ToolbooxImageUtils.java
index 400bcf5263a..722f6519987 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/utils/ToolbooxImageUtils.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets.toolbox/src/org/eclipse/papyrus/infra/widgets/toolbox/utils/ToolbooxImageUtils.java
@@ -56,8 +56,10 @@ public class ToolbooxImageUtils {
if (result == null) {
URL url = Activator.getDefault().getBundle().getEntry(path.toString());
try {
- result = new Image(Display.getDefault(), url.openStream());
- JFaceResources.getImageRegistry().put(key, result);
+ if (url != null) {
+ result = new Image(Display.getDefault(), url.openStream());
+ JFaceResources.getImageRegistry().put(key, result);
+ }
} catch (IOException e) {
}
}

Back to the top