Skip to content
Snippets Groups Projects
Commit 39425a97 authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Merge branch '3862' into 'master'

3862

See merge request !180
parents 92500b1b e0e11443
No related branches found
No related tags found
1 merge request!1803862
PresenceConditionProposalProvider.java 0429296a1742618d241a0b5f2e399198b0733651 GREEN
PresenceConditionProposalProvider.java bd67b19e724cfa777611ec7783bd004407a7911c GREEN
PresenceConditionToStringConverter.java 1854a6474cf37deebe8b8b7c5f28c5e45a541bf8 GREEN
StringToPresenceConditionConverter.java 0d64415d229726a077a242c5c1f487f484df477c GREEN
VariabilityViewUtils.java 5846115ef3e0cc828ac6d868c00800146bcfac1c GREEN
......@@ -18,6 +18,7 @@ package org.fortiss.tooling.ext.variability.ui.util;
import static java.util.Arrays.asList;
import static java.util.stream.Collectors.toList;
import static org.fortiss.variability.util.VariabilityUtils.PRESENCE_CONDITIONS_KEYWORDS;
import static org.fortiss.variability.util.VariabilityUtilsInternal.getAllElementsFromSameContainmentTree;
import java.util.List;
......@@ -61,7 +62,8 @@ public class PresenceConditionProposalProvider extends ProposalProviderBase {
List<String> stringLiterals = literals.stream().map(l -> l.getName()).collect(toList());
stringLiterals.addAll(asList("DEFAULT", "NOT", "AND", "OR"));
final String[] keywords = PRESENCE_CONDITIONS_KEYWORDS.split("\\|");
stringLiterals.addAll(asList(keywords));
List<String> proposals =
stringLiterals.stream().filter(n -> n.startsWith(currentWord)).collect(toList());
......
FeatureModelTransformationUtils.java b38702296dcb48ff311b382bb9c05d2590e2dfac GREEN
Pair.java 2dfd7dc65f7b9ba09a120f1a6058d1e8e9556a37 GREEN
VariabilityUtils.java 1d84b70a1f26ee7b9df697fdc96b8e226762cb5d GREEN
VariabilityUtilsInternal.java 43d150214dd32e71f163bece306ad7661c2d5b4a GREEN
VariabilityUtils.java 66a727bdb58715dc7b1bd0ce320bd647f374f7d6 GREEN
VariabilityUtilsInternal.java 9c781a47513bb0c4ddcd13be1c27d62b70f25998 GREEN
......@@ -17,7 +17,6 @@ package org.fortiss.variability.util;
import static java.util.stream.Collectors.toList;
import static org.fortiss.variability.model.VariabilityModelElementFactory.createFeatureConfigurationForFeature;
import static org.fortiss.variability.util.VariabilityUtilsInternal.FEATURE_LITERAL_LEGAL_CHAR_REGEX;
import static org.fortiss.variability.util.VariabilityUtilsInternal.getAllReferences;
import static org.fortiss.variability.util.VariabilityUtilsInternal.getParentsWithType;
......@@ -43,6 +42,17 @@ import org.fortiss.variability.model.presence.PresenceConditionTerm;
* @author bayha
*/
public class VariabilityUtils {
/**
* Regex, describing all legal characters that might be in a feature literal
* name.
*/
public final static String FEATURE_LITERAL_LEGAL_CHAR_REGEX =
"[a-zA-Z\\d\\$&\\[\\]_\\-\\+@/\\\\,\\.=]";
/** Regex, describing all keywords. */
public final static String PRESENCE_CONDITIONS_KEYWORDS = "OR|AND|NOT|DEFAULT";
/**
* Renames the given literal reference and updates the StringReprtesentations of
* the {@link PresenceCondition}s, that use it as a literal.
......@@ -156,8 +166,11 @@ public class VariabilityUtils {
* @return Whether the given name is compatible with the presence condition systax.
*/
public static boolean isNameLegalInPresenceCondition(String literalName) {
if(literalName.matches(PRESENCE_CONDITIONS_KEYWORDS)) {
return false;
}
return literalName.matches(FEATURE_LITERAL_LEGAL_CHAR_REGEX + "*");
// TODO (#3862): Check for keywords.
}
/**
......
......@@ -42,12 +42,6 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
* @author bayha
*/
public class VariabilityUtilsInternal {
/**
* Regex, describing all legal characters, that might be in a feature literal
* name.
*/
public final static String FEATURE_LITERAL_LEGAL_CHAR_REGEX =
"[a-zA-Z\\d\\$&\\[\\]_\\-\\+@/\\\\,\\.=]";
/**
* Retrieves all elements of type T from a containment tree. The 'context' is
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment