use of org.yakindu.sct.model.sgen.FeatureParameterValue in project statecharts by Yakindu.
the class CoreLibraryDefaultFeatureValueProvider method validateParameterValue.
public IStatus validateParameterValue(FeatureParameterValue parameterValue) {
String parameterName = parameterValue.getParameter().getName();
if (OUTLET_FEATURE_TARGET_PROJECT.equals(parameterName) && !access.projectExists(parameterValue.getStringValue()))
return error(String.format("The Project %s does not exist.", parameterValue.getStringValue()));
if (OUTLET_FEATURE_TARGET_PROJECT.equals(parameterName) && access.projectExists(parameterValue.getStringValue()) && !access.projectOpened(parameterValue.getStringValue()))
return error(String.format("The Project %s is not open.", parameterValue.getStringValue()));
if (OUTLET_FEATURE_TARGET_FOLDER.equals(parameterName) || OUTLET_FEATURE_LIBRARY_TARGET_FOLDER.equals(parameterName) || OUTLET_FEATURE_API_TARGET_FOLDER.equals(parameterName)) {
FeatureParameterValue targetProjectParam = parameterValue.getFeatureConfiguration().getParameterValue(OUTLET_FEATURE_TARGET_PROJECT);
String targetProjectName = targetProjectParam != null ? targetProjectParam.getStringValue() : null;
if (targetProjectName != null && !access.folderExists(targetProjectName, parameterValue.getStringValue())) {
return warning(String.format("The Folder %s does not exist in Project %s", parameterValue.getStringValue(), targetProjectName));
}
}
return Status.OK_STATUS;
}
use of org.yakindu.sct.model.sgen.FeatureParameterValue in project statecharts by Yakindu.
the class CppCodeGeneratorModule method bindIGenArtifactConfigurations.
protected void bindIGenArtifactConfigurations(GeneratorEntry entry, Binder binder) {
FeatureParameterValue useRelativePathParam = entry.getFeatureParameterValue(FEATURE_INCLUDES, PARAMETER_INCLUDES_USE_RELATIVE_PATHS);
boolean useRelativePath = useRelativePathParam != null ? useRelativePathParam.getBooleanValue() : true;
if (useRelativePath) {
binder.bind(IGenArtifactConfigurations.class).to(DefaultGenArtifactConfigurations.class);
} else {
binder.bind(IGenArtifactConfigurations.class).to(SimpleGenArtifactConfigurations.class);
}
}
use of org.yakindu.sct.model.sgen.FeatureParameterValue in project statecharts by Yakindu.
the class CCodeGeneratorModule method bindTracingProperty.
protected void bindTracingProperty(GeneratorEntry entry, Binder binder) {
FeatureParameterValue traceEnterFeature = entry.getFeatureParameterValue(FEATURE_TRACING, PARAMETER_TRACING_ENTER_STATE);
FeatureParameterValue traceExitFeature = entry.getFeatureParameterValue(FEATURE_TRACING, PARAMETER_TRACING_EXIT_STATE);
boolean traceEnter = traceEnterFeature != null ? traceEnterFeature.getBooleanValue() : false;
boolean traceExit = traceExitFeature != null ? traceEnterFeature.getBooleanValue() : false;
binder.bind(Boolean.class).annotatedWith(Names.named(ADD_TRACES)).toInstance(traceEnter || traceExit);
}
use of org.yakindu.sct.model.sgen.FeatureParameterValue in project statecharts by Yakindu.
the class CCodeGeneratorModule method bindIGenArtifactConfigurations.
protected void bindIGenArtifactConfigurations(GeneratorEntry entry, Binder binder) {
FeatureParameterValue useRelativePathParam = entry.getFeatureParameterValue(FEATURE_INCLUDES, PARAMETER_INCLUDES_USE_RELATIVE_PATHS);
boolean useRelativePath = useRelativePathParam != null ? useRelativePathParam.getBooleanValue() : true;
if (useRelativePath) {
binder.bind(IGenArtifactConfigurations.class).to(DefaultGenArtifactConfigurations.class);
} else {
binder.bind(IGenArtifactConfigurations.class).to(SimpleGenArtifactConfigurations.class);
}
}
use of org.yakindu.sct.model.sgen.FeatureParameterValue in project statecharts by Yakindu.
the class DefaultFileSystemAccessFactory method initLibraryTargetFolder.
protected void initLibraryTargetFolder(ISCTFileSystemAccess access, GeneratorEntry entry) {
FeatureParameterValue libraryTargetFolderValue = helper.getLibraryTargetFolderValue(entry);
if (libraryTargetFolderValue != null) {
access.setOutputPath(LIBRARY_TARGET_FOLDER_OUTPUT, libraryTargetFolderValue.getStringValue());
OutputConfiguration output = access.getOutputConfigurations().get(LIBRARY_TARGET_FOLDER_OUTPUT);
output.setCreateOutputDirectory(true);
output.setCanClearOutputDirectory(false);
output.setOverrideExistingResources(false);
}
}
Aggregations