diff --git a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/GenericAnnotationView.java b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/GenericAnnotationView.java index 731deab8554dfb6c2ed17190a6e10169eb009d04..506c55a273d749aaed1f8f174fa90f8f5f8ed669 100644 --- a/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/GenericAnnotationView.java +++ b/org.fortiss.tooling.base.ui/trunk/src/org/fortiss/tooling/base/ui/annotation/GenericAnnotationView.java @@ -34,11 +34,13 @@ import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TableViewerColumn; import org.eclipse.jface.viewers.TextCellEditor; import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.wb.swt.SWTResourceManager; import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; import org.fortiss.tooling.kernel.extension.data.ITopLevelElement; import org.fortiss.tooling.kernel.model.INamedCommentedElement; @@ -51,7 +53,7 @@ import org.fortiss.tooling.kernel.service.IPersistencyService; * @version $Rev$ * @ConQAT.Rating RED Hash: */ -public class GenericAnnotationView extends AnnotationViewPartBase2 { +public class GenericAnnotationView extends AnnotationViewPartBase { /** mapping of {@link IAnnotatedSpecification} -> TableViewerColumn */ private HashMap<Class<? extends IAnnotatedSpecification>, TableViewerColumn> columns = @@ -86,7 +88,18 @@ public class GenericAnnotationView extends AnnotationViewPartBase2 { modelElementName = modelElementName.replace("Impl", ""); firstColumn.getColumn().setText(modelElementName); return ((INamedCommentedElement)entry.getModelElement()).getName();// toString(); + } + /** {@inheritDoc} */ + @Override + public Color getBackground(Object element) { + if(element instanceof AnnotationEntry<?>) { + AnnotationEntry<?> data = (AnnotationEntry<?>)element; + if(data.getModelElement().equals(getCurrentlySelectedObject())) { + return SWTResourceManager.getColor(0, 255, 0); + } + } + return super.getBackground(element); } }); @@ -294,6 +307,18 @@ public class GenericAnnotationView extends AnnotationViewPartBase2 { return "-"; } + /** {@inheritDoc} */ + @Override + public Color getBackground(Object element) { + if(element instanceof AnnotationEntry<?>) { + AnnotationEntry<?> data = (AnnotationEntry<?>)element; + if(data.getModelElement().equals(getCurrentlySelectedObject())) { + return SWTResourceManager.getColor(0, 255, 0); + } + } + return super.getBackground(element); + } + } /** {@inheritDoc} */ @@ -302,4 +327,11 @@ public class GenericAnnotationView extends AnnotationViewPartBase2 { // nothing to do } + + /** {@inheritDoc} */ + @Override + public void dispose() { + tableViewer.getTable().dispose(); + super.dispose(); + } }