Skip to content

Commit

Permalink
[ui] Colorized into the outline the inherited constructors with the "…
Browse files Browse the repository at this point in the history
…ingerited member" color.

Signed-off-by: Stéphane Galland <galland@arakhne.org>
  • Loading branch information
gallandarakhneorg committed Oct 1, 2019
1 parent ffbb19e commit 189a265
Showing 1 changed file with 17 additions and 0 deletions.
Expand Up @@ -27,7 +27,10 @@
import com.google.common.base.Strings;
import com.google.inject.Inject;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jdt.internal.ui.viewsupport.ColoringLabelProvider;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.StyledString;
import org.eclipse.swt.graphics.Image;
import org.eclipse.xtend.core.xtend.XtendClass;
import org.eclipse.xtend.core.xtend.XtendMember;
Expand Down Expand Up @@ -458,4 +461,18 @@ protected Image _image(XtendMember modelElement) {
return this.diagnoticDecorator.decorateImage(img, modelElement);
}

/** Compute the text for the given JVM constructor, which is usually a inherited constructor.
*
* @param modelElement the model
* @return the text.
*/
protected CharSequence _text(JvmConstructor modelElement) {
if (this.labelProvider instanceof IStyledLabelProvider) {
final StyledString str = ((IStyledLabelProvider) this.labelProvider).getStyledText(modelElement);
str.setStyle(0, str.length(), ColoringLabelProvider.INHERITED_STYLER);
return str;
}
return this.labelProvider.getText(modelElement);
}

}

0 comments on commit 189a265

Please sign in to comment.