Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java4
-rw-r--r--plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/Suppliers2.java21
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/InternalModelIndex.java21
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java35
-rw-r--r--plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java40
-rw-r--r--plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical/src/org/eclipse/papyrus/infra/gmfdiag/canonical/editpolicy/PapyrusCanonicalEditPolicy.java11
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/ui/ControlledUnitLabelDecorator.java11
-rw-r--r--plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java15
8 files changed, 85 insertions, 73 deletions
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java b/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
index b04b7dec9d2..6ee032a350a 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
@@ -11,7 +11,7 @@
* Contributors:
* CEA LIST - Initial API and implementation
* Christian W. Damus = bug 485220
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.tools;
@@ -24,7 +24,7 @@ import org.osgi.util.tracker.ServiceTracker;
/**
* The activator class controls the plug-in life cycle
- *
+ *
* @since 2.0
*/
public class Activator extends Plugin {
diff --git a/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/Suppliers2.java b/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/Suppliers2.java
index ec802230c36..9c315809a54 100644
--- a/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/Suppliers2.java
+++ b/plugins/infra/core/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/Suppliers2.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2015 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.tools.util;
@@ -26,6 +26,7 @@ import com.google.common.base.Suppliers;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
/**
* Utilities for working with suppliers that are not provided by {@linkplain Suppliers Guava}.
@@ -44,7 +45,7 @@ public class Suppliers2 {
* available, after which it returns that value. If the future completes with an
* exception, then the supplier will always provide {@code null} and the exception
* will not be accessible.
- *
+ *
* @param future
* a future result
* @return a supplier of the eventual value of the {@code future}
@@ -59,7 +60,7 @@ public class Suppliers2 {
* available, after which it returns that value. If the future completes with an
* exception, then the supplier will always provide the default and the exception
* will not be accessible.
- *
+ *
* @param future
* a future result
* @param defaultValue
@@ -68,8 +69,8 @@ public class Suppliers2 {
*/
public static <V> Supplier<V> eventualSupplier(Future<V> future, V defaultValue) {
return (future instanceof ListenableFuture<?>)
- ? new ListenableFutureSupplier<V>((ListenableFuture<V>) future, defaultValue)
- : new FutureSupplier<V>(future, defaultValue);
+ ? new ListenableFutureSupplier<>((ListenableFuture<V>) future, defaultValue)
+ : new FutureSupplier<>(future, defaultValue);
}
//
@@ -85,6 +86,7 @@ public class Suppliers2 {
this.value = defaultValue;
}
+ @Override
public V get() {
if ((value == null) && (future != null) && future.isDone()) {
try {
@@ -112,20 +114,23 @@ public class Suppliers2 {
private AtomicReference<V> value;
ListenableFutureSupplier(ListenableFuture<V> future, V defaultValue) {
- value = new AtomicReference<V>(defaultValue);
+ value = new AtomicReference<>(defaultValue);
Futures.addCallback(future, new FutureCallback<V>() {
+ @Override
public void onSuccess(V result) {
value.set(result);
}
+ @Override
public void onFailure(Throwable t) {
// Normal case. There will never be a value
Activator.log.error("Future execution failed", t);
}
- });
+ }, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
+ @Override
public V get() {
return value.get();
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/InternalModelIndex.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/InternalModelIndex.java
index 9edac0ae384..0f72e93f48f 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/InternalModelIndex.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/InternalModelIndex.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2016, 2017 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.emf.internal.resource.index;
@@ -35,6 +35,7 @@ import org.eclipse.papyrus.infra.emf.resource.index.WorkspaceModelIndex;
import com.google.common.util.concurrent.AsyncFunction;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
import com.google.common.util.concurrent.SettableFuture;
/**
@@ -78,11 +79,11 @@ public abstract class InternalModelIndex {
/**
* Obtains the content types matching a {@code file}.
- *
+ *
* @param file
* a file in the workspace
* @return the content types of the {@code file}, or an empty array if none
- *
+ *
* @precondition The {@link IndexManager} must have already {@linkplain #start() started} me.
*/
protected final IContentType[] getContentTypes(IFile file) {
@@ -92,25 +93,25 @@ public abstract class InternalModelIndex {
/**
* Obtains an asynchronous future result that is scheduled to run after
* any pending indexing work has completed.
- *
+ *
* @param callable
* the operation to schedule
- *
+ *
* @return the future result of the operation
*/
protected <V> ListenableFuture<V> afterIndex(final Callable<V> callable) {
AsyncFunction<IndexManager, V> indexFunction = mgr -> mgr.afterIndex(this, callable);
- return Futures.transformAsync(manager, indexFunction);
+ return Futures.transformAsync(manager, indexFunction, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
/**
* Executes the specified {@code callable} on the index if it is ready now to provide
* a result.
- *
+ *
* @param callable
* an index operation
* @return the result, or {@code null} if the index is not now ready
- *
+ *
* @throws CoreException
* on failure to get the index manager or exception in the
* {@code callable}
@@ -164,7 +165,7 @@ public abstract class InternalModelIndex {
/**
* Do I have an up-to-date index for the given {@code project}?
- *
+ *
* @param project
* a project
* @return whether I have an up-to-date index for it
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
index 74b52bc7fc2..81aae046d2d 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/resource/index/WorkspaceModelIndex.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014, 2017 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.emf.resource.index;
@@ -60,6 +60,7 @@ import com.google.common.collect.SetMultimap;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
/**
* A general-purpose index of model resources in the Eclipse workspace.
@@ -289,7 +290,7 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
/**
* Obtains the name of this index.
- *
+ *
* @return my name
* @since 2.1
*/
@@ -306,14 +307,14 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
* Obtains an asynchronous future result that is scheduled to run after any pending indexing work has completed.
* The {@code function} is <em>not</em> invoked under synchronization on the index; it is passed a copy of the
* last consistent state of the index after any pending calculations have completed.
- *
+ *
* @param function
* the function to schedule. Its input is the complete index map
- *
+ *
* @return the future result of the function applied to the index
*/
public <V> ListenableFuture<V> afterIndex(final Function<? super Map<IFile, T>, V> function) {
- return Futures.transform(getIndex(), function);
+ return Futures.transform(getIndex(), function, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
/**
@@ -321,10 +322,10 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
* pending indexing work has completed. The {@code callable} is invoked under
* synchronization on the index, so it must be careful about how it
* synchronizes on other objects to avoid deadlocks.
- *
+ *
* @param callable
* the operation to schedule
- *
+ *
* @return the future result of the operation
*/
@Override
@@ -345,7 +346,7 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
* Schedules an operation to run after any pending indexing work has completed.
* The {@code runnable} is invoked under synchronization on the index, so it must be careful about how it
* synchronizes on other objects to avoid deadlocks.
- *
+ *
* @param runnable
* the operation to schedule
*/
@@ -361,7 +362,7 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
/**
* Obtains the index when it is ready.
- *
+ *
* @return the future value of the index, when it is ready
*/
public ListenableFuture<Map<IFile, T>> getIndex() {
@@ -532,7 +533,7 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
public void onFailure(Throwable t) {
// Don't need a listener
}
- });
+ }, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
public void removeListener(IWorkspaceModelIndexListener listener) {
@@ -546,7 +547,7 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
public void onFailure(Throwable t) {
// Couldn't have added the listener anyways
}
- });
+ }, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
//
@@ -559,17 +560,17 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
public static interface IndexHandler<T> {
/**
* Updates the index for a file that matches our selection criteria.
- *
+ *
* @param file
* a file that exists and matches the index selection criteria
- *
+ *
* @return the object to store in the index for this {@code file}
*/
T index(IFile file);
/**
* Updates the index for a file that no longer exists or no longer matches our selection criteria.
- *
+ *
* @param file
* a file that no longer exists or otherwise no longer matches our selection criteria. It is removed from the index
*/
@@ -604,12 +605,12 @@ public class WorkspaceModelIndex<T> extends InternalModelIndex {
public static interface PersistentIndexHandler<T> extends IndexHandler<T> {
/**
* Initializes the {@code index} data for a file from the persistent store.
- *
+ *
* @param file
* a file in the workspace
* @param index
* its previously stored index
- *
+ *
* @return whether the {@code index} data were successfully integrated.
* A {@code false} result indicates that the file must be indexed
* from scratch
diff --git a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java
index 5b4ee99c36a..a668f194884 100644
--- a/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java
+++ b/plugins/infra/gmfdiag/assistant/org.eclipse.papyrus.infra.gmfdiag.assistant/src/org/eclipse/papyrus/infra/gmfdiag/assistant/core/util/ModelingAssistantUtil.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2014, 2015 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.assistant.core.util;
@@ -66,12 +66,12 @@ public class ModelingAssistantUtil {
/**
* Best-effort calculation of the element types matching the given {@code input}.
- *
+ *
* @param provider
* the modeling assistant provider in which context we are calculating element types. Must not be {@code null}
* @param input
* some manifestation of an object being edited, usually either a diagram edit-part, a semantic model element, or an {@link IEditHelperContext}
- *
+ *
* @return the elements, or an empty array if none can be determined (never {@code null})
*/
public static IElementType[] getElementTypes(ModelingAssistantProvider provider, Object input) {
@@ -164,7 +164,7 @@ public class ModelingAssistantUtil {
/**
* Collects all of the concrete subtypes of a given {@code supertype} that are referenced by a modeling assistant {@code provider}.
- *
+ *
* @param supertype
* a possible abstract (or not) element type
* @param provider
@@ -182,7 +182,7 @@ public class ModelingAssistantUtil {
/**
* Queries whether a postulated {@code subtype} is a subtype of its presumptive {@code supertype}.
- *
+ *
* @param subtype
* an element type
* @param supertype
@@ -195,14 +195,14 @@ public class ModelingAssistantUtil {
/**
* Obtains the hinted specializations of an element type in the context of the given {@code provider}.
- *
+ *
* @param supertype
* the element type for which to find hinted specializations
* @param provider
* the provider context
* @param host
* the host context in which the {@code provider} is asked for modeling assistants
- *
+ *
* @return the hinted specializations
*/
public static List<IHintedType> getHintedTypes(IElementType supertype, ModelingAssistantProvider provider, IAdaptable host) {
@@ -240,7 +240,7 @@ public class ModelingAssistantUtil {
/**
* Queries whether an {@code elementType} is a specialization of any of a set of other {@code types}.
- *
+ *
* @param elementType
* an element type
* @param types
@@ -279,33 +279,35 @@ public class ModelingAssistantUtil {
/**
* Determines if the passed hint is a visualID
- * There is now no reliable way for testing if a semantic hint represents a visual id
+ * There is now no reliable way for testing if a semantic hint represents a visual id
+ *
* @param hint
* @return
- * @deprecated This function should not be relied on. Other ways of determining
- * if an element type represents a visual element should be used
+ * @deprecated This function should not be relied on. Other ways of determining
+ * if an element type represents a visual element should be used
*/
+ @Deprecated
public static boolean isVisualID(String hint) {
hint = Strings.nullToEmpty(hint);
return VISUAL_ID_PATTERN.matcher(hint).matches() ||
- hint.contains("Diagram") ||
- hint.contains("Shape") ||
- hint.contains("Edge") ||
- hint.contains("Compartment") ||
+ hint.contains("Diagram") ||
+ hint.contains("Shape") ||
+ hint.contains("Edge") ||
+ hint.contains("Compartment") ||
hint.contains("Label");
}
/**
* Filters a set of connection types for only those that we think we could actually create in the current diagram context and
* sorts them alphabetically.
- *
+ *
* @param provider
* the contextual assistant provider
* @param elementTypes
* connection element types matched in the assistant model
* @param connectionEnd
* the context of the element creation, being one of the edit parts at its ends
- *
+ *
* @return the (possibly) reduced set of connection types that we think we could create, sorted
*/
public static EList<IElementType> filterConnectionTypes(ModelingAssistantProvider provider, Set<IElementType> elementTypes, IAdaptable connectionEnd) {
@@ -345,7 +347,7 @@ public class ModelingAssistantUtil {
if (input instanceof IHintedType) {
String hint = ((IHintedType) input).getSemanticHint();
- if (!Strings.isNullOrEmpty(hint) && CharMatcher.DIGIT.matchesAllOf(hint)) {
+ if (!Strings.isNullOrEmpty(hint) && CharMatcher.digit().matchesAllOf(hint)) {
result = Integer.parseInt(hint);
}
}
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical/src/org/eclipse/papyrus/infra/gmfdiag/canonical/editpolicy/PapyrusCanonicalEditPolicy.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical/src/org/eclipse/papyrus/infra/gmfdiag/canonical/editpolicy/PapyrusCanonicalEditPolicy.java
index e2e81734607..e6cd53fd1e3 100644
--- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical/src/org/eclipse/papyrus/infra/gmfdiag/canonical/editpolicy/PapyrusCanonicalEditPolicy.java
+++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical/src/org/eclipse/papyrus/infra/gmfdiag/canonical/editpolicy/PapyrusCanonicalEditPolicy.java
@@ -79,6 +79,7 @@ import com.google.common.collect.Sets;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
/**
* A specialization of the GMF {@link CanonicalEditPolicy} that alters the standard behaviour in a few key ways:
@@ -485,7 +486,7 @@ public class PapyrusCanonicalEditPolicy extends CanonicalEditPolicy implements I
public void onFailure(Throwable t) {
Activator.log.error(t);
}
- });
+ }, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
}
@@ -599,7 +600,7 @@ public class PapyrusCanonicalEditPolicy extends CanonicalEditPolicy implements I
/**
* As {@link CanonicalEditPolicy#deleteViews(Iterator)}, deletes a list of views.
* The views will be deleted <tt>iff</tt> their semantic element has also been deleted.
- *
+ *
* @param views
* an iterator on a list of views.
* @return <tt>true</tt> if the host editpart should be refreshed; either one one of the supplied
@@ -801,7 +802,7 @@ public class PapyrusCanonicalEditPolicy extends CanonicalEditPolicy implements I
/**
* Queries whether I manage canonical connections. Edit parts such as top shapes and border items manage connections;
* other edit parts such as compartments manage contained views only.
- *
+ *
* @return whether I manage canonical connections
*/
protected boolean isManageConnections() {
@@ -873,12 +874,12 @@ public class PapyrusCanonicalEditPolicy extends CanonicalEditPolicy implements I
/**
* Computes, if necessary, a new ordering of the {@code viewChildren} to match the ordering of the {@code semanticChildren}.
- *
+ *
* @param viewChildren
* the existing view children in the order in which they are currently presented
* @param semanticChildren
* the semantic children that are now presented (we may have already created views for some)
- *
+ *
* @return a new list presenting the {@code viewChildren} in semantic order, or {@code null} if no ordering changes are required
*/
protected List<? extends View> matchCanonicalOrdering(List<? extends View> viewChildren, final List<EObject> semanticChildren) {
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/ui/ControlledUnitLabelDecorator.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/ui/ControlledUnitLabelDecorator.java
index 7cfbc66106e..9e4da02107b 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/ui/ControlledUnitLabelDecorator.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.controlmode/src/org/eclipse/papyrus/infra/services/controlmode/internal/ui/ControlledUnitLabelDecorator.java
@@ -1,6 +1,6 @@
/*****************************************************************************
* Copyright (c) 2016 Christian W. Damus and others.
- *
+ *
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,7 +10,7 @@
*
* Contributors:
* Christian W. Damus - Initial API and implementation
- *
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.services.controlmode.internal.ui;
@@ -39,6 +39,7 @@ import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
/**
* A label decorator for controlled-unit resources in the Project Explorer.
@@ -92,10 +93,10 @@ public class ControlledUnitLabelDecorator extends BaseLabelProvider implements I
// A very coarse-grained label change event
unregisterHandler = ((CrossReferenceIndex) index).onIndexChanged(
__ -> fireLabelProviderChanged(new LabelProviderChangedEvent(this)),
- CoreExecutors.getUIExecutorService());
+ CoreExecutors.getUIExecutorService());
}
}
-
+
private void decorateFile(IFile file, IDecoration decoration) {
ListenableFuture<SubunitKind> futureKind = getSubunitKind(file);
if (futureKind.isDone()) {
@@ -156,7 +157,7 @@ public class ControlledUnitLabelDecorator extends BaseLabelProvider implements I
@SuppressWarnings("unchecked")
ListenableFuture<?> combined = Futures.allAsList(parents, isShard);
- return Futures.transform(combined, kindFunction);
+ return Futures.transform(combined, kindFunction, MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
private Runnable postUpdate(Object element) {
diff --git a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
index a17c0fc38b6..e98bfd784ff 100644
--- a/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
+++ b/plugins/infra/ui/org.eclipse.papyrus.infra.ui/src/org/eclipse/papyrus/infra/ui/util/EditorUtils.java
@@ -58,6 +58,7 @@ import org.eclipse.ui.PlatformUI;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.MoreExecutors;
/**
* Set of utility methods for the CoreEditor. <br>
@@ -734,14 +735,14 @@ public class EditorUtils {
/**
* Resolves the root resource URI from the URI of a resource that may be a
* shard or may be an independent model unit.
- *
+ *
* @param index
* the shard index to consult
* @param resourceURI
* a resource URI
- *
+ *
* @return the root, which may just be the input resource URI if it is a root
- *
+ *
* @see ShardResourceHelper
* @see ICrossReferenceIndex#getRoots(URI)
* @since 1.3
@@ -769,14 +770,14 @@ public class EditorUtils {
/**
* Asynchronously resolves the root resource URI from the URI of a resource that
* may be a shard or may be an independent model unit.
- *
+ *
* @param index
* the shard index to consult
* @param resourceURI
* a resource URI
- *
+ *
* @return the root, which may just be the input resource URI if it is a root
- *
+ *
* @see ShardResourceHelper
* @see ICrossReferenceIndex#getRootsAsync(URI)
* @since 1.3
@@ -784,6 +785,6 @@ public class EditorUtils {
public static ListenableFuture<URI> resolveShardRootAsync(ICrossReferenceIndex index, URI resourceURI) {
// TODO: Handle case of multiple roots
return Futures.transform(index.getRootsAsync(resourceURI),
- (Set<URI> roots) -> Iterables.getFirst(roots, resourceURI));
+ (Set<URI> roots) -> Iterables.getFirst(roots, resourceURI), MoreExecutors.directExecutor()); // Added because of compilation error on the executor-less method call
}
}

Back to the top