protected Declaration handleStyleFeature(Style style, EStructuralFeature feature) { Declaration declaration = CssFactory.eINSTANCE.createDeclaration(); declaration.setProperty(feature.getName()); GMFToCSSConverter converter = GMFToCSSConverter.instance; if (isString(feature)) { declaration.setExpression(converter.convert((String) style.eGet(feature))); } if (isInteger(feature)) { if (feature.getName().endsWith("Color")) { Color color = FigureUtilities.integerToColor((Integer) style.eGet(feature)); declaration.setExpression(converter.convert(color)); color.dispose(); } else { declaration.setExpression(converter.convert((Integer) style.eGet(feature))); } } if (feature.getEType() == NotationPackage.eINSTANCE.getGradientData()) { declaration.setExpression(converter.convert((GradientData) style.eGet(feature))); } if (feature.getEType() instanceof EEnum) { declaration.setExpression(converter.convert((Enumerator) style.eGet(feature))); } if (isBoolean(feature)) { declaration.setExpression(converter.convert((Boolean) style.eGet(feature))); } return declaration; }
protected void handleCustomStyle( View view, String cssProperty, String eAnnotationName, Map<Declaration, Boolean> result, Expression value) { Declaration cssDeclaration = CssFactory.eINSTANCE.createDeclaration(); cssDeclaration.setProperty(cssProperty); cssDeclaration.setExpression(value); boolean check = view.getEAnnotation(eAnnotationName) != null; result.put(cssDeclaration, check); }