Skip to content

Commit 974edb3

Browse files
committed
Support Case Sensitive and Insensitive fragments by adding a new marker
interface EClass ICaseSensitiveNamedElemnt. By default, when selecting the fragments, it is considered that the fragment is case insensitive unless the EClass inherits from the new marker interface. Change-Id: I81cd2654089d0a320a5632d2f7054b6cd5a84c46
1 parent 09755ed commit 974edb3

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

com.avaloq.tools.ddk.typesystem/plugin.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ _UI_Procedure_eparameters_feature = Eparameters
3434
_UI_OverrideDeclaration_type = Override Declaration
3535
_UI_ICallable_type = ICallable
3636
_UI_Callable_type = Callable
37+
_UI_ICaseSensitiveNamedElement_type = ICase Sensitive Named Element

com.avaloq.tools.ddk.xtext/src/com/avaloq/tools/ddk/xtext/resource/AbstractSelectorFragmentProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*******************************************************************************/
1111
package com.avaloq.tools.ddk.xtext.resource;
1212

13-
import java.util.concurrent.ConcurrentMap;
13+
import java.util.Map;
1414

1515
import org.eclipse.emf.common.util.EList;
1616
import org.eclipse.emf.ecore.EClass;
@@ -42,7 +42,7 @@ public abstract class AbstractSelectorFragmentProvider extends AbstractFragmentP
4242
@Inject
4343
private ShortFragmentProvider shortFragmentProvider;
4444

45-
private final ConcurrentMap<Object, Object> eclassToCaseSensitive = Maps.newConcurrentMap();
45+
private final Map<Object, Object> eClassToCaseSensitive = Maps.newHashMap();
4646

4747
/**
4848
* Computes a segment of the fragment with a selector for the given object and appends it to the given {@link StringBuilder}.
@@ -125,7 +125,7 @@ public boolean appendFragmentSegment(final EObject object, final StringBuilder b
125125
}
126126

127127
private Boolean isCaseSensitive(final EClass eClass) {
128-
return (Boolean) eclassToCaseSensitive.computeIfAbsent(eClass, k -> eClass.getEAllSuperTypes().stream().map(EClass::getName).anyMatch(n -> "ICaseSensitiveNamedElement".equals(n))); //$NON-NLS-1$
128+
return (Boolean) eClassToCaseSensitive.computeIfAbsent(eClass, k -> eClass.getEAllSuperTypes().stream().map(EClass::getName).anyMatch(n -> "ICaseSensitiveNamedElement".equals(n))); //$NON-NLS-1$
129129
}
130130

131131
/** {@inheritDoc} */

0 commit comments

Comments
 (0)