/** * generated by Xtext */ package org.example.entities.ui.labeling; import com.google.common.base.Objects; import com.google.inject.Inject; import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; import org.eclipse.xtext.xbase.lib.Extension; import org.example.entities.entities.Attribute; import org.example.entities.entities.AttributeType; import org.example.entities.entities.Entity; import org.example.entities.ui.labeling.TypeRepresentation; /** * Provides labels for a EObjects. * * see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#labelProvider */ @SuppressWarnings("all") public class EntitiesLabelProvider extends DefaultEObjectLabelProvider { @Inject public EntitiesLabelProvider(final AdapterFactoryLabelProvider delegate) { super(delegate); } @Inject @Extension private TypeRepresentation _typeRepresentation; public String text(final Attribute a) { String _name = a.getName(); String _xifexpression = null; AttributeType _type = a.getType(); boolean _notEquals = (!Objects.equal(_type, null)); if (_notEquals) { AttributeType _type_1 = a.getType(); String _representation = this._typeRepresentation.representation(_type_1); _xifexpression = (" : " + _representation); } else { _xifexpression = ""; } return (_name + _xifexpression); } public String image(final Entity e) { return "Entity.gif"; } public String image(final Attribute a) { return "Attribute.gif"; } }