/** * generated by Xtext */ package org.example.smalljava.ui.labeling; import com.google.inject.Inject; import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; import org.eclipse.jface.viewers.StyledString; import org.eclipse.xtext.ui.label.DefaultEObjectLabelProvider; import org.example.smalljava.smallJava.SJClass; import org.example.smalljava.smallJava.SJField; import org.example.smalljava.smallJava.SJMethod; import org.example.smalljava.util.SmallJavaModelUtil; /** * Provides labels for a EObjects. * * see http://www.eclipse.org/Xtext/documentation/latest/xtext.html#labelProvider */ @SuppressWarnings("all") public class SmallJavaLabelProvider extends DefaultEObjectLabelProvider { @Inject public SmallJavaLabelProvider(final AdapterFactoryLabelProvider delegate) { super(delegate); } public StyledString text(final SJMethod m) { String _memberAsString = SmallJavaModelUtil.memberAsString(m); StyledString _styledString = new StyledString(_memberAsString); SJClass _type = m.getType(); String _name = _type.getName(); String _plus = (" : " + _name); StyledString _styledString_1 = new StyledString(_plus, StyledString.DECORATIONS_STYLER); return _styledString.append(_styledString_1); } public String image(final SJMethod m) { return "methpub_obj.gif"; } public StyledString text(final SJField f) { String _name = f.getName(); StyledString _styledString = new StyledString(_name); SJClass _type = f.getType(); String _name_1 = _type.getName(); String _plus = (" : " + _name_1); StyledString _styledString_1 = new StyledString(_plus, StyledString.DECORATIONS_STYLER); return _styledString.append(_styledString_1); } public String image(final SJField f) { return "field_public_obj.gif"; } public String image(final SJClass c) { return "sj_class_obj.gif"; } }