Commit f524d18d authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Added tooltip for feature model

Issue-ref: 4277
Issue-URL: #4277



Signed-off-by: Andreas Bayha's avatarAndreas Bayha <bayha@fortiss.org>
parent 395d2157
......@@ -33,6 +33,7 @@ import org.fortiss.af3.variability.featuremodel.model.CompositionalFeature;
import org.fortiss.af3.variability.featuremodel.model.CrossFeatureConstraint;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableUIProviderBase;
import org.fortiss.tooling.kernel.model.INamedCommentedElement;
import org.fortiss.tooling.kernel.model.INamedElement;
import org.fortiss.tooling.kernel.service.ICommandStackService;
import org.fortiss.tooling.kernel.ui.service.IModelElementHandlerService;
import org.fortiss.variability.model.IHasName;
......@@ -279,4 +280,43 @@ public class FeatureModelFXEditorUIProvider extends DynamicTreeTableUIProviderBa
newValue == null ? EMPTY : new StructuredSelection(newValue);
editor.getSite().getSelectionProvider().setSelection(selection);
}
/** {@inheritDoc} */
@Override
public String getTooltip(IHasName element, int column) {
if(column == COL_IDX_FEATURE_NAME) {
if(element instanceof CompositionalFeature) {
final String parentName = ((INamedElement)element.eContainer()).getName();
if(element.eContainer() instanceof AlternativeFeature) {
return "This is one alternative that can be selected for \"" + parentName +
"\" for the instantiation of the SPL.";
}
String tip = "";
final CompositionalFeature feature = (CompositionalFeature)element;
if(feature.getSubFeatures().size() > 0) {
tip = "This OR feature enables an arbitrary number of optional sub-features to be selected for the instantiation of the SPL. ";
}
if(feature.isOptional()) {
tip += "\nThis feature can optionally be selected for the instantiation of the SPL. ";
} else {
tip += "\nThis feature is mandatroy for all configurations in which the parent feature \"" +
parentName +
"\" is selected. Select \"isOptional\" in the Properties view to make it optional. ";
}
return tip;
}
if(element instanceof AlternativeFeature) {
return "This XOR feature requires to select exactly one sub-feature to be selected for the instantiation of the SPL.";
}
if(element instanceof CrossFeatureConstraint) {
return "This constraint restricts which combination with another feature is a legal selection for the instantiation of the SPL.";
}
}
return super.getTooltip(element, column);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment