Author: elvisisking
Date: 2011-02-25 12:18:48 -0500 (Fri, 25 Feb 2011)
New Revision: 29344
Modified:
branches/jbosstools-3.2.x/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. The "Test" button is only enabled now when all required fields
have a valid input.
jBIDE-8395 Use regular font for URL field description in Modeshape New Server dialog. The
default font, which is used by the rest of the dialog, is now used for the URL.
Modified:
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java
===================================================================
---
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-02-25
17:11:53 UTC (rev 29343)
+++
branches/jbosstools-3.2.x/modeshape/plugins/org.jboss.tools.modeshape.rest/src/org/jboss/tools/modeshape/rest/wizards/ServerPage.java 2011-02-25
17:18:48 UTC (rev 29344)
@@ -13,10 +13,10 @@
import static org.jboss.tools.modeshape.rest.IUiConstants.BLANK_IMAGE;
import static org.jboss.tools.modeshape.rest.IUiConstants.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