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
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')
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/.project5
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/action/CopyFilesAndFoldersOperation.java12
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/META-INF/MANIFEST.MF4
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ModelParticipantHelpers.java8
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/RenameModelChange.java17
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ui/ScopeChooser.java29
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF6
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/pom.xml24
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/contentoutline/NestedEditorDelegatedOutlinePage.java2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java31
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/PapyrusImageUtils.java11
-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
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml22
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleIntegerEditor.java2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleReferenceEditor.java16
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringEditor.java11
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringFileEditor.java2
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java19
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultiplicityDialog.java14
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/SelectionMenu.java96
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/ReferenceSelector.java13
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java10
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/WorkspaceRevealStrategy.java9
29 files changed, 221 insertions, 170 deletions
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/.project b/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/.project
index 254c8d49648..9a7a8c768dc 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/.project
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/.project
@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/META-INF/MANIFEST.MF
index ffe4b3c9afd..c9d57ae530d 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.newchild.ui/META-INF/MANIFEST.MF
@@ -6,8 +6,8 @@ Bundle-Version: 2.0.0.qualifier
Bundle-Activator: org.eclipse.papyrus.infra.newchild.ui.Activator
Require-Bundle: org.eclipse.ui;bundle-version="[3.107.0,4.0.0)",
org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)",
- org.eclipse.papyrus.infra.properties.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.papyrus.infra.newchild;bundle-version="[1.2.0,2.0.0)"
+ org.eclipse.papyrus.infra.properties.ui;bundle-version="[2.0.0,3.0.0)",
+ org.eclipse.papyrus.infra.newchild;bundle-version="[2.0.0,3.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
index 2778749b3a0..97e65ebedbb 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/META-INF/MANIFEST.MF
@@ -16,7 +16,7 @@ Require-Bundle: org.eclipse.ui.navigator;bundle-version="[3.6.0,4.0.0)",
org.eclipse.ltk.ui.refactoring;bundle-version="[3.8.0,4.0.0)",
org.eclipse.core.filesystem;bundle-version="[1.6.0,2.0.0)",
org.eclipse.papyrus.infra.emf;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.ui;bundle-version="[1.2.0,2.0.0)",
+ org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.onefile;bundle-version="[2.0.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/action/CopyFilesAndFoldersOperation.java b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/action/CopyFilesAndFoldersOperation.java
index aefe0637a67..6638fe73e27 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/action/CopyFilesAndFoldersOperation.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.onefile.ui/src/org/eclipse/papyrus/infra/onefile/internal/ui/action/CopyFilesAndFoldersOperation.java
@@ -902,7 +902,8 @@ public class CopyFilesAndFoldersOperation {
NLS
.bind(
IDEWorkbenchMessages.CopyFilesAndFoldersOperation_infoNotFound,
- fileName), null);
+ fileName),
+ null);
}
});
}
@@ -1141,9 +1142,11 @@ public class CopyFilesAndFoldersOperation {
NLS
.bind(
IDEWorkbenchMessages.CopyFilesAndFoldersOperation_inputDialogMessage,
- resource.getName()), getAutoNewNameFor(
+ resource.getName()),
+ getAutoNewNameFor(
originalName, workspace).lastSegment()
- .toString(), validator);
+ .toString(),
+ validator);
dialog.setBlockOnOpen(true);
dialog.open();
if (dialog.getReturnCode() == Window.CANCEL) {
@@ -1642,9 +1645,8 @@ public class CopyFilesAndFoldersOperation {
}
for (int i = 0; i < sourceStores.length; i++) {
IFileStore sourceStore = sourceStores[i];
- IFileStore sourceParentStore = sourceStore.getParent();
-
if (sourceStore != null) {
+ IFileStore sourceParentStore = sourceStore.getParent();
if (destinationStore.equals(sourceStore)
|| (sourceParentStore != null && destinationStore
.equals(sourceParentStore))) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/META-INF/MANIFEST.MF
index 7652d13951c..432b6a491d7 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/META-INF/MANIFEST.MF
@@ -1,8 +1,8 @@
Manifest-Version: 1.0
Require-Bundle: org.eclipse.ltk.core.refactoring;bundle-version="[3.7.0,4.0.0)",
org.eclipse.papyrus.infra.services.controlmode.history;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.papyrus.infra.emf.readonly;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.papyrus.infra.ui;bundle-version="[1.2.0,2.0.0)"
+ org.eclipse.papyrus.infra.emf.readonly;bundle-version="[3.0.0,4.0.0)",
+ org.eclipse.papyrus.infra.ui;bundle-version="[2.0.0,3.0.0)"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.2.0.qualifier
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ModelParticipantHelpers.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ModelParticipantHelpers.java
index 865a40d590f..58c6a1c2ea2 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ModelParticipantHelpers.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ModelParticipantHelpers.java
@@ -69,8 +69,12 @@ public class ModelParticipantHelpers {
IPath diPath = null;
- if (DiModel.DI_FILE_EXTENSION.equalsIgnoreCase(initialPath.getFileExtension())) {
- diPath = initialPath;
+ if (initialPath != null) {
+ if (DiModel.DI_FILE_EXTENSION.equalsIgnoreCase(initialPath.getFileExtension())) {
+ diPath = initialPath;
+ } else {
+ return Collections.<IResource> singleton(initialFile);
+ }
} else {
return Collections.<IResource> singleton(initialFile);
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/RenameModelChange.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/RenameModelChange.java
index 423ca667e16..5139aa9b5ae 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/RenameModelChange.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/RenameModelChange.java
@@ -287,14 +287,15 @@ public class RenameModelChange extends Change {
try {
SashModel oldSash = SashModelUtils.getSashModel(resourceSet);
- URI oldSashURI = oldSash.getResourceURI();
- Resource resource = oldSash.getResource();
- resourceSet.loadModels(newFile);
- SashModel sashModel = SashModelUtils.getSashModel(resourceSet);
- URI stashNewFile = sashModel.getResourceURI();
- resource.setURI(stashNewFile);
- resource.save(ResourceUtils.getSaveOptions());
- if(oldSash != null) { // delete old stash
+ if (oldSash != null) { // delete old stash
+ URI oldSashURI = oldSash.getResourceURI();
+ Resource resource = oldSash.getResource();
+ resourceSet.loadModels(newFile);
+ SashModel sashModel = SashModelUtils.getSashModel(resourceSet);
+ URI stashNewFile = sashModel.getResourceURI();
+ resource.setURI(stashNewFile);
+ resource.save(ResourceUtils.getSaveOptions());
+
try {
resourceSet.getURIConverter().delete(oldSashURI, null);
} catch (IOException e) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ui/ScopeChooser.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ui/ScopeChooser.java
index 55cc7aafa08..dbead1d4dab 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ui/ScopeChooser.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui.resources/src/org/eclipse/papyrus/infra/ui/resources/refactoring/ui/ScopeChooser.java
@@ -73,21 +73,24 @@ public abstract class ScopeChooser implements IScopeChooser {
/**
* Determine if the given file is an XMI some specific code has been set for notation and di
*
- * @param f
+ * @param file
* @return
*/
- public boolean isXMI(IFile f) {
- URI uri = URI.createPlatformResourceURI(f.getFullPath().toString(), true);
- IContentType contentType = IDE.getContentType(f);
- Registry instance = Resource.Factory.Registry.INSTANCE;
- Object old = instance.getContentTypeToFactoryMap().get(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER);
- Object old2 = instance.getExtensionToFactoryMap().get(Resource.Factory.Registry.DEFAULT_EXTENSION);
- instance.getContentTypeToFactoryMap().put(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER, null);
- instance.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, null);
- boolean result = (f != null && contentType != null && (Resource.Factory.Registry.INSTANCE.getFactory(uri, contentType.getId()) != null || "notation".equals(f.getFileExtension()) || "di".equals(f.getFileExtension())));
- instance.getContentTypeToFactoryMap().put(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER, old);
- instance.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, old2);
- return result;
+ public boolean isXMI(IFile file) {
+ if (file != null) {
+ URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
+ IContentType contentType = IDE.getContentType(file);
+ Registry instance = Resource.Factory.Registry.INSTANCE;
+ Object old = instance.getContentTypeToFactoryMap().get(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER);
+ Object old2 = instance.getExtensionToFactoryMap().get(Resource.Factory.Registry.DEFAULT_EXTENSION);
+ instance.getContentTypeToFactoryMap().put(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER, null);
+ instance.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, null);
+ boolean result = (contentType != null && (Resource.Factory.Registry.INSTANCE.getFactory(uri, contentType.getId()) != null || "notation".equals(file.getFileExtension()) || "di".equals(file.getFileExtension())));
+ instance.getContentTypeToFactoryMap().put(Resource.Factory.Registry.DEFAULT_CONTENT_TYPE_IDENTIFIER, old);
+ instance.getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, old2);
+ return result;
+ }
+ return false;
}
public List<IFile> getFiles() {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
index d3f993e710c..f38831d1c1d 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/META-INF/MANIFEST.MF
@@ -30,13 +30,13 @@ Require-Bundle: org.eclipse.papyrus.infra.core;bundle-version="[2.0.0,3.0.0)";vi
org.eclipse.ui.ide;bundle-version="[3.12.0,4.0.0)";visibility:=reexport,
org.eclipse.papyrus.infra.core.sasheditor.di;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.edit.ui;bundle-version="[2.12.0,3.0.0)",
- org.eclipse.papyrus.infra.widgets;bundle-version="[2.0.0,3.0.0)";visibility:=reexport,
+ org.eclipse.papyrus.infra.widgets;bundle-version="[3.0.0,4.0.0)";visibility:=reexport,
org.eclipse.ui.views;bundle-version="[3.8.0,4.0.0)";visibility:=reexport,
- org.eclipse.papyrus.infra.emf;bundle-version="[2.0.1,3.0.0)",
+ org.eclipse.papyrus.infra.emf;bundle-version="[2.0.0,3.0.0)",
org.eclipse.papyrus.infra.widgets.toolbox;bundle-version="[1.2.0,2.0.0)",
org.eclipse.papyrus.infra.tools;bundle-version="[2.0.1,3.0.0)"
Bundle-Vendor: %providerName
-Bundle-Version: 1.4.0.qualifier
+Bundle-Version: 2.0.0.qualifier
Eclipse-BuddyPolicy: dependent
Bundle-ManifestVersion: 2
Bundle-Activator: org.eclipse.papyrus.infra.ui.Activator
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/pom.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/pom.xml
index a4c1a625ebe..271e7c71930 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/pom.xml
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/pom.xml
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>org.eclipse.papyrus.infra-ui</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <artifactId>org.eclipse.papyrus.infra.ui</artifactId>
- <version>1.4.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
- <description>Plugin dedicated to manage generic menus and actions, linked to EMF but not to UML nor GMF technologies.</description>
-</project>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.infra-ui</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.infra.ui</artifactId>
+ <version>2.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+ <description>Plugin dedicated to manage generic menus and actions, linked to EMF but not to UML nor GMF technologies.</description>
+</project> \ No newline at end of file
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/contentoutline/NestedEditorDelegatedOutlinePage.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/contentoutline/NestedEditorDelegatedOutlinePage.java
index 9985bb1e393..1132eed1fd5 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/contentoutline/NestedEditorDelegatedOutlinePage.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/contentoutline/NestedEditorDelegatedOutlinePage.java
@@ -691,6 +691,7 @@ public class NestedEditorDelegatedOutlinePage extends Page implements IPapyrusCo
return;
}
+ if(activeRec!=null){
activeRec = pageRec;
Control pageControl = activeRec.contentOutlinePage.getControl();
if (pageControl != null && !pageControl.isDisposed()) {
@@ -700,6 +701,7 @@ public class NestedEditorDelegatedOutlinePage extends Page implements IPapyrusCo
sashEditorPageBook.showPage(pageControl);
getSite().setActivePageSite(pageSite);
}
+ }
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
index 6c6d7b1f228..e0eff8ff1d4 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/editor/CoreMultiDiagramEditor.java
@@ -369,22 +369,23 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
* @return
*/
protected ActionBarContributorRegistry getActionBarContributorRegistry() {
- if (actionBarContributorRegistry != null) {
- return actionBarContributorRegistry;
- }
-
- // Try to got it from CoreComposedActionBarContributor
- // Get it from the contributor.
- IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
- if (contributor instanceof CoreComposedActionBarContributor) {
- log.debug(getClass().getSimpleName() + " - ActionBarContributorRegistry loaded from CoreComposedActionBarContributor.");
- return ((CoreComposedActionBarContributor) contributor).getActionBarContributorRegistry();
- } else {
- // Create a registry.
- log.debug(getClass().getSimpleName() + " - create an ActionBarContributorRegistry.");
- return createActionBarContributorRegistry();
+ if (actionBarContributorRegistry == null) {
+
+ // Try to got it from CoreComposedActionBarContributor
+ // Get it from the contributor.
+ IEditorActionBarContributor contributor = getEditorSite().getActionBarContributor();
+ if (contributor instanceof CoreComposedActionBarContributor) {
+ log.debug(getClass().getSimpleName() + " - ActionBarContributorRegistry loaded from CoreComposedActionBarContributor.");
+ actionBarContributorRegistry = ((CoreComposedActionBarContributor) contributor).getActionBarContributorRegistry();
+
+ } else {
+ // Create a registry.
+ log.debug(getClass().getSimpleName() + " - create an ActionBarContributorRegistry.");
+ actionBarContributorRegistry = createActionBarContributorRegistry();
+ }
}
+ return actionBarContributorRegistry;
}
/**
@@ -611,7 +612,7 @@ public class CoreMultiDiagramEditor extends AbstractMultiPageSashEditor implemen
// start remaining services
servicesRegistry.startRegistry();
-
+
// In case of a shard
String name = uri.lastSegment();
if (!name.equals(getPartName())) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/PapyrusImageUtils.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/PapyrusImageUtils.java
index f2a2e97666c..2dbbf3fb7bc 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/PapyrusImageUtils.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/PapyrusImageUtils.java
@@ -57,10 +57,13 @@ public class PapyrusImageUtils {
Image result = JFaceResources.getImageRegistry().get(key);
if (result == null) {
URL url = Activator.getDefault().getBundle().getEntry(path);
- try {
- result = new Image(Display.getDefault(), url.openStream());
- JFaceResources.getImageRegistry().put(key, result);
- } catch (IOException e) {
+
+ if (url != null) {
+ try {
+ result = new Image(Display.getDefault(), url.openStream());
+ JFaceResources.getImageRegistry().put(key, result);
+ } catch (IOException e) {
+ }
}
}
return result;
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) {
}
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
index aa58721fba9..7e29d20014d 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/META-INF/MANIFEST.MF
@@ -25,7 +25,7 @@ Export-Package: org.eclipse.papyrus.infra.widgets,
org.eclipse.papyrus.infra.widgets.wizard.pages
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
-Bundle-Version: 2.0.0.qualifier
+Bundle-Version: 3.0.0.qualifier
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-ManifestVersion: 2
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
index c7067be8e76..cd2c0f826ba 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/pom.xml
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <artifactId>org.eclipse.papyrus.infra-ui</artifactId>
- <groupId>org.eclipse.papyrus</groupId>
- <version>0.0.1-SNAPSHOT</version>
- </parent>
- <artifactId>org.eclipse.papyrus.infra.widgets</artifactId>
- <version>2.0.0-SNAPSHOT</version>
- <packaging>eclipse-plugin</packaging>
-</project>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus.infra-ui</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>0.0.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>org.eclipse.papyrus.infra.widgets</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java
index bae688415de..7629b33e550 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleDoubleEditor.java
@@ -15,7 +15,7 @@ import org.eclipse.papyrus.infra.widgets.selectors.RealSelector;
import org.eclipse.swt.widgets.Composite;
-public class MultipleDoubleEditor extends MultipleStringEditor {
+public class MultipleDoubleEditor extends MultipleStringEditor<RealSelector> {
/**
* Constructs an Editor for multiple double values
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleIntegerEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleIntegerEditor.java
index 4b3604e4af6..f8bb968caeb 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleIntegerEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleIntegerEditor.java
@@ -20,7 +20,7 @@ import org.eclipse.swt.widgets.Composite;
* @author Camille Letavernier
*
*/
-public class MultipleIntegerEditor extends MultipleStringEditor {
+public class MultipleIntegerEditor extends MultipleStringEditor<IntegerSelector> {
/**
* Constructs an Editor for multiple Integer values
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleReferenceEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleReferenceEditor.java
index 7330d044179..cb25254ee2e 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleReferenceEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleReferenceEditor.java
@@ -27,12 +27,9 @@ import org.eclipse.swt.widgets.Composite;
* @author Camille Letavernier
*
*/
-public class MultipleReferenceEditor extends MultipleValueEditor {
+public class MultipleReferenceEditor extends MultipleValueEditor<ReferenceSelector> {
+
- /**
- * The element selector for the available values
- */
- protected ReferenceSelector selector;
protected IStaticContentProvider contentProvider;
@@ -53,7 +50,6 @@ public class MultipleReferenceEditor extends MultipleValueEditor {
*/
public MultipleReferenceEditor(Composite parent, int style, boolean ordered, boolean unique, String label) {
super(parent, style, new ReferenceSelector(unique), ordered, unique, label);
- this.selector = (ReferenceSelector) super.selector;
// Default providers
setProviders(EmptyContentProvider.instance, new WrappedLabelProvider());
}
@@ -99,17 +95,23 @@ public class MultipleReferenceEditor extends MultipleValueEditor {
this.contentProvider = contentProvider;
- selector.setContentProvider(contentProvider);
+ if (selector instanceof ReferenceSelector) {
+ selector.setContentProvider(contentProvider);
+ }
if (labelProvider != null) {
+
selector.setLabelProvider(labelProvider);
+
super.setLabelProvider(labelProvider);
}
}
@Override
public void setUnique(boolean unique) {
+
selector.setUnique(unique);
+
super.setUnique(unique);
}
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringEditor.java
index ade19dcc579..ca3a652b58e 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringEditor.java
@@ -22,9 +22,10 @@ import org.eclipse.swt.widgets.Composite;
* An editor for multivalued String attributes
*
* @author Camille Letavernier
+ * @param <T>
*
*/
-public class MultipleStringEditor extends MultipleValueEditor {
+public class MultipleStringEditor<T extends StringSelector> extends MultipleValueEditor<IElementSelector> {
/**
* Constructs an Editor for multiple String values
@@ -104,7 +105,7 @@ public class MultipleStringEditor extends MultipleValueEditor {
* @param label
* The editor's label
*/
- public MultipleStringEditor(Composite parent, int style, IElementSelector selector, boolean ordered, boolean unique, String label) {
+ public MultipleStringEditor(Composite parent, int style, T selector, boolean ordered, boolean unique, String label) {
super(parent, style, selector, ordered, unique, label);
init();
}
@@ -121,7 +122,7 @@ public class MultipleStringEditor extends MultipleValueEditor {
* @param selector
* The Element selector for the dialog's left-pane. Used to select values or enter new ones.
*/
- public MultipleStringEditor(Composite parent, int style, IElementSelector selector) {
+ public MultipleStringEditor(Composite parent, int style, T selector) {
super(parent, style, selector);
init();
}
@@ -140,7 +141,7 @@ public class MultipleStringEditor extends MultipleValueEditor {
* @param label
* The editor's label
*/
- public MultipleStringEditor(Composite parent, int style, IElementSelector selector, String label) {
+ public MultipleStringEditor(Composite parent, int style, T selector, String label) {
super(parent, style, selector, label);
init();
}
@@ -167,7 +168,7 @@ public class MultipleStringEditor extends MultipleValueEditor {
}
public void setContentProvider(final IStaticContentProvider provider) {
- IElementSelector selector = new StandardSelector(StringCombo.class) {
+ StandardSelector selector = new StandardSelector(StringCombo.class) {
@Override
public void createControls(Composite parent) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringFileEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringFileEditor.java
index f69aa41b8ca..e639d9764d0 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringFileEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleStringFileEditor.java
@@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.FileDialog;
*
* @author Camille Letavernier
*/
-public class MultipleStringFileEditor extends MultipleValueEditor {
+public class MultipleStringFileEditor extends MultipleValueEditor<IElementSelector> {
protected boolean allowBrowseWorkspace = true;
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
index 26dce0a5897..669bbe5efce 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultipleValueEditor.java
@@ -52,9 +52,10 @@ import org.eclipse.swt.widgets.TreeItem;
* An editor for multivalued fields.
*
* @author Camille Letavernier
+ * @param <T>
*
*/
-public class MultipleValueEditor extends AbstractListEditor implements SelectionListener, IChangeListener, DisposeListener {
+public class MultipleValueEditor<T extends IElementSelector> extends AbstractListEditor implements SelectionListener, IChangeListener, DisposeListener {
public static final int MANY = -1;
@@ -103,7 +104,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
/**
* The element selector for this editor's dialog
*/
- protected IElementSelector selector;
+ protected T selector;
/**
* Indicates whether the underlying is ordered
@@ -137,6 +138,8 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
/**
*
* Constructor.
+ *
+ * @param <T>
*
* @param parent
* The Composite in which this Editor should be displayed
@@ -151,7 +154,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param label
* The label for this editor. If null, the label isn't created.
*/
- public MultipleValueEditor(Composite parent, int style, IElementSelector selector, boolean ordered, boolean unique, String label) {
+ public MultipleValueEditor(Composite parent, int style, T selector, boolean ordered, boolean unique, String label) {
this(parent, style, selector, ordered, unique, label, MANY);
}
@@ -174,7 +177,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param upperBound
* The maximum number of values that must appear.
*/
- public MultipleValueEditor(Composite parent, int style, IElementSelector selector, boolean ordered, boolean unique, String label, int upperBound) {
+ public MultipleValueEditor(Composite parent, int style, T selector, boolean ordered, boolean unique, String label, int upperBound) {
super(parent, label);
Assert.isNotNull(selector, "The Element Selector must be specified for a MultipleValueEditor"); //$NON-NLS-1$
@@ -231,7 +234,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
return data;
}
- public void setSelector(IElementSelector selector) {
+ public void setSelector(T selector) {
this.selector = selector;
}
@@ -274,7 +277,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param ordered
* Specify if the observed collection is ordered. If true, Up and Down controls are displayed
*/
- public MultipleValueEditor(Composite parent, int style, IElementSelector selector, boolean ordered) {
+ public MultipleValueEditor(Composite parent, int style, T selector, boolean ordered) {
this(parent, style, selector, ordered, false, null);
}
@@ -289,7 +292,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param selector
* The element selector for this editor's dialog
*/
- public MultipleValueEditor(Composite parent, int style, IElementSelector selector) {
+ public MultipleValueEditor(Composite parent, int style, T selector) {
this(parent, style, selector, false, false, null);
}
@@ -306,7 +309,7 @@ public class MultipleValueEditor extends AbstractListEditor implements Selection
* @param label
* The label for this Editor
*/
- public MultipleValueEditor(Composite parent, int style, IElementSelector selector, String label) {
+ public MultipleValueEditor(Composite parent, int style, T selector, String label) {
this(parent, style, selector, false, false, label);
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultiplicityDialog.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultiplicityDialog.java
index d110af0edff..1af596b8279 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultiplicityDialog.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/MultiplicityDialog.java
@@ -252,10 +252,16 @@ public class MultiplicityDialog extends AbstractValueEditor implements Selection
* This allow to manage the stack layout top control displayed.
*/
protected void displayTopControl() {
- final String multiplicityEditorMode = preferenceStore.getString(MultiplicityConstants.MULTIPLICITY_EDITOR_MODE);
- if (null != preferenceStore && null != multiplicityEditorMode) {
- // If the advanced mode is used, display the double editors composite, else use the simple mode with the string combo
- stackLayout.topControl = multiplicityEditorMode.equals(MultiplicityConstants.ADVANCED_MODE) ? doubleEditorsComposite : stringComboEditor;
+ if (null != preferenceStore) {
+ final String multiplicityEditorMode = preferenceStore.getString(MultiplicityConstants.MULTIPLICITY_EDITOR_MODE);
+ if (null != multiplicityEditorMode) {
+ // If the advanced mode is used, display the double editors composite, else use the simple mode with the string combo
+ stackLayout.topControl = multiplicityEditorMode.equals(MultiplicityConstants.ADVANCED_MODE) ? doubleEditorsComposite : stringComboEditor;
+ } else {
+ if (null == stackLayout.topControl) {
+ stackLayout.topControl = stringComboEditor;
+ }
+ }
} else {
if (null == stackLayout.topControl) {
stackLayout.topControl = stringComboEditor;
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/SelectionMenu.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/SelectionMenu.java
index db1d6132146..ad1300a54f9 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/SelectionMenu.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/SelectionMenu.java
@@ -80,62 +80,66 @@ public class SelectionMenu {
* @since 2.0
*/
public SelectionMenu(Shell parentShell, Object source) {
- if (source instanceof TableViewer && parentShell != null) {
- TableViewer tableViewer = (TableViewer) source;
-
- // Get the cell's y position (we can't use the getCell(Point location) method)
- int selectionIndex = tableViewer.getTable().getSelectionIndex();
- int cellHeight = tableViewer.getTable().getItem(selectionIndex).getBounds().height;
- int y = tableViewer.getTable().getShell().getLocation().y;
- y += selectionIndex * cellHeight;
-
- // Get the cell's x position and append by the table's width
- // int width= tableViewer.getTable().getSize().x;
- int width = tableViewer.getTable().getShell().getBounds().width;
- int x = tableViewer.getTable().getShell().getLocation().x + width;
-
- Point location = new Point(x, y);
- init(parentShell, location, -1, 0);
- return;
- }
+ if (parentShell != null) {
+ if (source instanceof TableViewer) {
+ TableViewer tableViewer = (TableViewer) source;
+
+ // Get the cell's y position (we can't use the getCell(Point location) method)
+ int selectionIndex = tableViewer.getTable().getSelectionIndex();
+ int cellHeight = tableViewer.getTable().getItem(selectionIndex).getBounds().height;
+ int y = tableViewer.getTable().getShell().getLocation().y;
+ y += selectionIndex * cellHeight;
- init(parentShell, parentShell.getDisplay().getCursorLocation(), 1, 1);
+ // Get the cell's x position and append by the table's width
+ // int width= tableViewer.getTable().getSize().x;
+ int width = tableViewer.getTable().getShell().getBounds().width;
+ int x = tableViewer.getTable().getShell().getLocation().x + width;
+
+ Point location = new Point(x, y);
+ init(parentShell, location, -1, 0);
+ return;
+ }
+
+ init(parentShell, parentShell.getDisplay().getCursorLocation(), 1, 1);
+ }
}
/**
* @since 2.0
*/
public SelectionMenu(Shell parentShell, Object source, Point cursorPosition) {
- if (source instanceof Table && parentShell != null && cursorPosition != null) {
- Table table = (Table) source;
-
- TableItem item = table.getItem(cursorPosition);
-
- if (item != null) {
- int selectionIndex = 0;
- for (Object tableItem : table.getItems()) {
- if (tableItem.equals(item)) {
- break;
+ if (parentShell != null) {
+ if (source instanceof Table && cursorPosition != null) {
+ Table table = (Table) source;
+
+ TableItem item = table.getItem(cursorPosition);
+
+ if (item != null) {
+ int selectionIndex = 0;
+ for (Object tableItem : table.getItems()) {
+ if (tableItem.equals(item)) {
+ break;
+ }
+ selectionIndex++;
}
- selectionIndex++;
- }
- int cellHeight = item.getBounds().height;
- int y = table.getShell().getLocation().y;
- y += selectionIndex * cellHeight;
+ int cellHeight = item.getBounds().height;
+ int y = table.getShell().getLocation().y;
+ y += selectionIndex * cellHeight;
- // Get the cell's x position and append by the table's width
- // int width= tableViewer.getTable().getSize().x;
- int width = table.getShell().getBounds().width;
- int x = table.getShell().getLocation().x + width;
+ // Get the cell's x position and append by the table's width
+ // int width= tableViewer.getTable().getSize().x;
+ int width = table.getShell().getBounds().width;
+ int x = table.getShell().getLocation().x + width;
- Point location = new Point(x, y);
- init(parentShell, location, -1, 0);
- return;
+ Point location = new Point(x, y);
+ init(parentShell, location, -1, 0);
+ return;
+ }
}
- }
- init(parentShell, parentShell.getDisplay().getCursorLocation(), 1, 1);
+ init(parentShell, parentShell.getDisplay().getCursorLocation(), 1, 1);
+ }
}
public SelectionMenu(Shell parentShell, Point location) {
@@ -252,10 +256,10 @@ public class SelectionMenu {
public void dispose() {
if (tableViewer != null) {
tableViewer.removeSelectionChangedListener(selectionChangedListener);
- }
- if (tableViewer.getTable() != null) {
- tableViewer.getTable().removeKeyListener(keyListener);
+ if (tableViewer.getTable() != null) {
+ tableViewer.getTable().removeKeyListener(keyListener);
+ }
}
if (shell != null) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/ReferenceSelector.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/ReferenceSelector.java
index 9522a9364c0..f1d48aa229b 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/ReferenceSelector.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/selectors/ReferenceSelector.java
@@ -25,6 +25,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.papyrus.infra.widgets.editors.ICommitListener;
import org.eclipse.papyrus.infra.widgets.editors.IElementSelectionListener;
@@ -148,7 +149,7 @@ public class ReferenceSelector implements IElementSelector {
* @param containerElements
* The array of elements wrapped in their container
* @return
- * The array of semantic elements to be converted
+ * The array of semantic elements to be converted
*
* @see #getContainerElements(Object[])
* @see org.eclipse.papyrus.infra.widgets.providers.IAdaptableContentProvider
@@ -169,7 +170,7 @@ public class ReferenceSelector implements IElementSelector {
* @param selection
* The input array to filter
* @return
- * The filtered array
+ * The filtered array
*
* @see org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider#isValidValue(Object)
*/
@@ -321,7 +322,7 @@ public class ReferenceSelector implements IElementSelector {
* @author Camille Letavernier
*
*/
- private class SelectionFilteredBrowseStrategy extends ProviderBasedBrowseStrategy {
+ private class SelectionFilteredBrowseStrategy extends ProviderBasedBrowseStrategy<Viewer> {
public SelectionFilteredBrowseStrategy(ITreeContentProvider provider) {
super(provider);
@@ -345,6 +346,12 @@ public class ReferenceSelector implements IElementSelector {
clearCache();
}
}
+
+ @Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ super.inputChanged(viewer, oldInput, newInput);
+ this.viewer = viewer;
+ }
}
/**
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
index 9d2136f32c7..f79d597b14a 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/ProviderBasedBrowseStrategy.java
@@ -28,7 +28,7 @@ import org.eclipse.papyrus.infra.widgets.providers.EncapsulatedContentProvider;
import org.eclipse.papyrus.infra.widgets.providers.IHierarchicContentProvider;
-public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider implements TreeBrowseStrategy {
+public class ProviderBasedBrowseStrategy<T extends Viewer> extends EncapsulatedContentProvider implements TreeBrowseStrategy {
protected ITreeContentProvider provider;
@@ -169,11 +169,7 @@ public class ProviderBasedBrowseStrategy extends EncapsulatedContentProvider imp
}
}
- @Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- super.inputChanged(viewer, oldInput, newInput);
- this.viewer = viewer;
- }
- protected Viewer viewer;
+
+ protected T viewer;
}
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/WorkspaceRevealStrategy.java b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/WorkspaceRevealStrategy.java
index f08c5a76ddf..d3b5c8ee3bb 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/WorkspaceRevealStrategy.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/strategy/WorkspaceRevealStrategy.java
@@ -20,6 +20,7 @@ import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
/**
* A Strategy to search for a Resource in the Workspace
@@ -27,7 +28,7 @@ import org.eclipse.jface.viewers.TreeViewer;
* @author Camille Letavernier
*
*/
-public class WorkspaceRevealStrategy extends ProviderBasedBrowseStrategy {
+public class WorkspaceRevealStrategy extends ProviderBasedBrowseStrategy<Viewer> {
public WorkspaceRevealStrategy(ITreeContentProvider provider) {
super(provider);
@@ -38,6 +39,12 @@ public class WorkspaceRevealStrategy extends ProviderBasedBrowseStrategy {
}
@Override
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ super.inputChanged(viewer, oldInput, newInput);
+ this.viewer = viewer;
+ }
+
+ @Override
public void revealSemanticElement(List<?> elementsToReveal) {
if (viewer instanceof TreeViewer) {
TreeViewer treeViewer = (TreeViewer) viewer;

Back to the top