Author: elvisisking
Date: 2011-02-25 11:20:55 -0500 (Fri, 25 Feb 2011)
New Revision: 29340
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
Log:
JBIDE-8393 Mode Shape New Server Wizard Test button should be enabled when all required
field is filled. Test button is not enabled unless all required fields have valid (not
necessarily correct) values.
JBIDE-8395 Use regular font for URL field description in Modeshape New Server dialog. URL
field now uses the default font like everything else.
Modified:
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
===================================================================
---
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-02-25
16:13:17 UTC (rev 29339)
+++
trunk/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-02-25
16:20:55 UTC (rev 29340)
@@ -12,11 +12,11 @@
package org.jboss.tools.modeshape.rest.wizards;
import static org.jboss.tools.modeshape.rest.IUiConstants.BLANK_IMAGE;
-import static org.jboss.tools.modeshape.rest.IUiConstants.SERVER_DIALOG_HELP_CONTEXT;
+import static
org.jboss.tools.modeshape.rest.IUiConstants.HelpContexts.SERVER_DIALOG_HELP_CONTEXT;
+
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.BusyIndicator;
@@ -313,7 +313,6 @@
StyledText st = new StyledText(pnl, SWT.READ_ONLY | SWT.MULTI | SWT.NO_FOCUS |
SWT.WRAP);
st.setText(RestClientI18n.serverPageUrlTemplateLabel.text());
st.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
- st.setFont(JFaceResources.getTextFont());
st.setCaret(null);
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, true);
gd.grabExcessVerticalSpace = false;
@@ -466,9 +465,8 @@
// get the current status
validate();
- // update OK/Finish button and test button enablement
+ // update OK/Finish button
setPageComplete(!this.status.isError());
- this.btnTestConnection.setEnabled(isPageComplete());
// update message
if (this.status.isError()) {
@@ -490,6 +488,14 @@
private void validate() {
this.status = Utils.isServerValid(this.url, this.user, this.password);
+ // only enable test connection if URL is valid
+ if (this.status.isError()) {
+ this.btnTestConnection.setEnabled(false);
+ } else {
+ this.btnTestConnection.setEnabled(true);
+ return;
+ }
+
// now check to see if a server is already registered
if (this.status.isOk()) {
Server changedServer = getServer();
Show replies by date