Skip to content
Snippets Groups Projects
Commit e7e54954 authored by Simon Barner's avatar Simon Barner
Browse files

- Remove confusion naming heuristic for heading of first column.

  Simply label it "Model Element"
- Likewise, in component filter, use "model element" instead of "component" as filter label
refs 1841
parent 9571ce8c
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,6 @@ $Id$
package org.fortiss.tooling.base.ui.annotation.view;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.graphics.Color;
import org.eclipse.wb.swt.SWTResourceManager;
import org.fortiss.tooling.base.model.element.IModelElement;
......@@ -37,24 +36,19 @@ public class ElementNameLabelProvider extends ColumnLabelProvider {
/** The view part in which this {@link ElementNameLabelProvider} is used. */
private final IAnnotationViewPart viewPart;
/** Column the which a label is provided by this {@link ElementNameLabelProvider}. */
private final TableViewerColumn column;
/** Creates a new {@link ElementNameLabelProvider} for a given {@code column}. */
public ElementNameLabelProvider(IAnnotationViewPart viewPart, TableViewerColumn column) {
public ElementNameLabelProvider(IAnnotationViewPart viewPart) {
this.viewPart = viewPart;
this.column = column;
}
/** {@inheritDoc} */
@Override
public String getText(Object element) {
AnnotationEntry annotationEntry = (AnnotationEntry)element;
IModelElement modelElement = annotationEntry.getModelElement();
if(!(element instanceof AnnotationEntry)) {
return "-";
}
String modelElementName = modelElement.getClass().getSimpleName();
modelElementName = modelElementName.replace("Impl", "");
column.getColumn().setText(modelElementName);
IModelElement modelElement = ((AnnotationEntry)element).getModelElement();
if(modelElement instanceof INamedElement) {
return ((INamedElement)modelElement).getName();
......
......@@ -439,7 +439,7 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
final Button filterComponentNamesButton =
new Button(nameFilterScopeComposite, SWT.RADIO);
filterComponentNamesButton.setText("component");
filterComponentNamesButton.setText("model element");
filterComponentNamesButton.setSelection(true);
view.getAnnotationFilter().setFilterRowName(true);
......@@ -811,11 +811,11 @@ public class GenericAnnotationView extends AnnotationViewPartBase {
protected void createModelElementColumn() {
final TableViewerColumn firstColumn = new TableViewerColumn(tableViewer, SWT.NONE);
firstColumn.getColumn().setText("IModelElement");
firstColumn.getColumn().setText("Model Element");
firstColumn.getColumn().setWidth(100);
tableViewer.setContentProvider(new ArrayContentProvider());
firstColumn.setLabelProvider(new ElementNameLabelProvider(this, firstColumn));
firstColumn.setLabelProvider(new ElementNameLabelProvider(this));
firstColumn.setEditingSupport(new ElementNameEditingSupport(tableViewer));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment