Skip to content
Snippets Groups Projects
Commit a4121e00 authored by Johannes Eder's avatar Johannes Eder
Browse files

colouring of selected objects

refs 1841
parent fc74f670
No related branches found
No related tags found
No related merge requests found
......@@ -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();
}
}
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