use of org.eclipse.gmf.runtime.notation.StringValueStyle in project statecharts by Yakindu.
the class TransitionExpressionEditPart method getAttribute.
public EAttribute getAttribute() {
StringValueStyle featureStyle = GMFNotationUtil.getStringValueStyle(getPrimaryView(), ToggleShowDocumentationCommand.FEATURE_TO_SHOW);
if (featureStyle == null) {
return SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION;
}
String feature = featureStyle.getStringValue();
if (feature.equals(BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION.getName())) {
return BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION;
}
return SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION;
}
use of org.eclipse.gmf.runtime.notation.StringValueStyle in project statecharts by Yakindu.
the class SpecificationElementEditPart method getAttribute.
public EAttribute getAttribute() {
StringValueStyle featureStyle = GMFNotationUtil.getStringValueStyle(getPrimaryView(), FEATURE_TO_SHOW);
if (featureStyle == null) {
return SPECIFICATION_ELEMENT__SPECIFICATION;
}
String feature = featureStyle.getStringValue();
if (feature.equals(DOCUMENTED_ELEMENT__DOCUMENTATION.getName())) {
return DOCUMENTED_ELEMENT__DOCUMENTATION;
}
return SPECIFICATION_ELEMENT__SPECIFICATION;
}
use of org.eclipse.gmf.runtime.notation.StringValueStyle in project statecharts by Yakindu.
the class DocumentationDropDownAction method show.
private void show(List<View> views) {
CompositeCommand command = new CompositeCommand("toggle documentation");
for (View view : views) {
StringValueStyle style = GMFNotationUtil.getStringValueStyle(view, ToggleShowDocumentationCommand.FEATURE_TO_SHOW);
if (style == null) {
style = ToggleShowDocumentationCommand.createInitialStyle(view);
}
command.add(new SetValueCommand(new SetRequest(style, NotationPackage.Literals.STRING_VALUE_STYLE__STRING_VALUE, typeLiteral)));
}
ToggleShowDocumentationCommand.executeCommand(command);
}
use of org.eclipse.gmf.runtime.notation.StringValueStyle in project statecharts by Yakindu.
the class ToggleShowDocumentationCommand method toggleDocumentation.
public static void toggleDocumentation(List<View> views) {
CompositeCommand command = new CompositeCommand("toggle documentation");
for (View view : views) {
StringValueStyle style = GMFNotationUtil.getStringValueStyle(view, FEATURE_TO_SHOW);
if (style == null) {
style = createInitialStyle(view);
}
String featureName = style.getStringValue().equals(SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName()) ? BasePackage.Literals.DOCUMENTED_ELEMENT__DOCUMENTATION.getName() : SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName();
command.add(new SetValueCommand(new SetRequest(style, NotationPackage.Literals.STRING_VALUE_STYLE__STRING_VALUE, featureName)));
}
executeCommand(command);
}
use of org.eclipse.gmf.runtime.notation.StringValueStyle in project statecharts by Yakindu.
the class ToggleShowDocumentationCommand method createInitialStyle.
public static StringValueStyle createInitialStyle(View view) {
StringValueStyle style = NotationFactory.eINSTANCE.createStringValueStyle();
style.setName(FEATURE_TO_SHOW);
style.setStringValue(SGraphPackage.Literals.SPECIFICATION_ELEMENT__SPECIFICATION.getName());
SetValueCommand cmd = new SetValueCommand(new SetRequest(view, NotationPackage.Literals.VIEW__STYLES, style));
executeCommand(cmd);
return style;
}
Aggregations