Skip to content

Commit

Permalink
Issue OpenLiberty#243: fix grey colour for implicit features in confi…
Browse files Browse the repository at this point in the history
…g editor
  • Loading branch information
eharris369 committed Sep 14, 2018
1 parent 1ccdcdd commit 5e68a54
Showing 1 changed file with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*******************************************************************************
* Copyright (c) 2012, 2016 IBM Corporation and others.
* Copyright (c) 2012, 2018 IBM Corporation and others.
* 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
* IBM Corporation - initial API and implementation
*******************************************************************************/
package com.ibm.ws.st.ui.internal.config;

Expand Down Expand Up @@ -69,6 +69,7 @@ public class FeatureCustomObject extends BaseCustomObject {
protected static final String PREFERENCES_IMPLICIT_FEATURES = "ImplicitFeatures";

protected WebSphereRuntime wsRuntime;
protected Color gray;

/** {@inheritDoc} */
@Override
Expand Down Expand Up @@ -126,6 +127,16 @@ public void createCustomControl(final Element input, String itemName, Composite
data.verticalSpan = 2;
featureTable.setLayoutData(data);

Color bg = featureTable.getBackground();
Color fg = featureTable.getForeground();
gray = new Color(bg.getDevice(), (bg.getRed() + fg.getRed()) / 2, (bg.getGreen() + fg.getGreen()) / 2, (bg.getBlue() + fg.getBlue()) / 2);
featureTable.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent event) {
gray.dispose();
}
});

FeatureUI.createColumns(featureTable);

createItems(featureTable, featureMap.keySet(), showImplicit);
Expand Down Expand Up @@ -334,7 +345,6 @@ protected void createItems(Table table, Set<String> features, boolean showImplic
Collections.sort(featureList);
table.removeAll();

Color gray = table.getShell().getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY);
for (String feature : featureList) {
TableItem item = new TableItem(table, SWT.NONE);
item.setText(0, feature);
Expand Down

0 comments on commit 5e68a54

Please sign in to comment.