Search in sources :

Example 1 with StringValueStyle

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;
}
Also used : StringValueStyle(org.eclipse.gmf.runtime.notation.StringValueStyle)

Example 2 with StringValueStyle

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;
}
Also used : StringValueStyle(org.eclipse.gmf.runtime.notation.StringValueStyle)

Example 3 with StringValueStyle

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);
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand) StringValueStyle(org.eclipse.gmf.runtime.notation.StringValueStyle) View(org.eclipse.gmf.runtime.notation.View) CompositeCommand(org.eclipse.gmf.runtime.common.core.command.CompositeCommand)

Example 4 with StringValueStyle

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);
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand) StringValueStyle(org.eclipse.gmf.runtime.notation.StringValueStyle) View(org.eclipse.gmf.runtime.notation.View) CompositeCommand(org.eclipse.gmf.runtime.common.core.command.CompositeCommand)

Example 5 with StringValueStyle

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;
}
Also used : SetRequest(org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest) SetValueCommand(org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand) StringValueStyle(org.eclipse.gmf.runtime.notation.StringValueStyle)

Aggregations

StringValueStyle (org.eclipse.gmf.runtime.notation.StringValueStyle)5 SetValueCommand (org.eclipse.gmf.runtime.emf.type.core.commands.SetValueCommand)3 SetRequest (org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest)3 CompositeCommand (org.eclipse.gmf.runtime.common.core.command.CompositeCommand)2 View (org.eclipse.gmf.runtime.notation.View)2