Skip to content

Commit

Permalink
[1673] Cosmetic changes to transfer view
Browse files Browse the repository at this point in the history
* Use a darker, less neon green label color
* Ask for filter deactivation when clicking on a tooltip link to a
hidden element

Change-Id: I0a26a6a81a65ef134183f2fb93d9c76a026c77cf
Signed-off-by: Felix Dorner <felix.dorner@gmail.com>
  • Loading branch information
felixdo committed Mar 21, 2018
1 parent a1f194b commit d22dab5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2017, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -19,6 +19,8 @@ public final class FlexibilityColors {
public static final String BG_WARNING = "warningStatusBgColor"; //$NON-NLS-1$
public static final String BG_ERROR = "errorStatusBgColor"; //$NON-NLS-1$

public static final String FG_GREEN = "greenColor"; //$NON-NLS-1$

private static ColorRegistry colorRegistry;

public static ColorRegistry getColorRegistry() {
Expand All @@ -33,6 +35,7 @@ private static void initializeColorRegistry(ColorRegistry registry) {
registry.put(BG_INFO, new RGB(217, 255, 209));
registry.put(BG_WARNING, new RGB(254, 241, 137));
registry.put(BG_ERROR, new RGB(252, 222, 222));
registry.put(FG_GREEN, new RGB(0,128,0));
}


Expand Down
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2017 THALES GLOBAL SERVICES.
* Copyright (c) 2017, 2018 THALES GLOBAL SERVICES.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand Down Expand Up @@ -84,10 +84,8 @@
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
Expand All @@ -97,13 +95,15 @@
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
import org.polarsys.capella.common.flexibility.wizards.ui.FlexibilityColors;
import org.polarsys.capella.common.helpers.EcoreUtil2;
import org.polarsys.capella.common.libraries.IModel;
import org.polarsys.capella.common.libraries.manager.LibraryManager;
import org.polarsys.capella.common.libraries.manager.LibraryManagerExt;
import org.polarsys.capella.core.libraries.model.ICapellaModel;
import org.polarsys.capella.core.model.helpers.move.Stage;
import org.polarsys.capella.core.model.helpers.move.StageListener;
import org.polarsys.capella.core.platform.sirius.ui.navigator.actions.LocateInCapellaExplorerAction;
import org.polarsys.capella.core.platform.sirius.ui.navigator.drop.ExplorerDropAdapterAssistant;

import com.google.common.collect.Lists;
Expand Down Expand Up @@ -381,11 +381,9 @@ public void elementsRemoved(Collection<? extends EObject> elements) {
stageViewer.setFilters(new CollectionTreeFilter(stage.getElements(), false));
tooltipSupport = new ColumnViewerInformationControlToolTipSupport(stageViewer, new DiagnosticDecorator.EditingDomainLocationListener(stage.getEditingDomain(), stageViewer) {
@Override
protected void setSelection(Object object) {
IViewPart view = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView("capella.project.explorer");
if (view != null) {
view.getSite().getSelectionProvider().setSelection(new StructuredSelection(object));
}
protected void setSelection(final Object object) {
MyLocateInCapellaExplorerAction action = new MyLocateInCapellaExplorerAction();
action.selectElementInCapellaExplorer(new StructuredSelection(object));
}
});

Expand Down Expand Up @@ -835,7 +833,7 @@ public Color getForeground(Object object) {
if (stage.hasBackreferences((EObject) object)) {
return Display.getCurrent().getSystemColor(SWT.COLOR_RED);
} else if (stage.getNewParent((EObject) object) != null) {
return Display.getCurrent().getSystemColor(SWT.COLOR_GREEN);
return FlexibilityColors.getColorRegistry().get(FlexibilityColors.FG_GREEN);
}
if (!EcoreUtil.isAncestor(stage.getElements(), (EObject) object)) {
return Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY);
Expand Down Expand Up @@ -903,4 +901,11 @@ public void handleException(Exception e) {
}
}

private static class MyLocateInCapellaExplorerAction extends LocateInCapellaExplorerAction {
@Override
public void selectElementInCapellaExplorer(ISelection selection) {
super.selectElementInCapellaExplorer(selection);
}
}

}

0 comments on commit d22dab5

Please sign in to comment.