JBoss Tools SVN: r25711 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-11 08:21:36 -0400 (Mon, 11 Oct 2010)
New Revision: 25711
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7282] [JBIDE-7283] [JBIDE-7284] (switched to databinding), added decorations, added wizard messages, implementing complete validation/enablement handling.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-11 12:09:04 UTC (rev 25710)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-11 12:21:36 UTC (rev 25711)
@@ -1,3 +1,8 @@
+2010-10-11 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java : added decorations, (switched to databinding) corrected page validity, added wizard messages
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Added new messages.
+
2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java: New file.
14 years, 3 months
JBoss Tools SVN: r25710 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-11 08:09:04 -0400 (Mon, 11 Oct 2010)
New Revision: 25710
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-7282] [JBIDE-7283] [JBIDE-7284] added connection test messages/decorations
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2010-10-11 10:21:15 UTC (rev 25709)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2010-10-11 12:09:04 UTC (rev 25710)
@@ -17,6 +17,7 @@
org.eclipse.core.databinding;bundle-version="1.3.100",
org.eclipse.core.databinding.observable;bundle-version="1.3.0",
org.eclipse.core.databinding.property;bundle-version="1.3.0",
- org.eclipse.core.databinding.beans;bundle-version="1.2.100"
+ org.eclipse.core.databinding.beans;bundle-version="1.2.100",
+ org.jboss.tools.common;bundle-version="3.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 10:21:15 UTC (rev 25709)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 12:09:04 UTC (rev 25710)
@@ -11,21 +11,23 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
import java.net.URL;
-import java.text.MessageFormat;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
import org.eclipse.core.databinding.beans.BeanProperties;
+import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.ISWTObservableValue;
import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.databinding.wizard.WizardPageSupport;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.fieldassist.ControlDecoration;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
@@ -48,6 +50,7 @@
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.deltacloud.ui.common.databinding.validator.CompositeValidator;
import org.jboss.tools.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
+import org.jboss.tools.deltacloud.ui.common.swt.JFaceUtils;
public class CloudConnectionPage extends WizardPage {
@@ -70,10 +73,10 @@
private String defaultUsername = ""; //$NON-NLS-1$
private String defaultPassword = ""; //$NON-NLS-1$
private String defaultType = ""; //$NON-NLS-1$
-
+
private CloudConnectionModel connectionModel;
private CloudConnection cloudConnection;
-
+
private Listener linkListener = new Listener() {
public void handleEvent(Event event) {
@@ -82,7 +85,8 @@
URL url = new URL(urlString);
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(url);
} catch (Exception e) {
- LogHelper.logError(Activator.getDefault(), WizardMessages.getFormattedString(COULD_NOT_OPEN_BROWSER, urlString), e);
+ LogHelper.logError(Activator.getDefault(),
+ WizardMessages.getFormattedString(COULD_NOT_OPEN_BROWSER, urlString), e);
}
}
};
@@ -113,10 +117,6 @@
setPageComplete(false);
}
- public CloudConnectionModel getModel() {
- return connectionModel;
- }
-
@Override
public void createControl(Composite parent) {
DataBindingContext dbc = new DataBindingContext();
@@ -146,7 +146,7 @@
dbc.bindValue(
WidgetProperties.text(SWT.Modify).observeDelayed(500, urlText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_URL)
- .observe(connectionModel));
+ .observe(connectionModel));
// cloud type
Label typeLabel = new Label(container, SWT.NULL);
@@ -159,13 +159,13 @@
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
- DataBindingContext credentialsDbc = new DataBindingContext();
-
// username
Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
usernameText.setText(defaultUsername);
- credentialsDbc.bindValue(
- WidgetProperties.text(SWT.Modify).observe(usernameText),
+ ControlDecoration usernameDecoration = JFaceUtils.createDecoration(usernameText, TEST_FAILURE);
+ IObservableValue usernameObservable = WidgetProperties.text(SWT.Modify).observe(usernameText);
+ dbc.bindValue(
+ usernameObservable,
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_USERNAME).observe(
connectionModel));
@@ -174,16 +174,24 @@
passwordLabel.setText(WizardMessages.getString(PASSWORD_LABEL));
Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD | SWT.SINGLE);
passwordText.setText(defaultPassword);
- credentialsDbc.bindValue(
- WidgetProperties.text(SWT.Modify).observe(passwordText),
+ ControlDecoration passwordDecoration = JFaceUtils.createDecoration(passwordText, TEST_FAILURE);
+ ISWTObservableValue passwordTextObservable = WidgetProperties.text(SWT.Modify).observe(passwordText);
+ dbc.bindValue(
+ passwordTextObservable,
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_PASSWORD).observe(
connectionModel));
// test button
final Button testButton = new Button(container, SWT.NULL);
testButton.setText(WizardMessages.getString(TESTBUTTON_LABEL));
testButton.setEnabled(false);
- bindTestButton(urlBinding, testButton);
+ urlBinding.getValidationStatus().addValueChangeListener(enableButtonOnUrlValidityChanges(testButton));
+ CredentialsTestAdapter credentialsTestAdapter = new CredentialsTestAdapter(usernameDecoration,
+ passwordDecoration);
+ testButton.addSelectionListener(credentialsTestAdapter);
+ usernameObservable.addValueChangeListener(credentialsTestAdapter);
+ passwordTextObservable.addValueChangeListener(credentialsTestAdapter);
+
// ec2 user link
Link ec2userLink = new Link(container, SWT.NULL);
ec2userLink.setText(WizardMessages.getString(EC2_USER_INFO));
@@ -272,40 +280,35 @@
ec2pwLink.setLayoutData(f);
setControl(container);
- // validate();
}
- private void bindTestButton(Binding urlBinding, final Button testButton) {
- urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+ /**
+ * Enables/Disables credentials test button on url validity changes.
+ *
+ * @param testButton
+ * the test button
+ * @return the i value change listener
+ */
+ private IValueChangeListener enableButtonOnUrlValidityChanges(final Button testButton) {
+ return new IValueChangeListener() {
@Override
public void handleValueChange(ValueChangeEvent event) {
IStatus status = (IStatus) event.diff.getNewValue();
testButton.setEnabled(status.isOK());
}
- });
-
- testButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent event) {
- boolean successful = cloudConnection.performTest();
- if (successful) {
- setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
- } else {
- setErrorMessage(WizardMessages.getString(TEST_FAILURE));
- }
- }
- });
+ };
}
- private Binding bindCloudTypeLabel(DataBindingContext dbc, Text urlText, final Label typeLabel,
- UpdateValueStrategy url2TypeStrategy) {
- Binding urlBinding = dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observeDelayed(100, urlText),
- BeanProperties.value(CloudConnectionModel.PROPERTY_TYPE).observe(connectionModel),
- url2TypeStrategy,
- new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
- urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+ /**
+ * Displays the cloud type in the given if the given binding is valid.
+ *
+ * @param typeLabel
+ * the type label
+ * @return the value change listener
+ */
+ private IValueChangeListener displayCloudTypeOnUrlValidityChanges(final Label typeLabel) {
+ return new IValueChangeListener() {
@Override
public void handleValueChange(ValueChangeEvent event) {
@@ -316,7 +319,17 @@
typeLabel.setText("");
}
}
- });
+ };
+ }
+
+ private Binding bindCloudTypeLabel(DataBindingContext dbc, Text urlText, final Label typeLabel,
+ UpdateValueStrategy url2TypeStrategy) {
+ Binding urlBinding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observeDelayed(100, urlText),
+ BeanProperties.value(CloudConnectionModel.PROPERTY_TYPE).observe(connectionModel),
+ url2TypeStrategy,
+ new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
+ urlBinding.getValidationStatus().addValueChangeListener(displayCloudTypeOnUrlValidityChanges(typeLabel));
ControlDecorationSupport.create(urlBinding, SWT.LEFT | SWT.TOP);
return urlBinding;
}
@@ -333,7 +346,8 @@
@Override
public IStatus validate(Object value) {
- if (nameText.getText() != null && DeltaCloudManager.getDefault().findCloud(nameText.getText()) != null) {
+ if (nameText.getText() != null
+ && DeltaCloudManager.getDefault().findCloud(nameText.getText()) != null) {
return ValidationStatus.error(NAME_ALREADY_IN_USE);
} else {
return ValidationStatus.ok();
@@ -343,4 +357,52 @@
null);
ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
}
+
+ public CloudConnectionModel getModel() {
+ return connectionModel;
+ }
+
+ private class CredentialsTestAdapter extends SelectionAdapter implements IValueChangeListener {
+
+ private ControlDecoration[] controlDecorations;
+
+ public CredentialsTestAdapter(ControlDecoration... controlDecorations) {
+ this.controlDecorations = controlDecorations;
+ setDecorations(false);
+ }
+
+ public void widgetSelected(SelectionEvent event) {
+ boolean success = cloudConnection.performTest();
+ setMessage(success);
+ setDecorations(!success);
+ }
+
+ private void setMessage(boolean success) {
+ if (success) {
+ CloudConnectionPage.this.setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
+ } else {
+ CloudConnectionPage.this.setErrorMessage(WizardMessages.getString(TEST_FAILURE));
+ }
+ }
+
+ private void clearMessage() {
+ CloudConnectionPage.this.setMessage(""); //$NON-NLS-1$
+ }
+
+ private void setDecorations(boolean visible) {
+ for (ControlDecoration controlDecoration : controlDecorations) {
+ if (visible) {
+ controlDecoration.show();
+ } else {
+ controlDecoration.hide();
+ }
+ }
+ }
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ setDecorations(false);
+ clearMessage();
+ }
+ }
}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java 2010-10-11 12:09:04 UTC (rev 25710)
@@ -0,0 +1,131 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class CloudType {
+
+ private static final String HTTPHEADER_KEY_ACCEPT = "Accept"; //$NON-NLS-1$
+ private static final String HTTPHEADER_VALUE_ACCEPTXML = "application/xml;q=1.0"; //$NON-NLS-1$
+ private static final String DOCUMENT_ELEMENT_DRIVER = "driver"; //$NON-NLS-1$
+ private static final String DOCUMENT_ELEMENT_API = "api"; //$NON-NLS-1$
+ private static final String URLCONNECTION_ENCODING = "UTF-8"; //$NON-NLS-1$
+
+ public static final String UNKNOWN_TYPE_LABEL = "UnknownType.label"; //$NON-NLS-1$
+ private static final String INVALID_URL = "ErrorInvalidURL.text"; //$NON-NLS-1$
+ static final String NONCLOUD_URL = "ErrorNonCloudURL.text"; //$NON-NLS-1$
+
+ private String label = WizardMessages.getString(UNKNOWN_TYPE_LABEL);
+ private boolean isValid;
+ private String url;
+
+ public CloudType(String url) {
+ init(url);
+ }
+
+ /**
+ * Initializes this instance, sets the cloud type label and the validity. It
+ * tries to connect to the cloud instance that's supposed at the given url,
+ * requests an API response and parses the xml that's returned.
+ *
+ * @param url
+ * the cloud instance url to connect to
+ */
+ private void init(String url) {
+ this.url = url;
+ try {
+ Object o = getURLContent(url + "/api?format=xml"); //$NON-NLS-1$
+ if (o instanceof InputStream) {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document document = db.parse(
+ new InputSource(new StringReader(getXML((InputStream) o))));
+
+ NodeList elements = document.getElementsByTagName(DOCUMENT_ELEMENT_API); //$NON-NLS-1$
+ if (elements.getLength() > 0) {
+ Node n = elements.item(0);
+ Node driver = n.getAttributes().getNamedItem(
+ DOCUMENT_ELEMENT_DRIVER); //$NON-NLS-1$
+ if (driver != null) {
+ isValid = true;
+ String driverValue = driver.getNodeValue();
+ label = driverValue.toUpperCase();
+ }
+ }
+ }
+ } catch (MalformedURLException e) {
+ label = WizardMessages.getString(INVALID_URL);
+ } catch (IOException e) {
+ label = WizardMessages.getString(NONCLOUD_URL);
+ } catch (ParserConfigurationException e) {
+ label = WizardMessages.getString(NONCLOUD_URL);
+ } catch (SAXException e) {
+ label = WizardMessages.getString(NONCLOUD_URL);
+ } catch (Exception e) {
+ label = WizardMessages.getString(INVALID_URL);
+ }
+ }
+
+ private String getXML(InputStream is) throws UnsupportedEncodingException, IOException {
+ try {
+ if (is == null) {
+ return "";
+ }
+ StringBuilder sb = new StringBuilder();
+ String line = "";
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is, URLCONNECTION_ENCODING));
+ while ((line = reader.readLine()) != null) {
+ sb.append(line).append("\n"); //$NON-NLS-1$
+ }
+ return sb.toString();
+ } finally {
+ is.close();
+ }
+ }
+
+ public boolean isValid() {
+ return isValid;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ private Object getURLContent(String url) throws IOException {
+ URL u = new URL(url);
+ URLConnection connection = u.openConnection();
+ connection.setRequestProperty(HTTPHEADER_KEY_ACCEPT, HTTPHEADER_VALUE_ACCEPTXML); //$NON-NLS-1$ $NON-NLS-2$
+ return connection.getContent();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-11 10:21:15 UTC (rev 25709)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-11 12:09:04 UTC (rev 25710)
@@ -63,6 +63,7 @@
EC2PasswordLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access Secret Key</a>
ErrorNameInUse.text=Error: the name chosen is already in use
+ErrorCouldNotOpenBrowser.text="Could not open url \"{0}\"in Browser";
ErrorInvalidURL.text=URL specified is invalid
ErrorNonCloudURL.text=URL specified is not a valid Delta-cloud address
ErrorInvalidPem.text=File specified is not a valid existing key
@@ -79,7 +80,7 @@
ImageFilter.title=Image Filter
ImageFilter.name=Image Filter
-ImageFilter.label=Show all images which match the following rules (* = wildcard):
+ImageFilter.label=Show all images which match the following rules (* \= wildcard)\:
ErrorFilterEmptyRule.msg=Rules cannot be empty strings
ErrorFilterSemicolon.msg=Rules cannot contain a semi-colon character
ErrorFieldError.msg={0} {1}
@@ -87,7 +88,7 @@
InstanceFilter.desc=Specify rules to determine which Instances will appear in the dialog.
InstanceFilter.title=Instance Filter
InstanceFilter.name=Instance Filter
-InstanceFilter.label=Show all instances which match the following rules (* = wildcard):
+InstanceFilter.label=Show all instances which match the following rules (* \= wildcard)\:
ErrorInvalidDirectory.text=Specified directory is not a valid existing directory
Directory.label=Directory
14 years, 3 months
JBoss Tools SVN: r25709 - trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-11 06:21:15 -0400 (Mon, 11 Oct 2010)
New Revision: 25709
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
Log:
https://jira.jboss.org/browse/JBIDE-7264
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2010-10-11 09:29:01 UTC (rev 25708)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/JSF2CCAttrsELCompletionEngine.java 2010-10-11 10:21:15 UTC (rev 25709)
@@ -106,7 +106,7 @@
static String COMPOSITE_URI = "http://java.sun.com/jsf/composite";
static ELResolution EMPTY_RESOLUTION = new ELResolution() {
public List<ELSegment> getSegments() {
- return null;
+ return Collections.emptyList();
}
public ELExpression getSourceOperand() {
return null;
14 years, 3 months
JBoss Tools SVN: r25708 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-11 05:29:01 -0400 (Mon, 11 Oct 2010)
New Revision: 25708
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
Log:
[JBIDE-7282] [JBIDE-7283] [JBIDE-7284] added proper logging to browser launching
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 09:02:28 UTC (rev 25707)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 09:29:01 UTC (rev 25708)
@@ -11,6 +11,7 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
import java.net.URL;
+import java.text.MessageFormat;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
@@ -41,6 +42,7 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.common.log.LogHelper;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
@@ -59,48 +61,52 @@
private static final String EC2_USER_INFO = "EC2UserNameLink.text"; //$NON-NLS-1$
private static final String EC2_PASSWORD_INFO = "EC2PasswordLink.text"; //$NON-NLS-1$
private static final String NAME_ALREADY_IN_USE = "ErrorNameInUse.text"; //$NON-NLS-1$
-
+ private static final String COULD_NOT_OPEN_BROWSER = "ErrorCouldNotOpenBrowser.text"; //$NON-NLS-1$
private static final String TEST_SUCCESSFUL = "NewCloudConnectionTest.success"; //$NON-NLS-1$
private static final String TEST_FAILURE = "NewCloudConnectionTest.failure"; //$NON-NLS-1$
- private String defaultName = "";
- private String defaultUrl = "";
- private String defaultUsername = "";
- private String defaultPassword = "";
- private String defaultType = "";
+ private String defaultName = ""; //$NON-NLS-1$
+ private String defaultUrl = ""; //$NON-NLS-1$
+ private String defaultUsername = ""; //$NON-NLS-1$
+ private String defaultPassword = ""; //$NON-NLS-1$
+ private String defaultType = ""; //$NON-NLS-1$
private CloudConnectionModel connectionModel;
-
+ private CloudConnection cloudConnection;
+
private Listener linkListener = new Listener() {
public void handleEvent(Event event) {
+ String urlString = event.text;
try {
- URL url = new URL(event.text);
+ URL url = new URL(urlString);
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(url);
} catch (Exception e) {
- Activator.log(e);
+ LogHelper.logError(Activator.getDefault(), WizardMessages.getFormattedString(COULD_NOT_OPEN_BROWSER, urlString), e);
}
}
};
- public CloudConnectionPage(String pageName, CloudConnection wizard) {
+ public CloudConnectionPage(String pageName, CloudConnection cloudConnection) {
super(pageName);
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
this.connectionModel = new CloudConnectionModel();
+ this.cloudConnection = cloudConnection;
}
public CloudConnectionPage(String pageName, String defaultName, String defaultUrl,
String defaultUsername, String defaultPassword, String defaultType,
- CloudConnection wizard) {
+ CloudConnection cloudConnection) {
super(pageName);
this.defaultName = defaultName;
this.defaultUrl = defaultUrl;
this.defaultUsername = defaultUsername;
this.defaultPassword = defaultPassword;
+ this.defaultType = defaultType;
this.connectionModel = new CloudConnectionModel();
- this.defaultType = defaultType;
+ this.cloudConnection = cloudConnection;
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
@@ -282,15 +288,12 @@
testButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
- // boolean successful = false;
- // if (getURLValid()) {
- // successful = wizard.performTest();
- // }
- // if (successful) {
- // setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
- // } else {
- // setErrorMessage(WizardMessages.getString(TEST_FAILURE));
- // }
+ boolean successful = cloudConnection.performTest();
+ if (successful) {
+ setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
+ } else {
+ setErrorMessage(WizardMessages.getString(TEST_FAILURE));
+ }
}
});
}
14 years, 3 months
JBoss Tools SVN: r25707 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-10-11 05:02:28 -0400 (Mon, 11 Oct 2010)
New Revision: 25707
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
Log:
[JBIDE-7282] [JBIDE-7283] [JBIDE-7284] implementing complete validation/enablement handling. Added default texts, added "name already exists" validation. Connection credentials test to be done (imminent)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java 2010-10-11 08:25:24 UTC (rev 25706)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionModel.java 2010-10-11 09:02:28 UTC (rev 25707)
@@ -19,8 +19,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -30,12 +28,7 @@
import org.eclipse.core.databinding.validation.IValidator;
import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.Job;
import org.jboss.tools.deltacloud.ui.common.databinding.ObservablePojo;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
@@ -49,7 +42,7 @@
public static final String PROPERTY_NAME = "name";
public static final String PROPERTY_PASSWORD = "password";
public static final String PROPERTY_USERNAME = "username";
- public static final String PROPERTY_CLOUDTYPE = "cloudType";
+ public static final String PROPERTY_TYPE = "type";
public static final String UNKNOWN_TYPE_LABEL = "UnknownType.label"; //$NON-NLS-1$
public static final String INVALID_URL = "ErrorInvalidURL.text"; //$NON-NLS-1$
@@ -95,11 +88,10 @@
Document document = db.parse(
new InputSource(new StringReader(getXML((InputStream) o))));
- NodeList elements = document.getElementsByTagName(DOCUMENT_ELEMENT_API); //$NON-NLS-1$
+ NodeList elements = document.getElementsByTagName(DOCUMENT_ELEMENT_API);
if (elements.getLength() > 0) {
Node n = elements.item(0);
- Node driver = n.getAttributes().getNamedItem(
- DOCUMENT_ELEMENT_DRIVER); //$NON-NLS-1$
+ Node driver = n.getAttributes().getNamedItem(DOCUMENT_ELEMENT_DRIVER);
if (driver != null) {
String driverValue = driver.getNodeValue();
cloudType = driverValue.toUpperCase();
@@ -140,7 +132,7 @@
private Object getURLContent(String url) throws IOException {
URL u = new URL(url);
URLConnection connection = u.openConnection();
- connection.setRequestProperty(HTTPHEADER_KEY_ACCEPT, HTTPHEADER_VALUE_ACCEPTXML); //$NON-NLS-1$ $NON-NLS-2$
+ connection.setRequestProperty(HTTPHEADER_KEY_ACCEPT, HTTPHEADER_VALUE_ACCEPTXML);
return connection.getContent();
}
@@ -194,11 +186,11 @@
getPropertyChangeSupport().firePropertyChange(PROPERTY_URL, this.url, this.url = url);
}
- public String getCloudType() {
+ public String getType() {
return cloudType;
}
- public void setCloudType(String cloudType) {
- getPropertyChangeSupport().firePropertyChange(PROPERTY_CLOUDTYPE, this.cloudType, this.cloudType = cloudType);
+ public void setType(String cloudType) {
+ getPropertyChangeSupport().firePropertyChange(PROPERTY_TYPE, this.cloudType, this.cloudType = cloudType);
}
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 08:25:24 UTC (rev 25706)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java 2010-10-11 09:02:28 UTC (rev 25707)
@@ -18,6 +18,8 @@
import org.eclipse.core.databinding.beans.BeanProperties;
import org.eclipse.core.databinding.observable.value.IValueChangeListener;
import org.eclipse.core.databinding.observable.value.ValueChangeEvent;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
import org.eclipse.jface.databinding.swt.WidgetProperties;
@@ -27,7 +29,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
@@ -40,8 +41,10 @@
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import org.jboss.tools.deltacloud.ui.common.databinding.validator.CompositeValidator;
import org.jboss.tools.deltacloud.ui.common.databinding.validator.MandatoryStringValidator;
public class CloudConnectionPage extends WizardPage {
@@ -51,7 +54,6 @@
private static final String URL_LABEL = "Url.label"; //$NON-NLS-1$
private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
private static final String USERNAME_LABEL = "UserName.label"; //$NON-NLS-1$
- private static final String TYPE_LABEL = "Type.label"; //$NON-NLS-1$
private static final String PASSWORD_LABEL = "Password.label"; //$NON-NLS-1$
private static final String TESTBUTTON_LABEL = "TestButton.label"; //$NON-NLS-1$
private static final String EC2_USER_INFO = "EC2UserNameLink.text"; //$NON-NLS-1$
@@ -61,27 +63,12 @@
private static final String TEST_SUCCESSFUL = "NewCloudConnectionTest.success"; //$NON-NLS-1$
private static final String TEST_FAILURE = "NewCloudConnectionTest.failure"; //$NON-NLS-1$
- private CloudConnection wizard;
-
- // private Button testButton;
-
- private Text nameText;
- private Text urlText;
- private Label typeLabel;
- private Text usernameText;
- private Text passwordText;
-
- private String name;
- private String url;
- private String username;
- private String password;
- private String cloudTypeLabel;
-
private String defaultName = "";
- private String defaultURL = "";
+ private String defaultUrl = "";
private String defaultUsername = "";
private String defaultPassword = "";
-
+ private String defaultType = "";
+
private CloudConnectionModel connectionModel;
private Listener linkListener = new Listener() {
@@ -94,71 +81,36 @@
Activator.log(e);
}
}
-
};
- private SelectionListener buttonListener = new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent event) {
- // boolean successful = false;
- // if (getURLValid()) {
- // successful = wizard.performTest();
- // }
- // if (successful) {
- // setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
- // } else {
- // setErrorMessage(WizardMessages.getString(TEST_FAILURE));
- // }
- }
-
- };
-
public CloudConnectionPage(String pageName, CloudConnection wizard) {
super(pageName);
- this.wizard = wizard;
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
- // setPageComplete(false);
this.connectionModel = new CloudConnectionModel();
}
- public CloudConnectionPage(String pageName, String defaultName, String defaultURL,
- String defaultUsername, String defaultPassword, String defaultCloudType,
+ public CloudConnectionPage(String pageName, String defaultName, String defaultUrl,
+ String defaultUsername, String defaultPassword, String defaultType,
CloudConnection wizard) {
super(pageName);
- this.wizard = wizard;
this.defaultName = defaultName;
- this.defaultURL = defaultURL;
+ this.defaultUrl = defaultUrl;
this.defaultUsername = defaultUsername;
this.defaultPassword = defaultPassword;
- this.cloudTypeLabel = defaultCloudType;
+ this.connectionModel = new CloudConnectionModel();
+ this.defaultType = defaultType;
setDescription(WizardMessages.getString(DESCRIPTION));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
setPageComplete(false);
}
- public String getName() {
- return connectionModel.getName();
+ public CloudConnectionModel getModel() {
+ return connectionModel;
}
-
- public String getURL() {
- return connectionModel.getUrl();
- }
-
- public String getUsername() {
- return connectionModel.getUsername();
- }
-
- public String getPassword() {
- return connectionModel.getPassword();
- }
-
- public String getType() {
- return connectionModel.getCloudType();
- }
-
+
@Override
public void createControl(Composite parent) {
DataBindingContext dbc = new DataBindingContext();
@@ -172,88 +124,66 @@
Label dummyLabel = new Label(container, SWT.NULL);
+ // name
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
- nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ Text nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
nameText.setText(defaultName);
- Binding nameTextBinding = dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observe(nameText),
- BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
- .observe(connectionModel),
- new UpdateValueStrategy().setBeforeSetValidator(new MandatoryStringValidator("name must be defined")),
- null);
- ControlDecorationSupport.create(nameTextBinding, SWT.LEFT|SWT.TOP);
+ bindName(dbc, nameText);
+ // url
Label urlLabel = new Label(container, SWT.NULL);
urlLabel.setText(WizardMessages.getString(URL_LABEL));
Point p1 = urlLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-
- urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
- Binding urlTextBinding = dbc.bindValue(
+ Text urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ urlText.setText(defaultUrl);
+ dbc.bindValue(
WidgetProperties.text(SWT.Modify).observeDelayed(500, urlText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_URL)
- .observe(connectionModel));
-
- final Label typeLabel = new Label(container, SWT.NULL);
+ .observe(connectionModel));
+
+ // cloud type
+ Label typeLabel = new Label(container, SWT.NULL);
+ typeLabel.setText(defaultType);
UpdateValueStrategy url2TypeStrategy = new UpdateValueStrategy();
url2TypeStrategy.setConverter(new CloudConnectionModel.CloudTypeConverter());
url2TypeStrategy.setBeforeSetValidator(new CloudConnectionModel.CloudTypeValidator());
- Binding urlBinding = dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observeDelayed(100, urlText),
- BeanProperties.value(CloudConnectionModel.PROPERTY_CLOUDTYPE).observe(connectionModel),
- url2TypeStrategy,
- new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
- urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+ Binding urlBinding = bindCloudTypeLabel(dbc, urlText, typeLabel, url2TypeStrategy);
- @Override
- public void handleValueChange(ValueChangeEvent event) {
- IStatus status = (IStatus) event.diff.getNewValue();
- if (status.isOK()) {
- typeLabel.setText(connectionModel.getCloudType());
- } else {
- typeLabel.setText("");
- }
- }
- });
- ControlDecorationSupport.create(urlBinding, SWT.LEFT|SWT.TOP);
-
Label usernameLabel = new Label(container, SWT.NULL);
usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
DataBindingContext credentialsDbc = new DataBindingContext();
- usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ // username
+ Text usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ usernameText.setText(defaultUsername);
credentialsDbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(usernameText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_USERNAME).observe(
connectionModel));
+ // password
Label passwordLabel = new Label(container, SWT.NULL);
passwordLabel.setText(WizardMessages.getString(PASSWORD_LABEL));
-
- passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD | SWT.SINGLE);
+ Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD | SWT.SINGLE);
+ passwordText.setText(defaultPassword);
credentialsDbc.bindValue(
WidgetProperties.text(SWT.Modify).observe(passwordText),
BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_PASSWORD).observe(
connectionModel));
-
+ // test button
final Button testButton = new Button(container, SWT.NULL);
testButton.setText(WizardMessages.getString(TESTBUTTON_LABEL));
testButton.setEnabled(false);
- urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+ bindTestButton(urlBinding, testButton);
- @Override
- public void handleValueChange(ValueChangeEvent event) {
- IStatus status = (IStatus) event.diff.getNewValue();
- testButton.setEnabled(status.isOK());
- }
- });
- testButton.addSelectionListener(buttonListener);
-
+ // ec2 user link
Link ec2userLink = new Link(container, SWT.NULL);
ec2userLink.setText(WizardMessages.getString(EC2_USER_INFO));
ec2userLink.addListener(SWT.Selection, linkListener);
+ // ec2 pw link
Link ec2pwLink = new Link(container, SWT.NULL);
ec2pwLink.setText(WizardMessages.getString(EC2_PASSWORD_INFO));
ec2pwLink.addListener(SWT.Selection, linkListener);
@@ -338,4 +268,76 @@
setControl(container);
// validate();
}
+
+ private void bindTestButton(Binding urlBinding, final Button testButton) {
+ urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ IStatus status = (IStatus) event.diff.getNewValue();
+ testButton.setEnabled(status.isOK());
+ }
+ });
+
+ testButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent event) {
+ // boolean successful = false;
+ // if (getURLValid()) {
+ // successful = wizard.performTest();
+ // }
+ // if (successful) {
+ // setMessage(WizardMessages.getString(TEST_SUCCESSFUL));
+ // } else {
+ // setErrorMessage(WizardMessages.getString(TEST_FAILURE));
+ // }
+ }
+ });
+ }
+
+ private Binding bindCloudTypeLabel(DataBindingContext dbc, Text urlText, final Label typeLabel,
+ UpdateValueStrategy url2TypeStrategy) {
+ Binding urlBinding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observeDelayed(100, urlText),
+ BeanProperties.value(CloudConnectionModel.PROPERTY_TYPE).observe(connectionModel),
+ url2TypeStrategy,
+ new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER));
+ urlBinding.getValidationStatus().addValueChangeListener(new IValueChangeListener() {
+
+ @Override
+ public void handleValueChange(ValueChangeEvent event) {
+ IStatus status = (IStatus) event.diff.getNewValue();
+ if (status.isOK()) {
+ typeLabel.setText(connectionModel.getType());
+ } else {
+ typeLabel.setText("");
+ }
+ }
+ });
+ ControlDecorationSupport.create(urlBinding, SWT.LEFT | SWT.TOP);
+ return urlBinding;
+ }
+
+ private void bindName(DataBindingContext dbc, final Text nameText) {
+ Binding nameTextBinding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observe(nameText),
+ BeanProperties.value(CloudConnectionModel.class, CloudConnectionModel.PROPERTY_NAME)
+ .observe(connectionModel),
+ new UpdateValueStrategy().setBeforeSetValidator(
+ new CompositeValidator(
+ new MandatoryStringValidator("name must be defined"),
+ new IValidator() {
+
+ @Override
+ public IStatus validate(Object value) {
+ if (nameText.getText() != null && DeltaCloudManager.getDefault().findCloud(nameText.getText()) != null) {
+ return ValidationStatus.error(NAME_ALREADY_IN_USE);
+ } else {
+ return ValidationStatus.ok();
+ }
+ }
+ })),
+ null);
+ ControlDecorationSupport.create(nameTextBinding, SWT.LEFT | SWT.TOP);
+ }
}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java 2010-10-11 08:25:24 UTC (rev 25706)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudType.java 2010-10-11 09:02:28 UTC (rev 25707)
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.wizards;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-public class CloudType {
-
- private static final String HTTPHEADER_KEY_ACCEPT = "Accept"; //$NON-NLS-1$
- private static final String HTTPHEADER_VALUE_ACCEPTXML = "application/xml;q=1.0"; //$NON-NLS-1$
- private static final String DOCUMENT_ELEMENT_DRIVER = "driver"; //$NON-NLS-1$
- private static final String DOCUMENT_ELEMENT_API = "api"; //$NON-NLS-1$
- private static final String URLCONNECTION_ENCODING = "UTF-8"; //$NON-NLS-1$
-
- public static final String UNKNOWN_TYPE_LABEL = "UnknownType.label"; //$NON-NLS-1$
- private static final String INVALID_URL = "ErrorInvalidURL.text"; //$NON-NLS-1$
- private static final String NONCLOUD_URL = "ErrorNonCloudURL.text"; //$NON-NLS-1$
-
- private String label = WizardMessages.getString(UNKNOWN_TYPE_LABEL);
- private boolean isValid;
- private String url;
-
- public CloudType(String url) {
- init(url);
- }
-
- /**
- * Initializes this instance, sets the cloud type label and the validity. It
- * tries to connect to the cloud instance that's supposed at the given url,
- * requests an API response and parses the xml that's returned.
- *
- * @param url
- * the cloud instance url to connect to
- */
- private void init(String url) {
- this.url = url;
- try {
- Object o = getURLContent(url + "/api?format=xml"); //$NON-NLS-1$
- if (o instanceof InputStream) {
- DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document document = db.parse(
- new InputSource(new StringReader(getXML((InputStream) o))));
-
- NodeList elements = document.getElementsByTagName(DOCUMENT_ELEMENT_API); //$NON-NLS-1$
- if (elements.getLength() > 0) {
- Node n = elements.item(0);
- Node driver = n.getAttributes().getNamedItem(
- DOCUMENT_ELEMENT_DRIVER); //$NON-NLS-1$
- if (driver != null) {
- isValid = true;
- String driverValue = driver.getNodeValue();
- label = driverValue.toUpperCase();
- }
- }
- }
- } catch (MalformedURLException e) {
- label = WizardMessages.getString(INVALID_URL);
- } catch (IOException e) {
- label = WizardMessages.getString(NONCLOUD_URL);
- } catch (ParserConfigurationException e) {
- label = WizardMessages.getString(NONCLOUD_URL);
- } catch (SAXException e) {
- label = WizardMessages.getString(NONCLOUD_URL);
- } catch (Exception e) {
- label = WizardMessages.getString(INVALID_URL);
- }
- }
-
- private String getXML(InputStream is) throws UnsupportedEncodingException, IOException {
- try {
- if (is == null) {
- return "";
- }
- StringBuilder sb = new StringBuilder();
- String line = "";
- BufferedReader reader = new BufferedReader(new InputStreamReader(is, URLCONNECTION_ENCODING));
- while ((line = reader.readLine()) != null) {
- sb.append(line).append("\n"); //$NON-NLS-1$
- }
- return sb.toString();
- } finally {
- is.close();
- }
- }
-
- public boolean isValid() {
- return isValid;
- }
-
- public String getLabel() {
- return label;
- }
-
- public String getUrl() {
- return url;
- }
-
- private Object getURLContent(String url) throws IOException {
- URL u = new URL(url);
- URLConnection connection = u.openConnection();
- connection.setRequestProperty(HTTPHEADER_KEY_ACCEPT, HTTPHEADER_VALUE_ACCEPTXML); //$NON-NLS-1$ $NON-NLS-2$
- return connection.getContent();
- }
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-11 08:25:24 UTC (rev 25706)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-10-11 09:02:28 UTC (rev 25707)
@@ -62,9 +62,9 @@
public boolean performTest() {
String name = mainPage.getName();
- String url = mainPage.getURL();
- String username = mainPage.getUsername();
- String password = mainPage.getPassword();
+ String url = mainPage.getModel().getUrl();
+ String username = mainPage.getModel().getUsername();
+ String password = mainPage.getModel().getPassword();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password);
return newCloud.testConnection();
@@ -77,10 +77,10 @@
@Override
public boolean performFinish() {
String name = mainPage.getName();
- String url = mainPage.getURL();
- String username = mainPage.getUsername();
- String password = mainPage.getPassword();
- String type = mainPage.getType();
+ String url = mainPage.getModel().getUrl();
+ String username = mainPage.getModel().getUsername();
+ String password = mainPage.getModel().getPassword();
+ String type = mainPage.getModel().getType();
try {
String oldName = cloud.getName();
cloud.editCloud(name, url, username, password, type);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java 2010-10-11 08:25:24 UTC (rev 25706)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java 2010-10-11 09:02:28 UTC (rev 25707)
@@ -48,9 +48,9 @@
public boolean performTest() {
String name = mainPage.getName();
- String url = mainPage.getURL();
- String username = mainPage.getUsername();
- String password = mainPage.getPassword();
+ String url = mainPage.getModel().getUrl();
+ String username = mainPage.getModel().getUsername();
+ String password = mainPage.getModel().getPassword();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password);
return newCloud.testConnection();
@@ -63,10 +63,10 @@
@Override
public boolean performFinish() {
String name = mainPage.getName();
- String url = mainPage.getURL();
- String username = mainPage.getUsername();
- String password = mainPage.getPassword();
- String type = mainPage.getType();
+ String url = mainPage.getModel().getUrl();
+ String username = mainPage.getModel().getUsername();
+ String password = mainPage.getModel().getPassword();
+ String type = mainPage.getModel().getType();
try {
DeltaCloud newCloud = new DeltaCloud(name, url, username, password, type, true);
DeltaCloudManager.getDefault().addCloud(newCloud);
14 years, 3 months
JBoss Tools SVN: r25706 - in trunk/as/plugins: org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-10-11 04:25:24 -0400 (Mon, 11 Oct 2010)
New Revision: 25706
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
Log:
JBIDE-7296 - ensuring that new servers have all important values persisted
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-10-11 07:35:02 UTC (rev 25705)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-10-11 08:25:24 UTC (rev 25706)
@@ -130,8 +130,10 @@
for( int i = 0; i < hosts.length; i++ ) {
name = hosts[i].getName();
hostName = hosts[i].getHostName();
- if( hosts[i].getHostName().toLowerCase().equals(serverHost))
+ if( hosts[i].getHostName().toLowerCase().equals(serverHost)) {
+ callback.getServer().setAttribute(RSEUtils.RSE_SERVER_HOST, hosts[i].getName());
return hosts[i].getName();
+ }
}
}
return current;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2010-10-11 07:35:02 UTC (rev 25705)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/ServerModeSectionComposite.java 2010-10-11 08:25:24 UTC (rev 25706)
@@ -68,12 +68,17 @@
current = ds.createPublishMethod().getPublishMethodType().getName();
} else {
String host = callback.getServer().getHost();
+ IJBossServerPublishMethodType behType = null;
if( SocketUtil.isLocalhost(host)) {
- current = ExtensionManager.getDefault().getPublishMethod(LocalPublishMethod.LOCAL_PUBLISH_METHOD).getName();
+ behType = ExtensionManager.getDefault().getPublishMethod(LocalPublishMethod.LOCAL_PUBLISH_METHOD);
} else {
// socket is not localhost, hard code this for now
- current = ExtensionManager.getDefault().getPublishMethod("rse").getName();
+ behType = ExtensionManager.getDefault().getPublishMethod("rse");
}
+ current = behType.getName();
+ callback.execute(new ChangeServerPropertyCommand(
+ callback.getServer(), IDeployableServer.SERVER_MODE,
+ behType.getId(), "Change server mode"));
}
if( current != null ) {
int index = deployTypeCombo.indexOf(current);
14 years, 3 months
JBoss Tools SVN: r25705 - trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-10-11 03:35:02 -0400 (Mon, 11 Oct 2010)
New Revision: 25705
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
Log:
JBIDE-7199 - timestamp error for nested zipped resources
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-10-11 07:23:07 UTC (rev 25704)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-10-11 07:35:02 UTC (rev 25705)
@@ -262,7 +262,7 @@
IModuleFile mf = (IModuleFile)children[i];
java.io.File source = getFile(mf);
de.schlichtherle.io.File destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
- boolean b = new de.schlichtherle.io.File(source).copyAllTo(destination);
+ boolean b = new de.schlichtherle.io.File(source).archiveCopyAllTo(destination);
if( !b )
results.add(generateCopyFailStatus(source, destination));
} else if( children[i] instanceof IModuleFolder ) {
14 years, 3 months
JBoss Tools SVN: r25704 - in trunk/archives: tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-10-11 03:23:07 -0400 (Mon, 11 Oct 2010)
New Revision: 25704
Added:
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java
Log:
JBIDE-7199 - timestamp error for nested zipped resources
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2010-10-11 04:30:35 UTC (rev 25703)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2010-10-11 07:23:07 UTC (rev 25704)
@@ -57,7 +57,7 @@
public static boolean copyFile(String source, de.schlichtherle.io.File file) {
file.getParentFile().mkdirs();
- boolean b = new de.schlichtherle.io.File(source).copyAllTo(file);
+ boolean b = new de.schlichtherle.io.File(source).archiveCopyAllTo(file);
return b && updateParentTimestamps(file);
}
@@ -143,7 +143,7 @@
}
public static boolean updateParentTimestamps(de.schlichtherle.io.File file) {
long time = System.currentTimeMillis();
- de.schlichtherle.io.File parent = file.getEnclArchive();
+ de.schlichtherle.io.File parent = file;
boolean b = true;
while( parent != null ) {
b &= parent.setLastModified(time);
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2010-10-11 04:30:35 UTC (rev 25703)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/ArchivesTestSuite.java 2010-10-11 07:23:07 UTC (rev 25704)
@@ -22,6 +22,7 @@
import org.jboss.ide.eclipse.archives.test.model.ModelUtilTest;
import org.jboss.ide.eclipse.archives.test.model.XBMarshallTest;
import org.jboss.ide.eclipse.archives.test.model.XBUnmarshallTest;
+import org.jboss.ide.eclipse.archives.test.projects.InnerZipResourceTimestampTest;
import org.jboss.ide.eclipse.archives.test.projects.JBIDE1406Test;
import org.jboss.ide.eclipse.archives.test.projects.JBIDE2099Test;
import org.jboss.ide.eclipse.archives.test.projects.JBIDE2296Test;
@@ -52,8 +53,8 @@
suite.addTestSuite(JBIDE2311Test.class);
suite.addTestSuite(JBIDE2315Test.class);
suite.addTestSuite(JBIDE2439Test.class);
+ suite.addTestSuite(InnerZipResourceTimestampTest.class);
-
// UI
suite.addTestSuite(BuildActionTest.class);
return suite;
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java 2010-10-11 04:30:35 UTC (rev 25703)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/ModelTest.java 2010-10-11 07:23:07 UTC (rev 25704)
@@ -27,39 +27,32 @@
*
*/
public abstract class ModelTest extends TestCase {
- protected static IArchiveNodeFactory getFactory() {
+ public static IArchiveNodeFactory getFactory() {
return ArchivesCore.getInstance().getNodeFactory();
}
/*
* Utility methods
*/
- protected IArchiveFolder createFolder(String name) {
+ public static IArchiveFolder createFolder(String name) {
IArchiveFolder folder = getFactory().createFolder();
folder.setName(name);
return folder;
}
- protected IArchiveStandardFileSet createFileSet(String includes, String path) {
+ public static IArchiveStandardFileSet createFileSet(String includes, String path) {
IArchiveStandardFileSet fs = getFactory().createFileset();
fs.setIncludesPattern(includes);
fs.setRawSourcePath( path );
return fs;
}
- protected IArchiveFileSet createLibFileSet(String name) {
+ public static IArchiveFileSet createLibFileSet(String name) {
ArchiveLibFileSetImpl lfsi = LibFileSetNodeProvider.createLibFileset();
lfsi.setId(name);
return lfsi;
}
-
-// protected IArchiveAction createAction() {
-// IArchiveAction action = ArchiveNodeFactory.createAction();
-// action.setTime(IArchiveAction.POST_BUILD);
-// action.setType("ant");
-// return action;
-// }
- protected IArchive createArchive(String name, String dest) {
+ public static IArchive createArchive(String name, String dest) {
IArchive archive = getFactory().createArchive();
archive.setName(name);
archive.setDestinationPath(new Path(dest));
Added: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java (rev 0)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java 2010-10-11 07:23:07 UTC (rev 25704)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.ide.eclipse.archives.test.projects;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.jboss.ide.eclipse.archives.core.util.internal.TrueZipUtil;
+import org.jboss.ide.eclipse.archives.test.ArchivesTest;
+import org.jboss.tools.test.util.ResourcesUtils;
+import org.osgi.framework.Bundle;
+
+import de.schlichtherle.io.File;
+
+/**
+ * This class tests first and foremost
+ * the presence of a ${archives_current_project}
+ * extension to allow the currently building
+ * project to be agnostic
+ *
+ * During this JIRA, workspace paths became conscious of
+ * their absolute / relative status and are now interpreted
+ * differently according to their status.
+ * @author rob
+ *
+ */
+public class InnerZipResourceTimestampTest extends TestCase {
+ private long startTime;
+ private Bundle bundle;
+ private final String projName = "InnerZipProj";
+ private IProject project;
+ IPath projLocation;
+ private IFolder outputDir, libDir;
+ protected void setUp() throws Exception {
+ startTime = new Date().getTime();
+ bundle = ArchivesTest.getDefault().getBundle();
+ project = ResourcesUtils.createEclipseProject(projName, new NullProgressMonitor());
+ projLocation = project.getLocation(); // for debugging
+ assertTrue(project.exists());
+ project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+ outputDir = project.getFolder("output");
+ outputDir.create(true, true, new NullProgressMonitor());
+ assertTrue(outputDir.exists());
+ libDir = project.getFolder("libs");
+ libDir.create(true, true, new NullProgressMonitor());
+ assertTrue(libDir.exists());
+ }
+
+ protected java.io.File findSomeJar() {
+ try {
+ URL bundleURL = FileLocator.toFileURL(bundle.getEntry(""));
+ IPath bundlePath = new Path(bundleURL.getFile());
+ return bundlePath.append("libs").append("some.jar").toFile();
+ } catch(IOException ioe){}
+ return null;
+ }
+
+
+ protected void tearDown() throws Exception {
+ ResourcesUtils.deleteProject(projName);
+ }
+
+ public void testInnerZipTimestamps() {
+ // test the original
+ java.io.File someJar = findSomeJar();
+ File file = TrueZipUtil.getFile(new Path(someJar.getAbsolutePath()).append("META-INF").append("MANIFEST.MF"));
+ long last = file.lastModified();
+ assertTrue(last < startTime);
+
+ try {
+ boolean copyVal = TrueZipUtil.copyFile(someJar.getAbsolutePath(), libDir.getLocation().append("some.jar"));
+ TrueZipUtil.umount();
+ IPath workspaceJarPath = libDir.getLocation().append("some.jar");
+ long workspaceJarLastModified = workspaceJarPath.toFile().lastModified();
+ assertTrue(workspaceJarLastModified > startTime);
+ File workspaceFile = TrueZipUtil.getFile(workspaceJarPath.append("META-INF").append("MANIFEST.MF"));
+ long workspaceResourceMod = workspaceFile.lastModified();
+ assertTrue(workspaceResourceMod < startTime);
+ } catch(IOException ioe) {
+ } finally {}
+ }
+}
14 years, 3 months
JBoss Tools SVN: r25703 - branches/jbosstools-3.2.0.Beta1/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-11 00:30:35 -0400 (Mon, 11 Oct 2010)
New Revision: 25703
Modified:
branches/jbosstools-3.2.0.Beta1/build/build.xml
Log:
Maven 3.0 released; update version used in script
Modified: branches/jbosstools-3.2.0.Beta1/build/build.xml
===================================================================
--- branches/jbosstools-3.2.0.Beta1/build/build.xml 2010-10-11 04:29:31 UTC (rev 25702)
+++ branches/jbosstools-3.2.0.Beta1/build/build.xml 2010-10-11 04:30:35 UTC (rev 25703)
@@ -2,7 +2,7 @@
<!-- ****************************** Configuration ****************************** -->
<!-- default maven version -->
- <property name="maven.version" value="3.0-beta-3" />
+ <property name="maven.version" value="3.0" />
<!-- set name of component(s) to build+test, IN ORDER; if no subcomponents, use "." -->
<property name="COMPONENTS"
14 years, 3 months
JBoss Tools SVN: r25702 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-11 00:29:31 -0400 (Mon, 11 Oct 2010)
New Revision: 25702
Modified:
trunk/build/build.xml
Log:
Maven 3.0 released; update version used in script
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2010-10-11 03:50:46 UTC (rev 25701)
+++ trunk/build/build.xml 2010-10-11 04:29:31 UTC (rev 25702)
@@ -2,7 +2,7 @@
<!-- ****************************** Configuration ****************************** -->
<!-- default maven version -->
- <property name="maven.version" value="3.0-beta-3" />
+ <property name="maven.version" value="3.0" />
<!-- set name of component(s) to build+test, IN ORDER; if no subcomponents, use "." -->
<property name="COMPONENTS"
14 years, 3 months