JBoss Tools SVN: r37492 - trunk/documentation/whatsnew/vpe.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2011-12-21 09:36:31 -0500 (Wed, 21 Dec 2011)
New Revision: 37492
Modified:
trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M5.html
Log:
Fix mistype issue.
Modified: trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M5.html
===================================================================
--- trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M5.html 2011-12-21 14:04:43 UTC (rev 37491)
+++ trunk/documentation/whatsnew/vpe/vpe-news-3.3.0.M5.html 2011-12-21 14:36:31 UTC (rev 37492)
@@ -65,7 +65,7 @@
<p></b>
</td>
<td valign="top">
- <p>Now there are "F5" and "CTRL+R" shortcuts to perform vusial refresh in Visual Page Editor.</p>
+ <p>Now there are "F5" and "CTRL+R" shortcuts to perform visual refresh in Visual Page Editor.</p>
<p><img src="images/3.3.0.M5/10020.png" alt="Hot keys for VPE Refresh" /></p>
<p><small>
<a href="https://jira.jboss.org/jira/browse/JBIDE-10020">Related Jira</a>
14 years
JBoss Tools SVN: r37491 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-21 09:04:43 -0500 (Wed, 21 Dec 2011)
New Revision: 37491
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
Log:
[JBIDE-10542] commented what needs to be changedto be able to push to the configured remote
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-12-21 14:00:08 UTC (rev 37490)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressPublishMethod.java 2011-12-21 14:04:43 UTC (rev 37491)
@@ -35,6 +35,8 @@
public class ExpressPublishMethod implements IJBossServerPublishMethod {
+ private ArrayList<IProject> projectsLackingGitRepo = null;
+
public ExpressPublishMethod() {
// TODO Auto-generated constructor stub
}
@@ -46,7 +48,6 @@
}
- private ArrayList<IProject> projectsLackingGitRepo = null;
@Override
public int publishFinish(DeployableServerBehavior behaviour,
IProgressMonitor monitor) throws CoreException {
@@ -101,6 +102,10 @@
return IServer.PUBLISH_STATE_NONE;
} else if( changed == 0 && requestPushApproval(module)) {
monitor.beginTask("Publishing " + p.getName(), 100);
+// TODO: use the following instead of the current:
+// EGitUtils.push("<remote name configured in AdapterWizardPageModel#getRemoteName>"
+// , EGitUtils.getRepository(p)
+// , new SubProgressMonitor(monitor, 100));
EGitUtils.push(EGitUtils.getRepository(p), new SubProgressMonitor(monitor, 100));
monitor.done();
return IServer.PUBLISH_STATE_NONE;
14 years
JBoss Tools SVN: r37490 - trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-21 09:00:08 -0500 (Wed, 21 Dec 2011)
New Revision: 37490
Added:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationStrategy.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectStrategy.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectStrategy.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/IImportApplicationStrategy.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java
Log:
[JBIDE-10542] extracted server adapter creation (from import strategy) to its own factory
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java (from rev 37484, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationStrategy.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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.appimport;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.egit.core.RepositoryUtil;
+import org.eclipse.egit.core.op.CloneOperation;
+import org.eclipse.egit.ui.Activator;
+import org.eclipse.jgit.lib.Constants;
+import org.eclipse.jgit.transport.JschConfigSessionFactory;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+abstract class AbstractImportApplicationOperation implements IImportApplicationStrategy {
+
+ private static final int CLONE_TIMEOUT = 10 * 1024;
+
+ private String projectName;
+ private IApplication application;
+ private String remoteName;
+ private IUser user;
+
+ public AbstractImportApplicationOperation(String projectName, IApplication application, String remoteName,
+ IUser user) {
+ this.projectName = projectName;
+ this.application = application;
+ this.remoteName = remoteName;
+ this.user = user;
+ }
+
+ /**
+ * Clones the repository of the selected OpenShift application to the user
+ * provided path
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws URISyntaxException
+ * @throws OpenShiftException
+ * @throws InvocationTargetException
+ * @throws InterruptedException
+ *
+ * @see AbstractImportApplicationOperation#getApplication()
+ * @see #getRepositoryPath()
+ */
+ protected File cloneRepository(IApplication application, String remoteName, File destination, IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, URISyntaxException {
+ monitor.subTask(NLS.bind("Cloning repository for application {0}...", application.getName()));
+ cloneRepository(application.getGitUri(), remoteName, destination, monitor);
+ return destination;
+ }
+
+ private void cloneRepository(String uri, String remoteName, File destination, IProgressMonitor monitor)
+ throws OpenShiftException, URISyntaxException, InvocationTargetException, InterruptedException {
+ ensureEgitUIIsStarted();
+ URIish gitUri = new URIish(uri);
+ CloneOperation cloneOperation =
+ new CloneOperation(gitUri, true, null, destination, Constants.HEAD, remoteName, CLONE_TIMEOUT);
+ cloneOperation.run(monitor);
+ RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil();
+ repositoryUtil.addConfiguredRepository(new File(destination, Constants.DOT_GIT));
+ }
+
+ /**
+ * The EGit UI plugin initializes the ssh factory to present the user a
+ * passphrase prompt if the ssh key was not read yet. If this initialization
+ * is not executed, the ssh connection to the git repo would just fail with
+ * an authentication error. We therefore have to make sure that the EGit UI
+ * plugin is started and initializes the JSchConfigSessionFactory.
+ * <p>
+ * EGit initializes the SshSessionFactory with the EclipseSshSessionFactory.
+ * The EclipseSshSessionFactory overrides JschConfigSessionFactory#configure
+ * to present a UserInfoPrompter if the key passphrase was not entered
+ * before.
+ *
+ * @see Activator#start(org.osgi.framework.BundleContext)
+ * @see Activator#setupSSH
+ * @see JschConfigSessionFactory#configure
+ * @see EclipseSshSessionFactory#configure
+ */
+ private void ensureEgitUIIsStarted() {
+ Activator.getDefault();
+ }
+
+ protected String getProjectName() {
+ return projectName;
+ }
+
+ /**
+ * Returns the workspace project with the given name if it exists. Returns
+ * <code>null</code> otherwise.
+ *
+ * @param name
+ * the project name
+ * @return the project with the given name
+ */
+ protected IProject getProject(String name) {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
+ Assert.isTrue(project != null && project.exists(),
+ NLS.bind("Could not find project {0} in your workspace.", name));
+ return project;
+ }
+
+ protected IApplication getApplication() {
+ return application;
+ }
+
+ protected String getRemoteName() {
+ return remoteName;
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationOperation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationStrategy.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationStrategy.java 2011-12-21 13:58:58 UTC (rev 37489)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AbstractImportApplicationStrategy.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -1,261 +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.appimport;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.egit.core.RepositoryUtil;
-import org.eclipse.egit.core.op.CloneOperation;
-import org.eclipse.egit.ui.Activator;
-import org.eclipse.jgit.lib.Constants;
-import org.eclipse.jgit.transport.JschConfigSessionFactory;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerType;
-import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.ServerUtil;
-import org.eclipse.wst.server.core.internal.Server;
-import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
-import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-abstract class AbstractImportApplicationStrategy implements IImportApplicationStrategy {
-
- private static final int CLONE_TIMEOUT = 10 * 1024;
-
- private String projectName;
- private IApplication application;
- private String remoteName;
- private boolean isCreateServer;
- private IServerType serverType;
- private IRuntime runtime;
- private String mode;
- private IUser user;
-
- public AbstractImportApplicationStrategy(String projectName, IApplication application, String remoteName,
- boolean isCreateServer, IServerType serverType, IRuntime runtime, String mode,
- IUser user) {
- this.projectName = projectName;
- this.application = application;
- this.remoteName = remoteName;
- this.isCreateServer = isCreateServer;
- this.serverType = serverType;
- this.runtime = runtime;
- this.mode = mode;
- this.user = user;
- }
-
- /**
- * Clones the repository of the selected OpenShift application to the user
- * provided path
- *
- * @param monitor
- * the monitor to report progress to
- * @return
- * @throws URISyntaxException
- * @throws OpenShiftException
- * @throws InvocationTargetException
- * @throws InterruptedException
- *
- * @see AbstractImportApplicationStrategy#getApplication()
- * @see #getRepositoryPath()
- */
- protected File cloneRepository(IApplication application, String remoteName, File destination, IProgressMonitor monitor)
- throws OpenShiftException, InvocationTargetException, InterruptedException, URISyntaxException {
- monitor.subTask(NLS.bind("Cloning repository for application {0}...", application.getName()));
- cloneRepository(application.getGitUri(), remoteName, destination, monitor);
- return destination;
- }
-
- private void cloneRepository(String uri, String remoteName, File destination, IProgressMonitor monitor)
- throws OpenShiftException, URISyntaxException, InvocationTargetException, InterruptedException {
- ensureEgitUIIsStarted();
- URIish gitUri = new URIish(uri);
- CloneOperation cloneOperation =
- new CloneOperation(gitUri, true, null, destination, Constants.HEAD, remoteName, CLONE_TIMEOUT);
- cloneOperation.run(monitor);
- RepositoryUtil repositoryUtil = Activator.getDefault().getRepositoryUtil();
- repositoryUtil.addConfiguredRepository(new File(destination, Constants.DOT_GIT));
- }
-
- /**
- * The EGit UI plugin initializes the ssh factory to present the user a
- * passphrase prompt if the ssh key was not read yet. If this initialization
- * is not executed, the ssh connection to the git repo would just fail with
- * an authentication error. We therefore have to make sure that the EGit UI
- * plugin is started and initializes the JSchConfigSessionFactory.
- * <p>
- * EGit initializes the SshSessionFactory with the EclipseSshSessionFactory.
- * The EclipseSshSessionFactory overrides JschConfigSessionFactory#configure
- * to present a UserInfoPrompter if the key passphrase was not entered
- * before.
- *
- * @see Activator#start(org.osgi.framework.BundleContext)
- * @see Activator#setupSSH
- * @see JschConfigSessionFactory#configure
- * @see EclipseSshSessionFactory#configure
- */
- private void ensureEgitUIIsStarted() {
- Activator.getDefault();
- }
-
- /**
- * creates an OpenShift server adapter for the user chosen project.
- *
- * @param monitor
- * the monitor to report progress to.
- * @throws OpenShiftException
- */
- protected void createServerAdapter(IProject project, IServerType serverType, IRuntime runtime, String mode,
- IApplication application, IUser user, IProgressMonitor monitor) throws OpenShiftException {
- String name = project.getName();
- monitor.subTask(NLS.bind("Creating server adapter for project {0}", name));
- createServerAdapter(Collections.singletonList(project), serverType, runtime, mode, application, user,
- monitor);
- }
-
- protected void createServerAdapter(List<IProject> importedProjects, IServerType serverType,
- IRuntime runtime, String mode, IApplication application, IUser user, IProgressMonitor monitor) {
- try {
- renameWebContextRoot(importedProjects);
- IServer server = doCreateServerAdapter(serverType, runtime, mode, application, user);
- addModules(getModules(importedProjects), server, monitor);
- } catch (CoreException ce) {
- OpenShiftUIActivator.getDefault().getLog().log(ce.getStatus());
- } catch (OpenShiftException ose) {
- IStatus s = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
- "Cannot create openshift server adapter", ose);
- OpenShiftUIActivator.getDefault().getLog().log(s);
- }
- }
-
- private void renameWebContextRoot(List<IProject> importedProjects) {
- for (IProject project : importedProjects) {
- ComponentUtilities.setServerContextRoot(project, "/");
- }
- }
-
- private IServer doCreateServerAdapter(IServerType serverType, IRuntime rt, String mode, IApplication application,
- IUser user) throws CoreException,
- OpenShiftException {
- Assert.isLegal(serverType != null);
- Assert.isLegal(mode != null);
- Assert.isLegal(application != null);
- Assert.isLegal(user != null);
-
- String serverNameBase = application.getName() + " OpenShift Server";
- String serverName = org.jboss.ide.eclipse.as.core.util.ServerUtil.getDefaultServerName(serverNameBase);
-
- IServer server = ExpressServerUtils.createServer(rt, serverType, serverName);
- ExpressServerUtils.fillServerWithOpenShiftDetails(server, application.getApplicationUrl(),
- user.getRhlogin(), user.getPassword(),
- user.getDomain().getNamespace(), application.getName(), application.getUUID(), mode);
- return server;
- }
-
- private void addModules(List<IModule> modules, IServer server, IProgressMonitor monitor) throws CoreException {
- if (modules == null
- || modules.size() == 0) {
- return;
- }
- IServerWorkingCopy wc = server.createWorkingCopy();
- IModule[] add = modules.toArray(new IModule[modules.size()]);
- wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
- server = wc.save(true, monitor);
- ((Server) server).setModulePublishState(add, IServer.PUBLISH_STATE_NONE);
- }
-
- private List<IModule> getModules(List<IProject> importedProjects) {
- Iterator<IProject> i = importedProjects.iterator();
- ArrayList<IModule> toAdd = new ArrayList<IModule>();
- while (i.hasNext()) {
- IProject p = i.next();
- IModule[] m = ServerUtil.getModules(p);
- if (m != null && m.length > 0) {
- toAdd.addAll(Arrays.asList(m));
- }
- }
- return toAdd;
- }
-
- public String getProjectName() {
- return projectName;
- }
-
- /**
- * Returns the workspace project with the given name if it exists. Returns
- * <code>null</code> otherwise.
- *
- * @param name
- * the project name
- * @return the project with the given name
- */
- protected IProject getProject(String name) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- Assert.isTrue(project != null && project.exists(),
- NLS.bind("Could not find project {0} in your workspace.", name));
- return project;
- }
-
- public IApplication getApplication() {
- return application;
- }
-
- public String getRemoteName() {
- return remoteName;
- }
-
- public boolean isCreateServer() {
- return isCreateServer;
- }
-
- public IServerType getServerType() {
- return serverType;
- }
-
- public IRuntime getRuntime() {
- return runtime;
- }
-
- public String getMode() {
- return mode;
- }
-
- public IUser getUser() {
- return user;
- }
-
-}
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java (from rev 37484, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectStrategy.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * 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.appimport;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.egit.core.GitIgnore;
+import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+public class AddToExistingProjectOperation extends AbstractImportApplicationOperation {
+
+ public AddToExistingProjectOperation(String projectName, IApplication application, String remoteName,
+ IUser user) {
+ super(projectName, application, remoteName, user);
+ }
+
+ /**
+ * Enables the user chosen project to be used on the chosen OpenShift
+ * application. Clones the application git repository, copies the
+ * configuration files to the user project (in the workspace), shares the
+ * user project with git and creates the server adapter.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws URISyntaxException
+ * The OpenShift application repository could not be cloned,
+ * because the uri it is located at is not a valid git uri
+ * @throws OpenShiftException
+ *
+ * @throws InvocationTargetException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation failed.
+ * @throws InterruptedException
+ * The OpenShift application repository could not be cloned, the
+ * clone operation was interrupted.
+ * @throws IOException
+ * The configuration files could not be copied from the git
+ * clone to the user project
+ * @throws CoreException
+ * The user project could not be shared with the git
+ *
+ * @see #cloneRepository
+ * @see #copyOpenshiftConfiguration
+ * @see #shareProject
+ * @see #createServerAdapterIfRequired
+ */
+ @Override
+ public List<IProject> execute(IProgressMonitor monitor)
+ throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
+ URISyntaxException {
+ // File repositoryFile =
+ // model.cloneRepository(monitor);
+ // model.importProject(repositoryFile, monitor);
+ // Repository repository =
+ // model.shareProject(monitor);
+ // model.mergeWithApplicationRepository(repository,
+ // monitor);
+ File tmpFolder = FileUtils.getRandomTmpFolder();
+ File repositoryFile = cloneRepository(getApplication(), getRemoteName(), tmpFolder, monitor);
+ IProject project = getProject(getProjectName());
+ copyOpenshiftConfiguration(repositoryFile, project, monitor);
+ FileUtil.safeDelete(tmpFolder);
+
+ shareProject(project, monitor);
+ return Collections.singletonList(project);
+ }
+
+ private void shareProject(IProject project, IProgressMonitor monitor) throws CoreException {
+ monitor.subTask(NLS.bind("Sharing project {0}...", project.getName()));
+ EGitUtils.share(project, monitor);
+ }
+
+ /**
+ * Copies the openshift configuration from the given source folder to the
+ * given project.
+ *
+ * @param sourceFolder
+ * the source to copy the openshift config from
+ * @param project
+ * the project to copy the configuration to.
+ * @param monitor
+ * the monitor to report progress to
+ * @throws IOException
+ */
+ private void copyOpenshiftConfiguration(final File sourceFolder, IProject project, IProgressMonitor monitor)
+ throws IOException {
+ Assert.isLegal(project != null);
+ File projectFolder = project.getLocation().toFile();
+ monitor.subTask(NLS.bind("Copying openshift configuration to project {0}...", project.getName()));
+ FileUtils.copy(new File(sourceFolder, ".git"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, ".openshift"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, "deployments"), projectFolder, false);
+ FileUtils.copy(new File(sourceFolder, "pom.xml"), projectFolder, false);
+ createGitIgnore(projectFolder);
+ }
+
+ /**
+ * Creates the git ignore file with a predefined set of entries. An existing
+ * .gitignore file is not overwritten, we then just dont do anything.
+ *
+ * @param projectFolder
+ * @throws IOException
+ */
+ private void createGitIgnore(File projectFolder) throws IOException {
+ GitIgnore gitIgnore = new GitIgnore(projectFolder);
+ // TODO: merge existing .gitignore
+ // (https://issues.jboss.org/browse/JBIDE-10391)
+ if (gitIgnore.exists()) {
+ return;
+ }
+ gitIgnore.add("target")
+ .add(".settings")
+ .add(".project")
+ .add(".classpath")
+ .add(".factorypath");
+ gitIgnore.write(false);
+ }
+
+ @SuppressWarnings("unused")
+ private void mergeWithApplicationRepository(Repository repository, IApplication application,
+ IProgressMonitor monitor)
+ throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
+ InvocationTargetException {
+ URIish uri = new URIish(application.getGitUri());
+ EGitUtils.addRemoteTo("openshift", uri, repository);
+ EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectOperation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectStrategy.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectStrategy.java 2011-12-21 13:58:58 UTC (rev 37489)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/AddToExistingProjectStrategy.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -1,162 +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.appimport;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerType;
-import org.jboss.ide.eclipse.as.core.util.FileUtil;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
-import org.jboss.tools.openshift.egit.core.GitIgnore;
-import org.jboss.tools.openshift.express.internal.ui.utils.FileUtils;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-public class AddToExistingProjectStrategy extends AbstractImportApplicationStrategy {
-
- public AddToExistingProjectStrategy(String projectName, IApplication application, String remoteName,
- boolean isCreateServer, IServerType serverType, IRuntime runtime, String mode,
- IUser user) {
- super(projectName, application, remoteName, isCreateServer, serverType, runtime, mode, user);
- }
-
- /**
- * Enables the user chosen project to be used on the chosen OpenShift
- * application. Clones the application git repository, copies the
- * configuration files to the user project (in the workspace), shares the
- * user project with git and creates the server adapter.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws URISyntaxException
- * The OpenShift application repository could not be cloned,
- * because the uri it is located at is not a valid git uri
- * @throws OpenShiftException
- *
- * @throws InvocationTargetException
- * The OpenShift application repository could not be cloned, the
- * clone operation failed.
- * @throws InterruptedException
- * The OpenShift application repository could not be cloned, the
- * clone operation was interrupted.
- * @throws IOException
- * The configuration files could not be copied from the git
- * clone to the user project
- * @throws CoreException
- * The user project could not be shared with the git
- *
- * @see #cloneRepository
- * @see #copyOpenshiftConfiguration
- * @see #shareProject
- * @see #createServerAdapterIfRequired
- */
- @Override
- public void execute(IProgressMonitor monitor)
- throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
- URISyntaxException {
- // File repositoryFile =
- // model.cloneRepository(monitor);
- // model.importProject(repositoryFile, monitor);
- // Repository repository =
- // model.shareProject(monitor);
- // model.mergeWithApplicationRepository(repository,
- // monitor);
- File tmpFolder = FileUtils.getRandomTmpFolder();
- File repositoryFile = cloneRepository(getApplication(), getRemoteName(), tmpFolder, monitor);
- IProject project = getProject(getProjectName());
- copyOpenshiftConfiguration(repositoryFile, project, monitor);
- FileUtil.safeDelete(tmpFolder);
-
- shareProject(project, monitor);
- if (isCreateServer()) {
- createServerAdapter(
- project, getServerType(), getRuntime(), getMode(), getApplication(), getUser(), monitor);
- }
- }
-
- private void shareProject(IProject project, IProgressMonitor monitor) throws CoreException {
- monitor.subTask(NLS.bind("Sharing project {0}...", project.getName()));
- EGitUtils.share(project, monitor);
- }
-
- /**
- * Copies the openshift configuration from the given source folder to the
- * given project.
- *
- * @param sourceFolder
- * the source to copy the openshift config from
- * @param project
- * the project to copy the configuration to.
- * @param monitor
- * the monitor to report progress to
- * @throws IOException
- */
- private void copyOpenshiftConfiguration(final File sourceFolder, IProject project, IProgressMonitor monitor)
- throws IOException {
- Assert.isLegal(project != null);
- File projectFolder = project.getLocation().toFile();
- monitor.subTask(NLS.bind("Copying openshift configuration to project {0}...", project.getName()));
- FileUtils.copy(new File(sourceFolder, ".git"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, ".openshift"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, "deployments"), projectFolder, false);
- FileUtils.copy(new File(sourceFolder, "pom.xml"), projectFolder, false);
- createGitIgnore(projectFolder);
- }
-
- /**
- * Creates the git ignore file with a predefined set of entries. An existing
- * .gitignore file is not overwritten, we then just dont do anything.
- *
- * @param projectFolder
- * @throws IOException
- */
- private void createGitIgnore(File projectFolder) throws IOException {
- GitIgnore gitIgnore = new GitIgnore(projectFolder);
- // TODO: merge existing .gitignore
- // (https://issues.jboss.org/browse/JBIDE-10391)
- if (gitIgnore.exists()) {
- return;
- }
- gitIgnore.add("target")
- .add(".settings")
- .add(".project")
- .add(".classpath")
- .add(".factorypath");
- gitIgnore.write(false);
- }
-
- @SuppressWarnings("unused")
- private void mergeWithApplicationRepository(Repository repository, IApplication application,
- IProgressMonitor monitor)
- throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
- InvocationTargetException {
- URIish uri = new URIish(application.getGitUri());
- EGitUtils.addRemoteTo("openshift", uri, repository);
- EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
- }
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/IImportApplicationStrategy.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/IImportApplicationStrategy.java 2011-12-21 13:58:58 UTC (rev 37489)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/IImportApplicationStrategy.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard.appimport;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IProgressMonitor;
/**
@@ -17,6 +20,14 @@
*/
public interface IImportApplicationStrategy {
- public void execute(IProgressMonitor monitor) throws Exception;
-
+ /**
+ * Executes this import operation and returns the projects that were
+ * imported.
+ *
+ * @param monitor the monitor to report progress to
+ * @return the list of projects that were imported to the workspace.
+ * @throws Exception
+ */
+ public List<IProject> execute(IProgressMonitor monitor) throws Exception;
+
}
Copied: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java (from rev 37484, trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectStrategy.java)
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * 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.appimport;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.transport.URIish;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.openshift.egit.core.EGitUtils;
+import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
+import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
+import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.GeneralProjectImportOperation;
+import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.MavenProjectImportOperation;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+public class ImportNewProjectOperation extends AbstractImportApplicationOperation {
+
+ private File cloneDestination;
+
+ public ImportNewProjectOperation(String projectName, IApplication application, String remoteName,
+ File cloneDestination, IUser user) {
+ super(projectName, application, remoteName, user);
+ this.cloneDestination = cloneDestination;
+ }
+
+ /**
+ * Imports the (new) project that the user has chosen into the workspace.
+ *
+ * @param monitor
+ * the monitor to report progress to
+ * @throws OpenShiftException
+ * @throws CoreException
+ * @throws InterruptedException
+ * @throws URISyntaxException
+ * @throws InvocationTargetException
+ */
+ public List<IProject> execute(IProgressMonitor monitor)
+ throws OpenShiftException, CoreException, InterruptedException, URISyntaxException,
+ InvocationTargetException {
+ if (cloneDestinationExists()) {
+ throw new WontOverwriteException(
+ NLS.bind("There's already a folder at {0}. The new OpenShift project would overwrite it. " +
+ "Please choose another destination to clone to.",
+ getCloneDestination().getAbsolutePath()));
+ }
+
+ File repositoryFolder =
+ cloneRepository(getApplication(), getRemoteName(), cloneDestination, monitor);
+ List<IProject> importedProjects = importProjectsFrom(repositoryFolder, monitor);
+ if (importedProjects.size() == 0) {
+ throw new ImportFailedException(
+ NLS.bind("Could not import project {0}. One of the possible reasons is that there's already a " +
+ "project in your workspace that matches the openshift application/maven name of the " +
+ "OpenShift application. " +
+ "Please rename your workspace project in that case and start over again."
+ , getProjectName()));
+ }
+
+ connectToGitRepo(importedProjects, repositoryFolder, monitor);
+ return importedProjects;
+ }
+
+ @SuppressWarnings("unused")
+ private void mergeWithApplicationRepository(Repository repository, IApplication application,
+ IProgressMonitor monitor)
+ throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
+ InvocationTargetException {
+ URIish uri = new URIish(application.getGitUri());
+ EGitUtils.addRemoteTo("openshift", uri, repository);
+ EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
+ }
+
+ /**
+ * Imports the projects that are within the given folder. Supports maven and
+ * general projects
+ *
+ * @param folder
+ * the folder the projects are located in
+ * @param monitor
+ * the monitor to report progress to
+ * @return
+ * @throws CoreException
+ * @throws InterruptedException
+ */
+ private List<IProject> importProjectsFrom(final File folder, IProgressMonitor monitor)
+ throws CoreException, InterruptedException {
+ MavenProjectImportOperation mavenImport = new MavenProjectImportOperation(folder);
+ List<IProject> importedProjects = Collections.emptyList();
+ if (mavenImport.isMavenProject()) {
+ importedProjects = mavenImport.importToWorkspace(monitor);
+ } else {
+ importedProjects = new GeneralProjectImportOperation(folder).importToWorkspace(monitor);
+ }
+ return importedProjects;
+ }
+
+ private void connectToGitRepo(List<IProject> projects, File projectFolder, IProgressMonitor monitor)
+ throws CoreException {
+ for (IProject project : projects) {
+ if (project != null) {
+ EGitUtils.connect(project, monitor);
+ }
+ }
+ }
+
+ protected File getCloneDestination() {
+ return cloneDestination;
+ }
+
+ protected boolean cloneDestinationExists() {
+ return cloneDestination != null
+ && cloneDestination.exists();
+ }
+
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectOperation.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectStrategy.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectStrategy.java 2011-12-21 13:58:58 UTC (rev 37489)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportNewProjectStrategy.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -1,145 +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.appimport;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jgit.lib.Repository;
-import org.eclipse.jgit.transport.URIish;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.wst.server.core.IRuntime;
-import org.eclipse.wst.server.core.IServerType;
-import org.jboss.tools.openshift.egit.core.EGitUtils;
-import org.jboss.tools.openshift.express.internal.ui.ImportFailedException;
-import org.jboss.tools.openshift.express.internal.ui.WontOverwriteException;
-import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.GeneralProjectImportOperation;
-import org.jboss.tools.openshift.express.internal.ui.wizard.appimport.project.MavenProjectImportOperation;
-
-import com.openshift.express.client.IApplication;
-import com.openshift.express.client.IUser;
-import com.openshift.express.client.OpenShiftException;
-
-/**
- * @author André Dietisheim <adietish(a)redhat.com>
- */
-public class ImportNewProjectStrategy extends AbstractImportApplicationStrategy {
-
- private File cloneDestination;
-
- public ImportNewProjectStrategy(String projectName, IApplication application, String remoteName,
- File cloneDestination, boolean isCreateServer, IServerType serverType, IRuntime runtime, String mode,
- IUser user) {
- super(projectName, application, remoteName, isCreateServer, serverType, runtime, mode, user);
- this.cloneDestination = cloneDestination;
- }
-
- /**
- * Imports the (new) project that the user has chosen into the workspace.
- *
- * @param monitor
- * the monitor to report progress to
- * @throws OpenShiftException
- * @throws CoreException
- * @throws InterruptedException
- * @throws URISyntaxException
- * @throws InvocationTargetException
- */
- public void execute(IProgressMonitor monitor)
- throws OpenShiftException, CoreException, InterruptedException, URISyntaxException,
- InvocationTargetException {
- if (cloneDestinationExists()) {
- throw new WontOverwriteException(
- NLS.bind("There's already a folder at {0}. The new OpenShift project would overwrite it. " +
- "Please choose another destination to clone to.",
- getCloneDestination().getAbsolutePath()));
- }
-
- File repositoryFolder =
- cloneRepository(getApplication(), getRemoteName(), cloneDestination, monitor);
- List<IProject> importedProjects = importProjectsFrom(repositoryFolder, monitor);
- if (importedProjects.size() == 0) {
- throw new ImportFailedException(
- NLS.bind("Could not import project {0}. One of the possible reasons is that there's already a " +
- "project in your workspace that matches the openshift application/maven name of the " +
- "OpenShift application. " +
- "Please rename your workspace project in that case and start over again."
- , getProjectName()));
- }
-
- connectToGitRepo(importedProjects, repositoryFolder, monitor);
- if (isCreateServer()) {
- createServerAdapter(importedProjects, getServerType(), getRuntime(), getMode(), getApplication(),
- getUser(), monitor);
- }
- }
-
- @SuppressWarnings("unused")
- private void mergeWithApplicationRepository(Repository repository, IApplication application,
- IProgressMonitor monitor)
- throws MalformedURLException, URISyntaxException, IOException, OpenShiftException, CoreException,
- InvocationTargetException {
- URIish uri = new URIish(application.getGitUri());
- EGitUtils.addRemoteTo("openshift", uri, repository);
- EGitUtils.mergeWithRemote(uri, "refs/remotes/openshift/HEAD", repository, monitor);
- }
-
- /**
- * Imports the projects that are within the given folder. Supports maven and
- * general projects
- *
- * @param folder
- * the folder the projects are located in
- * @param monitor
- * the monitor to report progress to
- * @return
- * @throws CoreException
- * @throws InterruptedException
- */
- private List<IProject> importProjectsFrom(final File folder, IProgressMonitor monitor)
- throws CoreException, InterruptedException {
- MavenProjectImportOperation mavenImport = new MavenProjectImportOperation(folder);
- List<IProject> importedProjects = Collections.emptyList();
- if (mavenImport.isMavenProject()) {
- importedProjects = mavenImport.importToWorkspace(monitor);
- } else {
- importedProjects = new GeneralProjectImportOperation(folder).importToWorkspace(monitor);
- }
- return importedProjects;
- }
-
- private void connectToGitRepo(List<IProject> projects, File projectFolder, IProgressMonitor monitor)
- throws CoreException {
- for (IProject project : projects) {
- if (project != null) {
- EGitUtils.connect(project, monitor);
- }
- }
- }
-
- protected File getCloneDestination() {
- return cloneDestination;
- }
-
- protected boolean cloneDestinationExists() {
- return cloneDestination != null
- && cloneDestination.exists();
- }
-
-}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java 2011-12-21 13:58:58 UTC (rev 37489)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ImportProjectWizardModel.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -15,7 +15,10 @@
import java.lang.reflect.InvocationTargetException;
import java.net.URISyntaxException;
import java.util.HashMap;
+import java.util.List;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.wst.server.core.IRuntime;
@@ -62,15 +65,12 @@
*/
public void importProject(IProgressMonitor monitor) throws OpenShiftException, CoreException, InterruptedException,
URISyntaxException, InvocationTargetException {
- new ImportNewProjectStrategy(getProjectName()
+ List<IProject> importedProjects = new ImportNewProjectOperation(getProjectName()
, getApplication()
, getRemoteName()
, getRepositoryFile()
- , isCreateServer()
- , getServerType()
- , getRuntime()
- , getMode()
, getUser()).execute(monitor);
+ createServerAdapter(monitor, importedProjects);
}
/**
@@ -101,18 +101,22 @@
public void addToExistingProject(IProgressMonitor monitor)
throws OpenShiftException, InvocationTargetException, InterruptedException, IOException, CoreException,
URISyntaxException {
- new AddToExistingProjectStrategy(
+ List<IProject> importedProjects = new AddToExistingProjectOperation(
getProjectName()
, getApplication()
, getRemoteName()
- , isCreateServer()
- , getServerType()
- , getRuntime()
- , getMode()
, getUser())
.execute(monitor);
+ createServerAdapter(monitor, importedProjects);
}
+ private void createServerAdapter(IProgressMonitor monitor, List<IProject> importedProjects)
+ throws OpenShiftException {
+ Assert.isTrue(importedProjects.size() > 0);
+ IProject project = importedProjects.get(0);
+ new ServerAdapterFactory().create(project, getServerType(), getRuntime(), getMode(), getApplication(), getUser(), monitor);
+ }
+
public File getRepositoryFile() {
String repositoryPath = getRepositoryPath();
if (repositoryPath == null
Added: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java (rev 0)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java 2011-12-21 14:00:08 UTC (rev 37490)
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * 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.appimport;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IRuntime;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerType;
+import org.eclipse.wst.server.core.IServerWorkingCopy;
+import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.Server;
+import org.jboss.tools.openshift.express.internal.core.behaviour.ExpressServerUtils;
+import org.jboss.tools.openshift.express.internal.ui.OpenShiftUIActivator;
+
+import com.openshift.express.client.IApplication;
+import com.openshift.express.client.IUser;
+import com.openshift.express.client.OpenShiftException;
+
+/**
+ * @author André Dietisheim <adietish(a)redhat.com>
+ */
+class ServerAdapterFactory {
+
+ public ServerAdapterFactory() {
+ }
+
+ public void create(IProject project, IServerType serverType, IRuntime runtime, String mode,
+ IApplication application, IUser user, IProgressMonitor monitor) throws OpenShiftException {
+ createServerAdapter(project, serverType, runtime, mode, application, user, monitor);
+ }
+
+ /**
+ * creates an OpenShift server adapter for the user chosen project.
+ *
+ * @param monitor
+ * the monitor to report progress to.
+ * @throws OpenShiftException
+ */
+ protected void createServerAdapter(IProject project, IServerType serverType, IRuntime runtime, String mode,
+ IApplication application, IUser user, IProgressMonitor monitor) throws OpenShiftException {
+ String name = project.getName();
+ monitor.subTask(NLS.bind("Creating server adapter for project {0}", name));
+ createServerAdapter(Collections.singletonList(project), serverType, runtime, mode, application, user,
+ monitor);
+ }
+
+ protected void createServerAdapter(List<IProject> importedProjects, IServerType serverType,
+ IRuntime runtime, String mode, IApplication application, IUser user, IProgressMonitor monitor) {
+ try {
+ renameWebContextRoot(importedProjects);
+ IServer server = doCreateServerAdapter(serverType, runtime, mode, application, user);
+ addModules(getModules(importedProjects), server, monitor);
+ } catch (CoreException ce) {
+ OpenShiftUIActivator.getDefault().getLog().log(ce.getStatus());
+ } catch (OpenShiftException ose) {
+ IStatus s = new Status(IStatus.ERROR, OpenShiftUIActivator.PLUGIN_ID,
+ "Cannot create openshift server adapter", ose);
+ OpenShiftUIActivator.getDefault().getLog().log(s);
+ }
+ }
+
+ private void renameWebContextRoot(List<IProject> importedProjects) {
+ for (IProject project : importedProjects) {
+ ComponentUtilities.setServerContextRoot(project, "/");
+ }
+ }
+
+ private IServer doCreateServerAdapter(IServerType serverType, IRuntime rt, String mode, IApplication application,
+ IUser user) throws CoreException,
+ OpenShiftException {
+ Assert.isLegal(serverType != null);
+ Assert.isLegal(mode != null);
+ Assert.isLegal(application != null);
+ Assert.isLegal(user != null);
+
+ String serverNameBase = application.getName() + " OpenShift Server";
+ String serverName = org.jboss.ide.eclipse.as.core.util.ServerUtil.getDefaultServerName(serverNameBase);
+
+ IServer server = ExpressServerUtils.createServer(rt, serverType, serverName);
+ ExpressServerUtils.fillServerWithOpenShiftDetails(server, application.getApplicationUrl(),
+ user.getRhlogin(), user.getPassword(),
+ user.getDomain().getNamespace(), application.getName(), application.getUUID(), mode);
+ return server;
+ }
+
+ private void addModules(List<IModule> modules, IServer server, IProgressMonitor monitor) throws CoreException {
+ if (modules == null
+ || modules.size() == 0) {
+ return;
+ }
+ IServerWorkingCopy wc = server.createWorkingCopy();
+ IModule[] add = modules.toArray(new IModule[modules.size()]);
+ wc.modifyModules(add, new IModule[0], new NullProgressMonitor());
+ server = wc.save(true, monitor);
+ ((Server) server).setModulePublishState(add, IServer.PUBLISH_STATE_NONE);
+ }
+
+ private List<IModule> getModules(List<IProject> importedProjects) {
+ Iterator<IProject> i = importedProjects.iterator();
+ ArrayList<IModule> toAdd = new ArrayList<IModule>();
+ while (i.hasNext()) {
+ IProject p = i.next();
+ IModule[] m = ServerUtil.getModules(p);
+ if (m != null && m.length > 0) {
+ toAdd.addAll(Arrays.asList(m));
+ }
+ }
+ return toAdd;
+ }
+}
Property changes on: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/appimport/ServerAdapterFactory.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years
JBoss Tools SVN: r37489 - trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-21 08:58:58 -0500 (Wed, 21 Dec 2011)
New Revision: 37489
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
Log:
[JBIDE-10542] cleaned EGitUtils
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2011-12-21 13:31:39 UTC (rev 37488)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.egit.core/src/org/jboss/tools/openshift/egit/core/EGitUtils.java 2011-12-21 13:58:58 UTC (rev 37489)
@@ -326,8 +326,8 @@
}
/**
- * Pushes the given repository to the remote repository it's current branch
- * originates from.
+ * Pushes the current branch of the given repository to the remote
+ * repository that it originates from.
*
* @param repository
* the repository that shall be pushed
@@ -338,19 +338,7 @@
*/
public static void push(Repository repository, IProgressMonitor monitor)
throws CoreException {
- try {
- RemoteConfig remoteConfig = getRemoteConfig(repository);
- if (remoteConfig == null) {
- throw new CoreException(createStatus(null, "Repository \"{0}\" has no remote repository configured",
- repository.toString()));
- }
- PushOperation pushOperation = createPushOperation(remoteConfig, repository);
- pushOperation.run(monitor);
- } catch (CoreException e) {
- throw e;
- } catch (Exception e) {
- throw new CoreException(createStatus(e, "Could not push repo {0}", repository.toString()));
- }
+ push(repository, getRemoteConfig(repository), monitor);
}
/**
@@ -382,7 +370,22 @@
}
}
- //
+
+ private static void push(Repository repository, RemoteConfig remoteConfig, IProgressMonitor monitor)
+ throws CoreException {
+ try {
+ if (remoteConfig == null) {
+ throw new CoreException(createStatus(null, "Repository \"{0}\" has no remote repository configured",
+ repository.toString()));
+ }
+ createPushOperation(remoteConfig, repository).run(monitor);
+ } catch (CoreException e) {
+ throw e;
+ } catch (Exception e) {
+ throw new CoreException(createStatus(e, "Could not push repo {0}", repository.toString()));
+ }
+ }
+//
// only available in EGit 1.1
//
// private static PushOperation createPushOperation(String remoteName,
@@ -514,7 +517,7 @@
/**
* Returns the configuration of the remote repository that is set to the
- * given repository. Returns
+ * given repository.
* <code>null</null> if none was configured or if there's no remote repo configured.
*
* @param repository
@@ -618,9 +621,9 @@
}
/**
- * Returns the name of the remote repository of the given branch. If there's
- * no current branch or no remote configured to it, the default remote is
- * returned ("origin").
+ * Returns the name of the remote repository for the given branch. If
+ * there's no current branch or no remote configured to it, the default
+ * remote is returned ("origin").
*
* @param branch
* the branch
@@ -636,12 +639,11 @@
remoteName = repository.getConfig().getString(
ConfigConstants.CONFIG_BRANCH_SECTION, branch,
ConfigConstants.CONFIG_REMOTE_SECTION);
+ if (remoteName == null) {
+ remoteName = Constants.DEFAULT_REMOTE_NAME;
+ }
}
- if (remoteName == null) {
- remoteName = Constants.DEFAULT_REMOTE_NAME;
- }
-
return remoteName;
}
14 years
JBoss Tools SVN: r37488 - trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-21 08:31:39 -0500 (Wed, 21 Dec 2011)
New Revision: 37488
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
Log:
[JBIDE-10542] corrected tests
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2011-12-21 13:09:43 UTC (rev 37487)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2011-12-21 13:31:39 UTC (rev 37488)
@@ -87,7 +87,7 @@
testRepository.getRepository(),
new String[] { testUtils.getPathInRepository(file), fileContent });
}
-
+
@Test
public void fileAddedToCloneIsInOriginAfterPush() throws Exception {
String fileName = "b.txt";
@@ -100,7 +100,7 @@
// does origin contain file added to clone?
testUtils.assertRepositoryContainsFilesWithContent(
- clonedTestRepository.getRepository(),
+ testRepository.getRepository(),
fileName,
fileContent);
}
14 years
JBoss Tools SVN: r37487 - trunk/maven/plugins/org.jboss.tools.maven.core.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-21 08:09:43 -0500 (Wed, 21 Dec 2011)
New Revision: 37487
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
Log:
JBIDE-9688 : use same repository id (jboss-releases-repository) as in the repository templates of the pom.xml editor
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2011-12-21 12:53:45 UTC (rev 37486)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2011-12-21 13:09:43 UTC (rev 37487)
@@ -237,7 +237,7 @@
</extension>
<extension point="org.eclipse.m2e.core.indexes">
- <index indexId="jboss_releases" isShort="true"
+ <index indexId="jboss-releases-repository" isShort="true"
repositoryUrl="https://repository.jboss.org/nexus/content/repositories/releases/">
</index>
</extension>
14 years
JBoss Tools SVN: r37486 - trunk/maven/plugins/org.jboss.tools.maven.core.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-12-21 07:53:45 -0500 (Wed, 21 Dec 2011)
New Revision: 37486
Modified:
trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
Log:
JBIDE-9688 : Add JBoss public repository to list of default repositories in Eclipse
Modified: trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2011-12-21 12:20:25 UTC (rev 37485)
+++ trunk/maven/plugins/org.jboss.tools.maven.core/plugin.xml 2011-12-21 12:53:45 UTC (rev 37486)
@@ -235,5 +235,10 @@
</enablement>
</provider>
</extension>
-
+
+ <extension point="org.eclipse.m2e.core.indexes">
+ <index indexId="jboss_releases" isShort="true"
+ repositoryUrl="https://repository.jboss.org/nexus/content/repositories/releases/">
+ </index>
+ </extension>
</plugin>
14 years
JBoss Tools SVN: r37485 - in trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-12-21 07:20:25 -0500 (Wed, 21 Dec 2011)
New Revision: 37485
Modified:
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
Log:
[JBIDE-10542] cleanup tests
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2011-12-21 07:49:34 UTC (rev 37484)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/EGitUtilsTest.java 2011-12-21 12:20:25 UTC (rev 37485)
@@ -79,7 +79,7 @@
testProject.getProject(),
fileName,
fileContent);
- testRepository.track(file);
+ testRepository.add(file);
EGitUtils.commit(testProject.getProject(), null);
@@ -131,7 +131,7 @@
testProject2.getProject(),
fileName,
fileContent);
- testRepository2.track(fileInRepo2);
+ testRepository2.add(fileInRepo2);
File fileInClone = clonedTestRepository.createFile(fileName, fileContent);
clonedTestRepository.addAndCommit(fileInClone, "adding a file");
Modified: trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java
===================================================================
--- trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java 2011-12-21 07:49:34 UTC (rev 37484)
+++ trunk/openshift/tests/org.jboss.tools.openshift.egit.test/src/org/jboss/tools/openshift/egit/internal/test/util/TestRepository.java 2011-12-21 12:20:25 UTC (rev 37485)
@@ -26,7 +26,6 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.egit.core.Activator;
import org.eclipse.egit.core.RepositoryCache;
import org.eclipse.egit.core.op.BranchOperation;
@@ -146,7 +145,7 @@
File file = new File(repoPath, "dummy");
if (!file.exists())
FileUtils.createNewFile(file);
- track(file);
+ add(file);
return commit(message);
}
@@ -199,17 +198,13 @@
*/
public RevCommit addAndCommit(IProject project, File file, String commitMessage)
throws Exception {
- track(file);
- addToIndex(project, file);
-
+ add(file);
return commit(commitMessage);
}
public RevCommit addAndCommit(File file, String commitMessage)
throws Exception {
- track(file);
- addToIndex(file);
-
+ add(file);
return commit(commitMessage);
}
@@ -244,8 +239,8 @@
public RevCommit appendContentAndCommit(IProject project, File file,
String content, String commitMessage) throws Exception {
appendFileContent(file, content);
- track(file);
- addToIndex(project, file);
+ add(file);
+ add(project, file);
return commit(commitMessage);
}
@@ -276,8 +271,8 @@
return commitCommand.call();
}
- public void track(IFile file) throws IOException {
- track(new File(file.getLocation().toOSString()));
+ public void add(IFile file) throws IOException {
+ add(new File(file.getLocation().toOSString()));
}
/**
@@ -286,9 +281,9 @@
* @param file
* @throws IOException
*/
- public void track(File file) throws IOException {
- String repoPath = getRepoRelativePath(
- new Path(file.getPath()).toString());
+ public void add(File file) throws IOException {
+ String repoPath =
+ getRepoRelativePath(file.getAbsolutePath());
try {
new Git(repository).add().addFilepattern(repoPath).call();
} catch (NoFilepatternException e) {
@@ -353,37 +348,12 @@
* @param file
* @throws Exception
*/
- public void addToIndex(IProject project, File file) throws Exception {
- IFile iFile = getIFile(project, file);
- addToIndex(iFile);
+ public void add(IProject project, File file) throws Exception {
+ IFile iFile = getFile(project, file);
+ add(iFile);
}
/**
- * Adds the given file to the index
- *
- * @param file
- * @throws CoreException
- * @throws IOException
- */
- public void addToIndex(IFile file) throws CoreException, IOException {
- String repoPath = getRepoRelativePath(file.getLocation().toOSString());
- try {
- new Git(repository).add().addFilepattern(repoPath).call();
- } catch (NoFilepatternException e) {
- throw new IOException(e.getMessage());
- }
- }
-
- public void addToIndex(File file) throws CoreException, IOException {
- String repoPath = getRepoRelativePath(file.getAbsolutePath());
- try {
- new Git(repository).add().addFilepattern(repoPath).call();
- } catch (NoFilepatternException e) {
- throw new IOException(e.getMessage());
- }
- }
-
- /**
* Appends content to end of given file.
*
* @param file
@@ -504,7 +474,7 @@
return null;
}
- public IFile getIFile(IProject project, File file) throws CoreException {
+ public IFile getFile(IProject project, File file) throws CoreException {
String relativePath = getRepoRelativePath(file.getAbsolutePath());
String quotedProjectName = Pattern.quote(project.getName());
@@ -589,7 +559,7 @@
SystemReader.setInstance(mockSystemReader);
mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY, ceilingPath.toOSString());
}
-
+
public File getGitDir() {
return gitDir;
}
14 years
JBoss Tools SVN: r37484 - 1 and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-12-21 02:49:34 -0500 (Wed, 21 Dec 2011)
New Revision: 37484
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975( 1 )/CSSImportConstruction.html.xml
Log:
https://issues.jboss.org/browse/JBIDE-5861 - junit was updated.
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975( 1 )/CSSImportConstruction.html.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975( 1 )/CSSImportConstruction.html.xml 2011-12-21 07:47:11 UTC (rev 37483)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide9975( 1 )/CSSImportConstruction.html.xml 2011-12-21 07:49:34 UTC (rev 37484)
@@ -1,52 +1,13 @@
<tests>
<test id="id1">
<TD>
- background-attachment: scroll;
background-color: transparent;
background-image: none;
background-position: 0% 0%;
- background-repeat: repeat;
- border-bottom-color: rgb(128, 128, 128);
- border-bottom-style: none;
- border-bottom-width: 0px;
- border-collapse: separate;
- border-left-color: rgb(128, 128, 128);
- border-left-style: none;
- border-left-width: 0px;
- border-right-color: rgb(128, 128, 128);
- border-right-style: none;
- border-right-width: 0px;
- border-spacing: 0px 0px;
- border-top-color: rgb(128, 128, 128);
- border-top-style: none;
- border-top-width: 0px;
- bottom: auto;
- caption-side: top;
- clear: none;
- clip: auto;
color: rgb(0, 0, 0);
content: none;
- counter-increment: none;
- counter-reset: none;
- cursor: auto;
- direction: ltr;
- display: table-cell;
- float: none;
font-family: serif;
font-size: 16px;
- font-size-adjust: none;
- font-stretch: normal;
- font-style: normal;
- font-variant: normal;
- font-weight: 400;
- left: auto;
- table-layout: auto;
- text-align: start;
- text-decoration: none;
- text-indent: 0px;
- text-shadow: none;
- text-transform: none;
- top: auto;
vertical-align: middle;
visibility: visible;
white-space: normal;
@@ -54,38 +15,13 @@
</test>
<test id="id2">
<DIV>
- background-attachment: scroll;
background-color: rgb(255, 0, 0);
- background-image:
- url("file:///D:/Projects/jbds/jsf/WebContent/css(2)/print_share_sprite.png");
- background-position: 0% 0%;
- background-repeat: no-repeat;
- float: none;
- font-family: serif;
- font-size: 16px;
- font-size-adjust: none;
- font-stretch: normal;
- font-style: normal;
- font-variant: normal;
font-weight: bold;
</DIV>
</test>
<test id="id3">
<DIV>
- background-attachment: scroll;
background-color: rgb(0, 128, 0);
- background-image:
- url("file:///D:/Projects/jbds/jsf/WebContent/css/print_share_sprite.png");
- background-position: 0% 0%;
- background-repeat: no-repeat;
- border-bottom-color: rgb(0, 0, 0);
- float: none;
- font-family: serif;
- font-size: 16px;
- font-size-adjust: none;
- font-stretch: normal;
- font-style: normal;
- font-variant: normal;
font-weight: bold;
</DIV>
</test>
14 years
JBoss Tools SVN: r37483 - in trunk/vpe/plugins: org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-12-21 02:47:11 -0500 (Wed, 21 Dec 2011)
New Revision: 37483
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/DOMTreeDumper.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
Log:
https://issues.jboss.org/browse/JBIDE-5861 - comments were added.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2011-12-21 06:29:43 UTC (rev 37482)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VpeStyleUtil.java 2011-12-21 07:47:11 UTC (rev 37483)
@@ -940,10 +940,22 @@
return uri;
}
+ /**
+ * Removes all the CSS @import constructions from the text
+ *
+ * @param cssText the css text
+ * @return updated string
+ */
public static String removeAllCssImportConstructions(String cssText) {
return CSS_IMPORT_PATTERN.matcher(cssText).replaceAll(Constants.EMPTY);
}
+ /**
+ * Removes all the CSS comments from the text
+ *
+ * @param cssText the css text
+ * @return updated string
+ */
public static String removeAllCssComments(String cssText) {
return CSS_COMMENT_PATTERN.matcher(cssText).replaceAll(Constants.EMPTY);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/DOMTreeDumper.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/DOMTreeDumper.java 2011-12-21 06:29:43 UTC (rev 37482)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/util/DOMTreeDumper.java 2011-12-21 07:47:11 UTC (rev 37483)
@@ -147,7 +147,11 @@
dumpNode(node, false);
}
-
+ /**
+ * Dumps the CSS style for the visual node
+ *
+ * @param vpeNode visual node
+ */
public void dumpStyle(nsIDOMNode vpeNode) {
if (vpeNode != null) {
final nsIDOMDocumentView view = queryInterface(vpeNode.getOwnerDocument(), nsIDOMDocumentView.class);
14 years