Revision ec99dd06
Added by Andreas Kohlbecker almost 4 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/RemotingLoginDialog.java | ||
---|---|---|
35 | 35 |
import org.eclipse.swt.events.MouseEvent; |
36 | 36 |
import org.eclipse.swt.events.SelectionAdapter; |
37 | 37 |
import org.eclipse.swt.events.SelectionEvent; |
38 |
import org.eclipse.swt.graphics.Color; |
|
38 | 39 |
import org.eclipse.swt.layout.FillLayout; |
39 | 40 |
import org.eclipse.swt.layout.GridData; |
40 | 41 |
import org.eclipse.swt.layout.GridLayout; |
... | ... | |
113 | 114 |
private final static String MESG_UPDATE_SCHEMA_VERSION = Messages.RemotingLoginDialog_MSG_UPDATE_SCHEMA_VERSION; |
114 | 115 |
|
115 | 116 |
private static final int BTN_COLOR_ATTENTION = SWT.COLOR_RED; |
116 |
private static final int BTN_COLOR_DEFAULT = SWT.COLOR_BLACK; |
|
117 | 117 |
|
118 | 118 |
private final static String STORE_PREFERENCES_NODE = "eu.etaxonomy.taxeditor.store"; //$NON-NLS-1$ |
119 | 119 |
|
... | ... | |
960 | 960 |
String instanceStatus = STATUS_NOT_AVAILABLE; |
961 | 961 |
String message = null; |
962 | 962 |
String connect = LABEL_CONNECT; |
963 |
int color = BTN_COLOR_DEFAULT;
|
|
963 |
Integer color = null;
|
|
964 | 964 |
String schemaVersion = CdmMetaData.getDbSchemaVersion(); |
965 | 965 |
|
966 | 966 |
if (!schemaExists(selectedCdmInstance)){ |
... | ... | |
996 | 996 |
setMessage(message); |
997 | 997 |
} |
998 | 998 |
|
999 |
private void setManagedValues(boolean available, String instanceStatus, String connect, int color,
|
|
999 |
private void setManagedValues(boolean available, String instanceStatus, String connect, Integer color,
|
|
1000 | 1000 |
String schemaVersion) { |
1001 | 1001 |
Display.getDefault().syncExec(()->{ |
1002 | 1002 |
btnConnect.setEnabled(available); |
1003 | 1003 |
btnConnect.setText(connect); |
1004 |
btnConnect.setBackground(Display.getCurrent().getSystemColor(color)); |
|
1004 |
Color systemColor = null; |
|
1005 |
if(color != null) { |
|
1006 |
systemColor = Display.getCurrent().getSystemColor(color); |
|
1007 |
} |
|
1008 |
btnConnect.setBackground(systemColor); |
|
1005 | 1009 |
btnConnect.requestLayout(); |
1006 | 1010 |
txtCdmInstanceStatus.setText(instanceStatus); |
1007 | 1011 |
txtServerSchemaVersion.setText(schemaVersion); |
... | ... | |
1253 | 1257 |
setMessage(""); //$NON-NLS-1$ |
1254 | 1258 |
txtServerSchemaVersion.setText(""); //$NON-NLS-1$ |
1255 | 1259 |
btnConnect.setText(LABEL_CONNECT); |
1256 |
btnConnect.setBackground(Display.getCurrent().getSystemColor(BTN_COLOR_DEFAULT));
|
|
1260 |
btnConnect.setBackground(null);
|
|
1257 | 1261 |
btnConnect.requestLayout(); |
1258 | 1262 |
} |
1259 | 1263 |
|
Also available in: Unified diff
ref #9025 fixing button color issue