import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
private final static String MESG_UPDATE_SCHEMA_VERSION = Messages.RemotingLoginDialog_MSG_UPDATE_SCHEMA_VERSION;
private static final int BTN_COLOR_ATTENTION = SWT.COLOR_RED;
- private static final int BTN_COLOR_DEFAULT = SWT.COLOR_BLACK;
private final static String STORE_PREFERENCES_NODE = "eu.etaxonomy.taxeditor.store"; //$NON-NLS-1$
String instanceStatus = STATUS_NOT_AVAILABLE;
String message = null;
String connect = LABEL_CONNECT;
- int color = BTN_COLOR_DEFAULT;
+ Integer color = null;
String schemaVersion = CdmMetaData.getDbSchemaVersion();
if (!schemaExists(selectedCdmInstance)){
setMessage(message);
}
- private void setManagedValues(boolean available, String instanceStatus, String connect, int color,
+ private void setManagedValues(boolean available, String instanceStatus, String connect, Integer color,
String schemaVersion) {
Display.getDefault().syncExec(()->{
btnConnect.setEnabled(available);
btnConnect.setText(connect);
- btnConnect.setBackground(Display.getCurrent().getSystemColor(color));
+ Color systemColor = null;
+ if(color != null) {
+ systemColor = Display.getCurrent().getSystemColor(color);
+ }
+ btnConnect.setBackground(systemColor);
btnConnect.requestLayout();
txtCdmInstanceStatus.setText(instanceStatus);
txtServerSchemaVersion.setText(schemaVersion);
setMessage(""); //$NON-NLS-1$
txtServerSchemaVersion.setText(""); //$NON-NLS-1$
btnConnect.setText(LABEL_CONNECT);
- btnConnect.setBackground(Display.getCurrent().getSystemColor(BTN_COLOR_DEFAULT));
+ btnConnect.setBackground(null);
btnConnect.requestLayout();
}