JBoss Tools SVN: r35511 - trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-10 08:02:05 -0400 (Mon, 10 Oct 2011)
New Revision: 35511
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
Log:
[JBIDE-9793] added EgitUtils#addRemoteTo
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-10 12:00:31 UTC (rev 35510)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.egit.core/src/org/jboss/ide/eclipse/as/egit/core/EGitUtils.java 2011-10-10 12:02:05 UTC (rev 35511)
@@ -11,6 +11,7 @@
package org.jboss.ide.eclipse.as.egit.core;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
@@ -30,6 +31,7 @@
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.lib.StoredConfig;
import org.eclipse.jgit.lib.UserConfig;
import org.eclipse.jgit.transport.RefSpec;
import org.eclipse.jgit.transport.RemoteConfig;
@@ -399,6 +401,33 @@
return remoteName;
}
+ /**
+ * Adds the given uri of a remote repository to the given repository by the
+ * given name.
+ *
+ * @param remoteName
+ * the name to use for the remote repository
+ * @param uri
+ * the uri of the remote repository
+ * @param repository
+ * the repository to add the remote to
+ * @throws URISyntaxException
+ * the uRI syntax exception
+ * @throws MalformedURLException
+ * the malformed url exception
+ * @throws IOException
+ * Signals that an I/O exception has occurred.
+ */
+ public static void addRemoteTo(String remoteName, URIish uri, Repository repository)
+ throws URISyntaxException, MalformedURLException,
+ IOException {
+ StoredConfig config = repository.getConfig();
+ RemoteConfig remoteConfig = new RemoteConfig(config, remoteName);
+ remoteConfig.addURI(uri);
+ remoteConfig.update(config);
+ config.save();
+ }
+
private static IStatus createStatus(Exception e, String message, String... arguments) throws CoreException {
IStatus status = null;
if (e == null) {
@@ -408,5 +437,4 @@
}
return status;
}
-
}
13 years, 3 months
JBoss Tools SVN: r35510 - in trunk/as/plugins/org.jboss.tools.openshift.express.ui: src/org/jboss/tools/openshift/express/internal/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-10 08:00:31 -0400 (Mon, 10 Oct 2011)
New Revision: 35510
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
Log:
[JBIDE-9793] cloning openshift repo
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 11:01:36 UTC (rev 35509)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 12:00:31 UTC (rev 35510)
@@ -5,8 +5,9 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
+ org.jboss.ide.eclipse.as.egit.core;bundle-version="2.3.0",
org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jgit;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.jgit,
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.databinding;bundle-version="1.4.0",
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-10 11:01:36 UTC (rev 35509)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-10 12:00:31 UTC (rev 35510)
@@ -11,8 +11,16 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
public class AdapterWizardPage extends AbstractOpenshiftWizardPage implements IWizardPage {
@@ -25,7 +33,37 @@
@Override
protected void doCreateControls(Composite parent, DataBindingContext dbc) {
- // TODO Auto-generated method stub
+ GridLayoutFactory.fillDefaults().applyTo(parent);
+
+ Group projectGroup = new Group(parent, SWT.BORDER);
+ projectGroup.setText("Project setup");
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(projectGroup);
+ GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(2).applyTo(projectGroup);
+
+ Label projectNameLabel = new Label(projectGroup, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(projectNameLabel);
+ projectNameLabel.setText("Project name");
+ Text projectNameText = new Text(projectGroup, SWT.BORDER);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(projectNameText);
+
+ Label branchNameLabel = new Label(projectGroup, SWT.NONE);
+ branchNameLabel.setText("Name of remote branch");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(branchNameLabel);
+ Text branchNameText = new Text(projectGroup, SWT.BORDER);
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(branchNameText);
+
+ Group serverAdapterGroup = new Group(parent, SWT.BORDER);
+ serverAdapterGroup.setText("JBoss Server adapter");
+ GridDataFactory.fillDefaults()
+ .align(SWT.LEFT, SWT.CENTER).align(SWT.FILL, SWT.FILL).grab(true, false).applyTo(serverAdapterGroup);
+ FillLayout fillLayout = new FillLayout();
+ fillLayout.marginHeight = 6;
+ fillLayout.marginWidth = 6;
+ serverAdapterGroup.setLayout(fillLayout);
+ Button serverAdapterCheckbox = new Button(serverAdapterGroup, SWT.CHECK);
+ serverAdapterCheckbox.setText("Create a JBoss server adapter");
}
-
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java 2011-10-10 11:01:36 UTC (rev 35509)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java 2011-10-10 12:00:31 UTC (rev 35510)
@@ -52,7 +52,7 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- model.createGitClone();
+ model.setupProject();
return Status.OK_STATUS;
} catch (OpenshiftException e) {
return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-10 11:01:36 UTC (rev 35509)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-10 12:00:31 UTC (rev 35510)
@@ -11,14 +11,18 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import java.io.File;
+import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
import java.net.URISyntaxException;
-import java.net.URL;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jgit.api.Git;
+import org.eclipse.jgit.api.InitCommand;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.transport.URIish;
+import org.jboss.ide.eclipse.as.egit.core.EGitUtils;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
@@ -48,12 +52,26 @@
this.application = application;
}
- public void createGitClone() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException {
+ public void setupProject() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException, IOException {
String applicationWorkingdir = "openshift-" + application.getName();
- File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
- File workDir = new File(workspace, applicationWorkingdir);
- URIish gitUri = new URIish(application.getGitUri());
- new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024).run(null);
+// File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
+// File workDir = new File(workspace, applicationWorkingdir);
+// URIish gitUri = new URIish(application.getGitUri());
+// new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024).run(null);
+ Repository repository = createRepository(applicationWorkingdir);
+ // TODO replace remote name by user setting
+ EGitUtils.addRemoteTo("openshift", new URIish(application.getGitUri()), repository);
}
+
+ private Repository createRepository(String name) throws IOException {
+ InitCommand init = Git.init();
+ IPath workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation();
+ IPath gitRepoProject = workspace.append(name);
+ File repositoryFile = new File(gitRepoProject.toFile(), Constants.DOT_GIT);
+ init.setDirectory(repositoryFile);
+ init.setBare(false);
+ Git git = init.call();
+ return git.getRepository();
+ }
}
13 years, 3 months
JBoss Tools SVN: r35509 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-10-10 07:01:36 -0400 (Mon, 10 Oct 2011)
New Revision: 35509
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
Restore news feed now that the source feed is fixed. My bad, should never have been committed in the first place.
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-10 09:15:07 UTC (rev 35508)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-10 11:01:36 UTC (rev 35509)
@@ -805,7 +805,7 @@
td.indent = 2;
Point size = newsComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
td.maxWidth = size.x - 2;
- //formText.setText(text, true, true);
+ formText.setText(text, true, true);
//Display display = Display.getCurrent();
//formText.setFont(getLinkFont(display));
formText.setFont("default", JFaceResources.getDefaultFont());
13 years, 3 months
JBoss Tools SVN: r35508 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-10 05:15:07 -0400 (Mon, 10 Oct 2011)
New Revision: 35508
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
Log:
[JBIDE-9793] cloning openshift repo
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 08:16:45 UTC (rev 35507)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 09:15:07 UTC (rev 35508)
@@ -5,7 +5,7 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
- org.eclipse.egit.core;bundle-version="1.2.0",
+ org.eclipse.egit.core;bundle-version="[1.1.0,2.0.0)",
org.eclipse.jgit;bundle-version="[1.1.0,2.0.0)",
org.eclipse.ui,
org.eclipse.core.runtime,
13 years, 3 months
JBoss Tools SVN: r35507 - trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-10 04:16:45 -0400 (Mon, 10 Oct 2011)
New Revision: 35507
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
Log:
[JBIDE-9793] cloning openshift repo
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 07:33:12 UTC (rev 35506)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 08:16:45 UTC (rev 35507)
@@ -6,7 +6,7 @@
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
org.eclipse.egit.core;bundle-version="1.2.0",
- org.eclipse.jgit;bundle-version="1.2.0",
+ org.eclipse.jgit;bundle-version="[1.1.0,2.0.0)",
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.databinding;bundle-version="1.4.0",
13 years, 3 months
JBoss Tools SVN: r35506 - in trunk: as/plugins/org.jboss.tools.openshift.express.ui/META-INF and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-10-10 03:33:12 -0400 (Mon, 10 Oct 2011)
New Revision: 35506
Added:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
Removed:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractSkippingWizard.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ISkipableWizardPage.java
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.tools.openshift.express.ui/build.properties
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ParametrizableWizardPageSupport.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
Log:
[JBIDE-9793] cloning openshift repo
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-10-10 07:33:12 UTC (rev 35506)
@@ -5,6 +5,8 @@
Bundle-Version: 2.3.0.qualifier
Bundle-Activator: org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator
Require-Bundle: org.jboss.tools.openshift.express.client;bundle-version="2.3.0",
+ org.eclipse.egit.core;bundle-version="1.2.0",
+ org.eclipse.jgit;bundle-version="1.2.0",
org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.databinding;bundle-version="1.4.0",
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/build.properties
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/build.properties 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/build.properties 2011-10-10 07:33:12 UTC (rev 35506)
@@ -1,11 +1,8 @@
source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml
-src.includes = .classpath,\
- .project,\
+bin.includes = .,\
+ icons/,\
+ pom.xml,\
META-INF/,\
- build.properties,\
- plugin.xml,\
- pom.xml
+ bin/,\
+ plugin.xml
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractOpenshiftWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -64,6 +64,8 @@
public void pageChanged(PageChangedEvent event) {
if (event.getSelectedPage() == AbstractOpenshiftWizardPage.this) {
onPageActivated(dbc);
+ } else {
+ onPageDeactivated(dbc);
}
}
});
@@ -76,6 +78,10 @@
protected void onPageActivated(DataBindingContext dbc) {
}
+
+ protected void onPageDeactivated(DataBindingContext dbc) {
+ }
+
protected abstract void doCreateControls(Composite parent, DataBindingContext dbc);
}
Deleted: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractSkippingWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractSkippingWizard.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AbstractSkippingWizard.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
-
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.ui.INewWizard;
-
-/**
- * @author André Dietisheim
- */
-public abstract class AbstractSkippingWizard extends Wizard implements INewWizard {
-
- @Override
- public IWizardPage getNextPage(IWizardPage page) {
- IWizardPage nextPage = null;
- while ((nextPage = super.getNextPage(page)) != null) {
- if (ISkipableWizardPage.class.isAssignableFrom(nextPage.getClass())
- && ((ISkipableWizardPage) nextPage).isSkip()) {
- page = nextPage;
- continue;
- } else {
- break;
- }
- }
- return nextPage;
- }
-
- @Override
- public IWizardPage getPreviousPage(IWizardPage page) {
- IWizardPage previousPage = null;
- while ((previousPage = super.getPreviousPage(page)) != null) {
- if (ISkipableWizardPage.class.isAssignableFrom(previousPage.getClass())
- && ((ISkipableWizardPage) previousPage).isSkip()) {
- page = previousPage;
- continue;
- } else {
- break;
- }
- }
- return previousPage;
- }
-}
Added: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
+
+import org.eclipse.core.databinding.DataBindingContext;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.swt.widgets.Composite;
+
+public class AdapterWizardPage extends AbstractOpenshiftWizardPage implements IWizardPage {
+
+ private AdapterWizardPageModel model;
+
+ public AdapterWizardPage(ServerAdapterWizard wizard, ServerAdapterWizardModel model) {
+ super("Server Adapter", "...", "Server Adapter", wizard);
+ this.model = new AdapterWizardPageModel(model);
+ }
+
+ @Override
+ protected void doCreateControls(Composite parent, DataBindingContext dbc) {
+ // TODO Auto-generated method stub
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
+
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+
+/**
+ * @author André Dietisheim
+ */
+public class AdapterWizardPageModel extends ObservableUIPojo {
+
+ private ServerAdapterWizardModel wizardModel;
+
+ public AdapterWizardPageModel(ServerAdapterWizardModel wizardModel) {
+ this.wizardModel = wizardModel;
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -109,13 +109,13 @@
Button deleteButton = new Button(container, SWT.PUSH);
deleteButton.setText("&Delete");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, 30).applyTo(deleteButton);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, SWT.DEFAULT).applyTo(deleteButton);
DataBindingUtils.bindEnablementToValidationStatus(deleteButton, IStatus.INFO, dbc, selectedApplicationBinding);
deleteButton.addSelectionListener(onDelete(dbc));
Button detailsButton = new Button(container, SWT.PUSH);
detailsButton.setText("De&tails");
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).hint(80, 30).applyTo(detailsButton);
+ GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).hint(80, SWT.DEFAULT).applyTo(detailsButton);
DataBindingUtils.bindEnablementToValidationStatus(detailsButton, IStatus.INFO, dbc , selectedApplicationBinding);
detailsButton.addSelectionListener(onDetails(dbc));
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardPageModel.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -46,6 +46,7 @@
}
public void setSelectedApplication(IApplication application) {
+ wizardModel.setApplication(application);
firePropertyChange(PROPERTY_SELECTED_APPLICATION, this.selectedApplication, this.selectedApplication = application);
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/CredentialsWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
-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;
@@ -58,7 +57,7 @@
GridLayoutFactory.fillDefaults().numColumns(3).margins(10, 10).applyTo(container);
Link signupLink = new Link(container, SWT.WRAP);
- signupLink.setText("If you have no user account on Openshit Express yet, please sign up <a>here</a>.");
+ signupLink.setText("If you have no user account on OpenShit Express yet, please sign up <a>here</a>.");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(3, 1).hint(SWT.DEFAULT, 30).applyTo(signupLink);
signupLink.addSelectionListener(onSignupLinkClicked());
@@ -86,7 +85,7 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(rhLoginLabel);
Text rhLoginText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(rhLoginText);
- Binding rhLoginBining = DataBindingUtils.bindMandatoryTextField(
+ DataBindingUtils.bindMandatoryTextField(
rhLoginText, "Username", CredentialsWizardPageModel.PROPERTY_RHLOGIN, model, dbc);
Label passwordLabel = new Label(container, SWT.NONE);
@@ -94,7 +93,7 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(passwordLabel);
Text passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(passwordText);
- Binding passwordBinding = DataBindingUtils.bindMandatoryTextField(
+ DataBindingUtils.bindMandatoryTextField(
passwordText, "Password", CredentialsWizardPageModel.PROPERTY_PASSWORD, model, dbc);
// Label credentialsValidatyLabel = new Label(container, SWT.None);
@@ -106,11 +105,11 @@
this.validateButton = new Button(container, SWT.NONE);
validateButton.setText("&Validate");
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).indent(0, 10).hint(100, 30).applyTo(validateButton);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).span(2, 1).indent(0, 10).hint(100, SWT.DEFAULT).applyTo(validateButton);
DataBindingUtils.bindEnablementToValidationStatus(
- validateButton,
- dbc,
- rhLoginBining, passwordBinding);
+ validateButton
+ , IStatus.INFO
+ , dbc);
validateButton.addSelectionListener(onValidate(dbc));
dbc.bindValue(
new WritableValue(null, IStatus.class),
@@ -118,6 +117,8 @@
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER),
new UpdateValueStrategy().setAfterGetValidator(
new CredentialsStatusValidator()));
+
+ setErrorMessage(null);
}
protected SelectionAdapter onValidate(final DataBindingContext dbc) {
Copied: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPage.java (from rev 35415, trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java)
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPage.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
+
+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.WritableValue;
+import org.eclipse.core.databinding.validation.IValidator;
+import org.eclipse.core.databinding.validation.ValidationStatus;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
+import org.eclipse.jface.wizard.IWizard;
+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.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.common.ui.databinding.DataBindingUtils;
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
+
+/**
+ * @author André Dietisheim
+ */
+public class DomainWizardPage extends AbstractOpenshiftWizardPage {
+
+ private DomainWizardPageModel model;
+ private ServerAdapterWizardModel wizardModel;
+
+ public DomainWizardPage(IWizard wizard, ServerAdapterWizardModel wizardModel) {
+ super("Domain", "Create a new domain (if you have none yet), use your existing domain or rename it...",
+ "new Domain", wizard);
+ this.wizardModel = wizardModel;
+ this.model = new DomainWizardPageModel(wizardModel);
+ }
+
+ protected void doCreateControls(Composite container, DataBindingContext dbc) {
+ GridLayoutFactory.fillDefaults().numColumns(3).applyTo(container);
+
+ Label namespaceLabel = new Label(container, SWT.NONE);
+ namespaceLabel.setText("&Domain name");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
+ Text namespaceText = new Text(container, SWT.BORDER);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(namespaceText);
+ DataBindingUtils.bindMandatoryTextField(
+ namespaceText, "Domain name", DomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
+
+ // bind the existence of a domain to the page validity
+ dbc.bindValue(
+ new WritableValue(null, IDomain.class)
+ , BeanProperties.value(DomainWizardPageModel.PROPERTY_DOMAIN).observe(model)
+ , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
+ , new UpdateValueStrategy().setAfterGetValidator(new IValidator() {
+
+ @Override
+ public IStatus validate(Object value) {
+ if (!(value instanceof IDomain)) {
+ System.err.println("domain validator: domain is NOT present!!!!!!!!!!!!!");
+ return ValidationStatus.info("You have no domain yet, you need to create one.");
+ }
+ System.err.println("domain validator: domain is present");
+ return ValidationStatus.ok();
+ }
+ }));
+
+ Label spacerLabel = new Label(container, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, 30).applyTo(spacerLabel);
+
+ Button createButton = new Button(container, SWT.PUSH);
+ createButton.setText("&Create");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, SWT.DEFAULT).applyTo(createButton);
+ DataBindingUtils.bindEnablementToValidationStatus(createButton, IStatus.ERROR | IStatus.WARNING | IStatus.INFO , dbc);
+ createButton.addSelectionListener(onCreate(dbc));
+
+ Button renameButton = new Button(container, SWT.PUSH);
+ renameButton.setText("&Rename");
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(80, SWT.DEFAULT).applyTo(renameButton);
+ DataBindingUtils.bindEnablementToValidationStatus(renameButton, IStatus.OK, dbc);
+ renameButton.addSelectionListener(onRename(dbc));
+ }
+
+ private SelectionListener onCreate(DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Shell shell = getContainer().getShell();
+ if (WizardUtils.openWizardDialog(new NewDomainDialog(model.getNamespace(), wizardModel), shell)
+ == Dialog.OK) {
+ }
+ }
+ };
+ }
+
+ private SelectionListener onRename(DataBindingContext dbc) {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ try {
+ WizardUtils.runInWizard(new Job("Renaming domain...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ System.err.println("running job " + this);
+ try {
+ model.renameDomain();
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "Could not get domain", e);
+ }
+ }
+ }, getWizard().getContainer(), getDatabindingContext());
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
+ };
+ }
+
+ @Override
+ protected void onPageActivated(DataBindingContext dbc) {
+ try {
+ WizardUtils.runInWizard(new Job("Checking presence of domain...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ System.err.println("running job " + this);
+ try {
+ model.updateDomain();
+ return Status.OK_STATUS;
+ } catch (Exception e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "Could not get domain", e);
+ }
+ }
+ }, getWizard().getContainer(), getDatabindingContext());
+ } catch (Exception ex) {
+ // ignore
+ }
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPage.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Copied: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPageModel.java (from rev 35415, trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java)
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPageModel.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPageModel.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
+
+import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.client.IDomain;
+import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+
+/**
+ * @author André Dietisheim
+ */
+public class DomainWizardPageModel extends ObservableUIPojo {
+
+ public static final String PROPERTY_NAMESPACE = "namespace";
+ public static final String PROPERTY_DOMAIN = "domain";
+
+ private String namespace;
+ private IDomain domain;
+ private ServerAdapterWizardModel wizardModel;
+
+ public DomainWizardPageModel(ServerAdapterWizardModel wizardModel) {
+ this.wizardModel = wizardModel;
+ }
+
+ public String getNamespace() {
+ return this.namespace;
+ }
+
+ public void setNamespace(String namespace) {
+ firePropertyChange(PROPERTY_NAMESPACE, this.namespace, this.namespace = namespace);
+ }
+
+ public boolean hasDomain() {
+ return domain != null;
+ }
+
+ public IDomain getDomain() {
+ return domain;
+ }
+
+ public void setDomain(IDomain domain) {
+ firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
+ setNamespace(domain);
+ }
+
+ private void setNamespace(IDomain domain) {
+ if (domain != null) {
+ setNamespace(domain.getNamespace());
+ } else {
+ setNamespace((String) null);
+ }
+ }
+
+ public void renameDomain() throws OpenshiftException {
+ getDomain().setNamespace(namespace);
+ }
+
+ public void updateDomain() throws OpenshiftException {
+ setDomain(getUser().getDomain());
+ }
+
+ public IUser getUser() {
+ return wizardModel.getUser();
+ }
+
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/DomainWizardPageModel.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ISkipableWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ISkipableWizardPage.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ISkipableWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
-
-/**
- * @author André Dietisheim
- */
-public interface ISkipableWizardPage {
-
- public boolean isSkip();
-
-}
Added: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java (rev 0)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.openshift.express.internal.ui.wizard;
+
+import java.util.concurrent.ArrayBlockingQueue;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
+
+/**
+ * @author André Dietisheim
+ */
+public class NewDomainDialog extends Wizard {
+
+ private NewDomainWizardPageModel newDomainWizardModel;
+ private ServerAdapterWizardModel wizardModel;
+ private String namespace;
+
+ public NewDomainDialog(String namespace, ServerAdapterWizardModel wizardModel) {
+ this.namespace = namespace;
+ this.wizardModel = wizardModel;
+ setNeedsProgressMonitor(true);
+ }
+
+ @Override
+ public boolean performFinish() {
+ final ArrayBlockingQueue<Boolean> queue = new ArrayBlockingQueue<Boolean>(1);
+ try {
+ WizardUtils.runInWizard(new Job("Creating application...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ newDomainWizardModel.createDomain();
+ queue.offer(true);
+ } catch (Exception e) {
+ queue.offer(false);
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ NLS.bind("Could not create domain \"{0}\"", newDomainWizardModel.getNamespace()), e);
+ }
+ return Status.OK_STATUS;
+ }
+ }, getContainer());
+ } catch (Exception e) {
+ // ignore
+ }
+ return queue.poll();
+ }
+
+ @Override
+ public void addPages() {
+ addPage(new NewDomainWizardPage(namespace, wizardModel, this));
+ }
+}
Property changes on: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainDialog.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPage.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -11,26 +11,16 @@
package org.jboss.tools.openshift.express.internal.ui.wizard;
import java.io.File;
-import java.util.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.TimeUnit;
+import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
import org.eclipse.core.databinding.UpdateValueStrategy;
-import org.eclipse.core.databinding.ValidationStatusProvider;
import org.eclipse.core.databinding.beans.BeanProperties;
-import org.eclipse.core.databinding.observable.IObservableCollection;
-import org.eclipse.core.databinding.observable.list.WritableList;
-import org.eclipse.core.databinding.observable.value.WritableValue;
-import org.eclipse.core.databinding.validation.IValidator;
-import org.eclipse.core.databinding.validation.ValidationStatus;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.databinding.fieldassist.ControlDecorationSupport;
+import org.eclipse.jface.databinding.swt.WidgetProperties;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -42,29 +32,22 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.jboss.tools.common.ui.BrowserUtil;
-import org.jboss.tools.common.ui.WizardUtils;
import org.jboss.tools.common.ui.databinding.DataBindingUtils;
-import org.jboss.tools.openshift.express.client.IDomain;
-import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
/**
* @author André Dietisheim
*/
-public class NewDomainWizardPage extends AbstractOpenshiftWizardPage implements ISkipableWizardPage {
+public class NewDomainWizardPage extends AbstractOpenshiftWizardPage {
- private static final String OPENSHIFT_EXPRESS_SIGNUP_URL = "https://openshift.redhat.com/app/user/new/express"; //$NON-NLS-1$
-
private static final String DIRECTORY_SSH_KEYS = ".ssh";
private static final String FILTEREXPRESSION_PUBLIC_SSH_KEY = "*.pub";
private static final String FILTERNAME_PUBLIC_SSH_KEY = "Public ssh key file (*.pub)";
private NewDomainWizardPageModel model;
- public NewDomainWizardPage(IWizard wizard, ServerAdapterWizardModel wizardModel) {
- super("New Domain", "Please create a new domain",
- "new Domain", wizard);
- this.model = new NewDomainWizardPageModel(wizardModel);
+ public NewDomainWizardPage(String namespace, ServerAdapterWizardModel wizardModel, IWizard wizard) {
+ super("Domain", "Create a new domain", "New Domain", wizard);
+ this.model = new NewDomainWizardPageModel(namespace, wizardModel);
}
protected void doCreateControls(Composite container, DataBindingContext dbc) {
@@ -75,36 +58,27 @@
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(namespaceLabel);
Text namespaceText = new Text(container, SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(2, 1).applyTo(namespaceText);
- DataBindingUtils.bindMandatoryTextField(namespaceText, "Domain name",
- NewDomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
+ DataBindingUtils.bindMandatoryTextField(
+ namespaceText, "Domain name", NewDomainWizardPageModel.PROPERTY_NAMESPACE, model, dbc);
Label sshKeyLabel = new Label(container, SWT.NONE);
sshKeyLabel.setText("SSH Key");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(sshKeyLabel);
Text sshKeyText = new Text(container, SWT.READ_ONLY | SWT.BORDER);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(sshKeyText);
- DataBindingUtils.bindMandatoryTextField(sshKeyText, "SSH Key", NewDomainWizardPageModel.PROPERTY_SSHKEY, model,
- dbc);
+
+ Binding sshKeyBinding = dbc.bindValue(
+ WidgetProperties.text(SWT.Modify).observe(sshKeyText)
+ , BeanProperties.value(NewDomainWizardPageModel.PROPERTY_SSHKEY).observe(model)
+ , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
+ , null
+ );
+ ControlDecorationSupport.create(sshKeyBinding, SWT.TOP | SWT.LEFT);
+
Button browseSShKeyButton = new Button(container, SWT.PUSH);
browseSShKeyButton.setText("Browse");
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).hint(100, SWT.DEFAULT).applyTo(browseSShKeyButton);
browseSShKeyButton.addSelectionListener(onBrowseSshKey());
-
- Label spacerLabel = new Label(container, SWT.None);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(spacerLabel);
-
- Button createButton = new Button(container, SWT.NONE);
- createButton.setText("&Create New Domain");
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).span(2, 1).indent(0, 10).hint(160, 34)
- .applyTo(createButton);
- createButton.addSelectionListener(onCreate(dbc));
- DataBindingUtils.bindEnablementToValidationStatus(createButton, dbc);
-
- dbc.bindValue(
- new WritableValue(null, IDomain.class)
- , BeanProperties.value(NewDomainWizardPageModel.PROPERTY_DOMAIN).observe(model)
- , new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER)
- , new UpdateValueStrategy().setAfterGetValidator(new DomainCreatedValidator()));
}
private SelectionListener onBrowseSshKey() {
@@ -130,98 +104,4 @@
File sshKeysDirectory = new File(userHome, DIRECTORY_SSH_KEYS);
return sshKeysDirectory.getAbsolutePath();
}
-
- protected SelectionAdapter onCreate(final DataBindingContext dbc) {
- return new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- try {
- WizardUtils.runInWizard(
- new Job("Creating new domain") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- model.createDomain();
- } catch (Exception e) {
- return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID, NLS.bind(
- "Could not create a new domain with the name \"{0}\"",
- model.getNamespace()), e);
- }
- return Status.OK_STATUS;
- }
- }, getWizard().getContainer(), dbc);
- } catch (Exception ex) {
- // ignore
- }
- };
- };
- }
-
- protected SelectionAdapter onSignupLinkClicked() {
- return new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- BrowserUtil.checkedCreateInternalBrowser(OPENSHIFT_EXPRESS_SIGNUP_URL, OPENSHIFT_EXPRESS_SIGNUP_URL,
- OpenshiftUIActivator.PLUGIN_ID, OpenshiftUIActivator.getDefault().getLog());
- getWizard().getContainer().getShell().close();
- }
- };
- }
-
- protected IObservableCollection toObservableCollection(ValidationStatusProvider... validationStatusProviders) {
- WritableList validationProviders = new WritableList();
- for (ValidationStatusProvider provider : validationStatusProviders) {
- validationProviders.add(provider);
- }
- return validationProviders;
- }
-
- @Override
- public boolean isSkip() {
- if (!model.hasUser()) {
- return false;
- }
-
- final ArrayBlockingQueue<Boolean> queue = new ArrayBlockingQueue<Boolean>(1);
- try {
- WizardUtils.runInWizard(
- new Job("Checking presence of domain") {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- queue.offer(model.hasDomain());
- } catch (Exception e) {
- queue.offer(false);
- return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
- "Could not get domain", e);
- }
- return Status.OK_STATUS;
- }
- }, getWizard().getContainer(), getDatabindingContext());
- } catch (Exception ex) {
- // ignore
- }
-
- try {
- return queue.poll(6, TimeUnit.SECONDS);
- } catch (InterruptedException e) {
- return false;
- }
- }
-
- private static class DomainCreatedValidator implements IValidator {
- @Override
- public IStatus validate(Object value) {
- if (value != null) {
- return ValidationStatus.ok();
- } else {
- return ValidationStatus.info("You have to create a domain...");
- }
- }
- };
-
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewDomainWizardPageModel.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -16,7 +16,6 @@
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IDomain;
import org.jboss.tools.openshift.express.client.ISSHPublicKey;
-import org.jboss.tools.openshift.express.client.IUser;
import org.jboss.tools.openshift.express.client.OpenshiftException;
import org.jboss.tools.openshift.express.client.SSHPublicKey;
@@ -34,7 +33,8 @@
private String sshKey;
private ServerAdapterWizardModel wizardModel;
- public NewDomainWizardPageModel(ServerAdapterWizardModel wizardModel) {
+ public NewDomainWizardPageModel(String namespace, ServerAdapterWizardModel wizardModel) {
+ setNamespace(namespace);
this.wizardModel = wizardModel;
}
@@ -43,8 +43,7 @@
}
public void createDomain() throws OpenshiftException, IOException {
- IUser user = getUser();
- IDomain domain = user.createDomain(namespace, loadSshKey());
+ IDomain domain = wizardModel.getUser().createDomain(namespace, loadSshKey());
setDomain(domain);
}
@@ -60,15 +59,12 @@
return new SSHPublicKey(new File(sshKey));
}
- public void setNamespace(String namespace) throws OpenshiftException {
+ public void setNamespace(String namespace) {
firePropertyChange(PROPERTY_NAMESPACE, this.namespace, this.namespace = namespace);
}
- public boolean hasDomain() throws OpenshiftException {
- if (!hasUser()) {
- return false;
- }
- return getUser().hasDomain();
+ public boolean hasDomain() {
+ return domain != null;
}
public IDomain getDomain() {
@@ -77,13 +73,12 @@
public void setDomain(IDomain domain) {
firePropertyChange(PROPERTY_DOMAIN, this.domain, this.domain = domain);
+ if (domain != null) {
+ setNamespace(domain.getNamespace());
+ }
}
- public boolean hasUser() {
- return wizardModel.getUser() != null;
+ public void updateDomain() throws OpenshiftException {
+ setDomain(wizardModel.getUser().getDomain());
}
-
- public IUser getUser() {
- return wizardModel.getUser();
- }
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizard.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -10,33 +10,77 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.common.ui.WizardUtils;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
+import org.jboss.tools.openshift.express.internal.ui.OpenshiftUIActivator;
/**
* @author André Dietisheim
*/
-public class ServerAdapterWizard extends AbstractSkippingWizard {
+public class ServerAdapterWizard extends Wizard implements INewWizard {
+ private ServerAdapterWizardModel model;
+
public ServerAdapterWizard() {
}
@Override
public void init(IWorkbench workbench, IStructuredSelection selection) {
- setWindowTitle("Create new Openshift Express Server Adapter");
+ setWindowTitle("OpenShift application wizard");
setNeedsProgressMonitor(true);
}
@Override
public boolean performFinish() {
- return true;
+ try {
+ WizardUtils.runInWizard(
+ new Job("Creating local git repo...") {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ model.createGitClone();
+ return Status.OK_STATUS;
+ } catch (OpenshiftException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "An exception occurred while creating local git repository.", e);
+ } catch (URISyntaxException e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "The url of the remote git repository is not valid", e);
+ } catch (Exception e) {
+ return new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "An exception occurred while creating local git repository.", e);
+ }
+ }
+ }, getContainer());
+ return true;
+ } catch (Exception e) {
+ ErrorDialog.openError(getShell(), "Error", "Could not create local git repository.",
+ new Status(IStatus.ERROR, OpenshiftUIActivator.PLUGIN_ID,
+ "An exception occurred while creating local git repository.", e));
+ return false;
+ }
}
@Override
public void addPages() {
- ServerAdapterWizardModel model = new ServerAdapterWizardModel();
+ this.model = new ServerAdapterWizardModel();
addPage(new CredentialsWizardPage(this, model));
- addPage(new NewDomainWizardPage(this, model));
+ addPage(new DomainWizardPage(this, model));
addPage(new ApplicationWizardPage(this, model));
+ addPage(new AdapterWizardPage(this, model));
}
}
Modified: trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java
===================================================================
--- trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ServerAdapterWizardModel.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -10,8 +10,19 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.jgit.transport.URIish;
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
+import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.IUser;
+import org.jboss.tools.openshift.express.client.OpenshiftException;
/**
* @author André Dietisheim
@@ -19,7 +30,8 @@
public class ServerAdapterWizardModel extends ObservableUIPojo {
private IUser user;
-
+ private IApplication application;
+
public void setUser(IUser user) {
this.user = user;
}
@@ -27,4 +39,21 @@
public IUser getUser() {
return user;
}
+
+ public IApplication getApplication() {
+ return application;
+ }
+
+ public void setApplication(IApplication application) {
+ this.application = application;
+ }
+
+ public void createGitClone() throws OpenshiftException, URISyntaxException, InvocationTargetException, InterruptedException {
+ String applicationWorkingdir = "openshift-" + application.getName();
+ File workspace = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile();
+ File workDir = new File(workspace, applicationWorkingdir);
+ URIish gitUri = new URIish(application.getGitUri());
+ new CloneOperation(gitUri, true, null, workDir, "refs/heads/*", "master", 10 * 1024).run(null);
+ }
+
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ParametrizableWizardPageSupport.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ParametrizableWizardPageSupport.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/ParametrizableWizardPageSupport.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -63,8 +63,10 @@
if (currentStatusStale) {
pageComplete = false;
} else if (currentStatus != null) {
- pageComplete = !currentStatus.matches(nonValidatingSeverity);
+// pageComplete = !currentStatus.matches(nonValidatingSeverity);
+ pageComplete = !((nonValidatingSeverity | currentStatus.getSeverity()) == nonValidatingSeverity);
}
+ System.err.println("pageComplete == " + pageComplete);
((WizardPage) getDialogPage()).setPageComplete(pageComplete);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/databinding/Status2BooleanConverter.java 2011-10-10 07:33:12 UTC (rev 35506)
@@ -46,16 +46,22 @@
}
int current = ((IStatus) fromObject).getSeverity();
- switch (severity) {
- default:
- case IStatus.ERROR:
- return current != IStatus.ERROR;
- case IStatus.WARNING:
- return current != IStatus.WARNING;
- case IStatus.INFO:
- return current != IStatus.INFO;
- case IStatus.OK:
- return current != IStatus.OK;
+// switch (severity) {
+// default:
+// case IStatus.ERROR:
+// return current != IStatus.ERROR;
+// case IStatus.WARNING:
+// return current != IStatus.WARNING;
+// case IStatus.INFO:
+// return current != IStatus.INFO;
+// case IStatus.OK:
+// return current != IStatus.OK;
+// }
+ if (current == IStatus.OK) {
+ System.err.println("converter result = " + (severity == IStatus.OK) + "<- current = " + current + " configured = " + severity);
+ return severity == IStatus.OK;
}
+ System.err.println("converter result = " + ((severity | current) == severity));
+ return (severity | current) == severity;
}
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-10-10 00:41:51 UTC (rev 35505)
+++ trunk/common/plugins/org.jboss.tools.common.ui/src/org/jboss/tools/common/ui/messages.properties 2011-10-10 07:33:12 UTC (rev 35506)
@@ -31,4 +31,4 @@
BROWSER_COULD_NOT_DISPLAY_MALFORMED_URL=Could not display malformed url \"{0}\".
URLSTRINGVALIDATOR_NOT_A_VALID_URL=\"{0}\" is not a valid url.
-MANDATORYSTRING_VALIDATOR_MUST_PROVIDE_VALUE=You have to provide a value for the {0}.
\ No newline at end of file
+MANDATORYSTRING_VALIDATOR_MUST_PROVIDE_VALUE=You have to provide a {0}.
\ No newline at end of file
13 years, 3 months
JBoss Tools SVN: r35505 - in branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US: images/migration-guide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: irooskov(a)redhat.com
Date: 2011-10-09 20:41:51 -0400 (Sun, 09 Oct 2011)
New Revision: 35505
Modified:
branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Book_Info.xml
branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Update.xml
branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/images/migration-guide/Add-Site_01.png
Log:
updated for 4.1 and 4.1.1
Modified: branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Book_Info.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Book_Info.xml 2011-10-09 09:52:34 UTC (rev 35504)
+++ branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Book_Info.xml 2011-10-10 00:41:51 UTC (rev 35505)
@@ -7,7 +7,7 @@
<productname>JBoss Developer Studio</productname>
<productnumber>4.1</productnumber>
<edition>4.1.0</edition>
- <pubsnumber>5</pubsnumber>
+ <pubsnumber>6</pubsnumber>
<abstract>
<para>
The Update Guide explains how to upgrade from JBoss Developer Studio 4.0 to JBoss Developer Studio 4.1.x
Modified: branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Update.xml
===================================================================
--- branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Update.xml 2011-10-09 09:52:34 UTC (rev 35504)
+++ branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/Update.xml 2011-10-10 00:41:51 UTC (rev 35505)
@@ -22,7 +22,7 @@
<section id="sect-update_site_configuration-Upgrading_using_the_update_site">
<title>Upgrading using the update site</title>
<para>
- JBoss Developer Studio provides the facility to update from version 3.0.x to the latest code fixes and enhancements without the need to download a complete installation. Updating can be achieved by adding the relevant remote update site to the list of available software sites then performing manual or scheduled updates. <!-- At present, the update site contains the latest 3.0.0.GA build so performing an update at this stage will leave your installation unchanged. -->
+ JBoss Developer Studio provides the facility to update from version 4.x.x to the latest code fixes and enhancements without the need to download a complete installation. Updating can be achieved by adding the relevant remote update site to the list of available software sites then performing manual or scheduled updates. <!-- At present, the update site contains the latest 3.0.0.GA build so performing an update at this stage will leave your installation unchanged. -->
</para>
<para>
<xref linkend="proc-Adding_Update_Sites"/> describes how to add the update site to the list of available sites. Configuring JBoss Developer Studio to check for and download updates is outlined in <xref linkend="proc-Configuring_Automatic_Updates"/>. Manual updates can be performed by selecting <menuchoice><guimenu>Help</guimenu><guisubmenu>Check For Updates</guisubmenu></menuchoice>.
@@ -53,7 +53,7 @@
</listitem>
<listitem>
<para>
- Enter a name for the update site such as JBDS3.0 in the <guilabel>Name</guilabel> field.
+ Enter a name for the update site such as JBDS 4.0 in the <guilabel>Name</guilabel> field.
</para>
</listitem>
<listitem>
@@ -63,12 +63,12 @@
<itemizedlist>
<listitem>
<para>
- https://devstudio.jboss.com/updates/3.0/
+ https://devstudio.jboss.com/updates/4.0/
</para>
</listitem>
<listitem>
<para>
- http://devstudio.jboss.com/updates/3.0/
+ http://devstudio.jboss.com/updates/4.0/
</para>
</listitem>
</itemizedlist>
@@ -85,7 +85,7 @@
</figure>
<warning><title>Use the secure site where possible</title>
<para>
- The unsecure site, http://devstudio.jboss.com/updates/3.0/, should only be used if the user is experiencing proxy problems or the user's firewall restricts access to https sites. The password will be sent in plain text if the http site is used.
+ The unsecure site, http://devstudio.jboss.com/updates/4.0/, should only be used if the user is experiencing proxy problems or the user's firewall restricts access to https sites. The password will be sent in plain text if the http site is used.
</para>
</warning>
</listitem>
Modified: branches/jbosstools-3.2.x/documentation/guides/Update_Guide/en-US/images/migration-guide/Add-Site_01.png
===================================================================
(Binary files differ)
13 years, 3 months
JBoss Tools SVN: r35504 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: jobs and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-10-09 05:52:34 -0400 (Sun, 09 Oct 2011)
New Revision: 35504
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
Log:
revert accidental edits
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-09 09:44:25 UTC (rev 35503)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-09 09:52:34 UTC (rev 35504)
@@ -103,7 +103,7 @@
public static final String NEWS_URL = "http://planet.jboss.org/view/all";
- public static final String NEWS_ATOM_URL = "http://planet.jboss.org/feeds/blogs";
+ public static final String NEWS_ATOM_URL = "http://planet.jboss.org/xml/all?type=atom";
public static final String FORM_END_TAG = "</p></form>";
public static final String FORM_START_TAG = "<form><p>";
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-09 09:44:25 UTC (rev 35503)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-09 09:52:34 UTC (rev 35504)
@@ -121,7 +121,7 @@
author = StringEscapeUtils.escapeHtml(author);
}
- description = " " + description;
+ //description = " " + description;
return new NewsEntry(title, link, description, entry.getAuthor(), date);
}
13 years, 3 months
JBoss Tools SVN: r35503 - in trunk/central/plugins/org.jboss.tools.central: src/org/jboss/tools/central and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-10-09 05:44:25 -0400 (Sun, 09 Oct 2011)
New Revision: 35503
Removed:
trunk/central/plugins/org.jboss.tools.central/bin/
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
Log:
do not include bin in svn
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-09 09:05:36 UTC (rev 35502)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-09 09:44:25 UTC (rev 35503)
@@ -103,7 +103,7 @@
public static final String NEWS_URL = "http://planet.jboss.org/view/all";
- public static final String NEWS_ATOM_URL = "http://planet.jboss.org/xml/all?type=atom";
+ public static final String NEWS_ATOM_URL = "http://planet.jboss.org/feeds/blogs";
public static final String FORM_END_TAG = "</p></form>";
public static final String FORM_START_TAG = "<form><p>";
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-09 09:05:36 UTC (rev 35502)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/jobs/RefreshNewsJob.java 2011-10-09 09:44:25 UTC (rev 35503)
@@ -120,6 +120,8 @@
if (author != null) {
author = StringEscapeUtils.escapeHtml(author);
}
+
+ description = " " + description;
return new NewsEntry(title, link, description, entry.getAuthor(), date);
}
13 years, 3 months
JBoss Tools SVN: r35502 - trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2011-10-09 05:05:36 -0400 (Sun, 09 Oct 2011)
New Revision: 35502
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java
Log:
Removed NPE that were occurring because of getProfile apparently returning null
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java 2011-10-08 00:17:12 UTC (rev 35501)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/ShowJBossCentral.java 2011-10-09 09:05:36 UTC (rev 35502)
@@ -34,19 +34,28 @@
} else {
IProfile profile = profileRegistry
.getProfile(IProfileRegistry.SELF);
- String profileId = profile.getProfileId();
- IEclipsePreferences prefs = JBossCentralActivator.getDefault().getPreferences();
- String savedId = prefs.get(JBossCentralActivator.PROFILE_ID, null);
- if (savedId == null || !savedId.equals(profileId)) {
- prefs.put(JBossCentralActivator.PROFILE_ID, profileId);
- showJBossCentral = true;
+
+ if (profile != null) { // got NPE's when running in PDE
+ String profileId = profile.getProfileId();
+ IEclipsePreferences prefs = JBossCentralActivator.getDefault()
+ .getPreferences();
+ String savedId = prefs.get(JBossCentralActivator.PROFILE_ID,
+ null);
+ if (savedId == null || !savedId.equals(profileId)) {
+ prefs.put(JBossCentralActivator.PROFILE_ID, profileId);
+ showJBossCentral = true;
+ }
+ long timestamp = profile.getTimestamp();
+ long savedTimestamp = prefs.getLong(
+ JBossCentralActivator.PROFILE_TIMESTAMP, -1);
+ if (timestamp != savedTimestamp) {
+ prefs.putLong(JBossCentralActivator.PROFILE_TIMESTAMP,
+ timestamp);
+ showJBossCentral = true;
+ }
+ } else {
+ // TODO: Not sure what is supposed to happen here if profile doesn't exist ?
}
- long timestamp = profile.getTimestamp();
- long savedTimestamp = prefs.getLong(JBossCentralActivator.PROFILE_TIMESTAMP, -1);
- if (timestamp != savedTimestamp) {
- prefs.putLong(JBossCentralActivator.PROFILE_TIMESTAMP, timestamp);
- showJBossCentral = true;
- }
}
if (!showJBossCentral) {
return;
13 years, 3 months