Commit 535a617c authored by Andreas Bayha's avatar Andreas Bayha
Browse files

Allocation: AllocationTable adapted to FX Annotations

Minor changes to retrieve background colors for the allocation table
from the new fx implementation of the annotation view.

Issue-Ref: 4014
Issue-Url: https://af3-developer.fortiss.org/issues/4014

Signed-off-by: Andreas Bayha's avatarAndreas Bayha <bayha@fortiss.org>
parent 2eff656f
...@@ -19,8 +19,8 @@ import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.RIG ...@@ -19,8 +19,8 @@ import static org.fortiss.af3.allocation.utils.AllocationModelElementFactory.RIG
import static org.fortiss.af3.allocation.utils.AllocationUtils.getAnnotationEntry; import static org.fortiss.af3.allocation.utils.AllocationUtils.getAnnotationEntry;
import static org.fortiss.af3.allocation.utils.AllocationUtils.getParameterEntryName; import static org.fortiss.af3.allocation.utils.AllocationUtils.getParameterEntryName;
import static org.fortiss.af3.allocation.utils.AllocationUtils.getParameterEntryValue; import static org.fortiss.af3.allocation.utils.AllocationUtils.getParameterEntryValue;
import static org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider.READ_ONLY_ANNOTATION_BACKGROUND_COLOR; import static org.fortiss.tooling.base.ui.annotation.view.fx.AnnotationsFXUtils.READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR_SWT;
import static org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider.getAnnotatationBackgroundColor; import static org.fortiss.tooling.base.ui.annotation.view.fx.AnnotationsFXUtils.getSWTBackgroundColorForEntry;
import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
...@@ -141,13 +141,13 @@ public class ParameterEntryTreeViewerLabelProvider<T extends ParameterTable> ...@@ -141,13 +141,13 @@ public class ParameterEntryTreeViewerLabelProvider<T extends ParameterTable>
Color color = super.getBackground(object); Color color = super.getBackground(object);
if(annotationEntry != null) { if(annotationEntry != null) {
return getAnnotatationBackgroundColor(annotationEntry, annotationType, color); return getSWTBackgroundColorForEntry(annotationEntry, annotationType, color);
} }
// Fall back to default color in case annotation entry does not exist yet, but the // Fall back to default color in case annotation entry does not exist yet, but the
// element is "applicable" for the underlying parameter. // element is "applicable" for the underlying parameter.
return color; return color;
} }
return READ_ONLY_ANNOTATION_BACKGROUND_COLOR; return READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR_SWT;
} }
} }
...@@ -17,7 +17,8 @@ package org.fortiss.af3.allocation.ui.editor.treeviewer; ...@@ -17,7 +17,8 @@ package org.fortiss.af3.allocation.ui.editor.treeviewer;
import static org.fortiss.af3.allocation.ui.editor.treeviewer.ParameterTableTreeViewerManager.getAnnotationName; import static org.fortiss.af3.allocation.ui.editor.treeviewer.ParameterTableTreeViewerManager.getAnnotationName;
import static org.fortiss.af3.allocation.ui.editor.treeviewer.ParameterTableTreeViewerManager.getAnnotationType; import static org.fortiss.af3.allocation.ui.editor.treeviewer.ParameterTableTreeViewerManager.getAnnotationType;
import static org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider.getAnnotatationBackgroundColor; import static org.fortiss.tooling.base.ui.annotation.view.fx.AnnotationsFXUtils.READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR_SWT;
import static org.fortiss.tooling.base.ui.annotation.view.fx.AnnotationsFXUtils.getSWTBackgroundColorForEntry;
import org.eclipse.jface.viewers.ColumnLabelProvider; import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
...@@ -27,7 +28,6 @@ import org.fortiss.tooling.base.annotation.AnnotationEntry; ...@@ -27,7 +28,6 @@ import org.fortiss.tooling.base.annotation.AnnotationEntry;
import org.fortiss.tooling.base.annotation.IAnnotationValueService; import org.fortiss.tooling.base.annotation.IAnnotationValueService;
import org.fortiss.tooling.base.model.element.IAnnotatedSpecification; import org.fortiss.tooling.base.model.element.IAnnotatedSpecification;
import org.fortiss.tooling.base.model.element.IModelElement; import org.fortiss.tooling.base.model.element.IModelElement;
import org.fortiss.tooling.base.ui.annotation.labelprovider.AnnotationLabelProvider;
import org.fortiss.tooling.kernel.ui.util.KernelUIUtils; import org.fortiss.tooling.kernel.ui.util.KernelUIUtils;
/** /**
...@@ -95,10 +95,10 @@ public class ParameterSourceElementTreeViewerLabelProvider extends ColumnLabelPr ...@@ -95,10 +95,10 @@ public class ParameterSourceElementTreeViewerLabelProvider extends ColumnLabelPr
AnnotationEntry annotationEntry = AnnotationEntry annotationEntry =
IAnnotationValueService.getInstance().getAnnotationEntry((IModelElement)object); IAnnotationValueService.getInstance().getAnnotationEntry((IModelElement)object);
return getAnnotatationBackgroundColor(annotationEntry, annotationType, color); return getSWTBackgroundColorForEntry(annotationEntry, annotationType, color);
} }
return AnnotationLabelProvider.READ_ONLY_ANNOTATION_BACKGROUND_COLOR; return READ_ONLY_EMPTY_ANNOTATION_BACKGROUND_COLOR_SWT;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
......
...@@ -74,5 +74,6 @@ Require-Bundle: org.fortiss.af3.project;visibility:=reexport, ...@@ -74,5 +74,6 @@ Require-Bundle: org.fortiss.af3.project;visibility:=reexport,
org.fortiss.af3.safety;visibility:=reexport, org.fortiss.af3.safety;visibility:=reexport,
com.google.guava;visibility:=reexport, com.google.guava;visibility:=reexport,
org.fortiss.af3.mira;visibility:=reexport, org.fortiss.af3.mira;visibility:=reexport,
org.json;visibility:=reexport org.json;visibility:=reexport,
org.fortiss.af3.cosimulation.ui;visibility:=reexport
Import-Package: com.google.common.collect Import-Package: com.google.common.collect
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment