JBoss Tools SVN: r42918 - branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.ui.bot.test.
by jbosstools-commits@lists.jboss.org
Author: ljelinko
Date: 2012-08-08 08:25:50 -0400 (Wed, 08 Aug 2012)
New Revision: 42918
Modified:
branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
Log:
Added dependency to xulrunner.
Modified: branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml
===================================================================
--- branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml 2012-08-08 11:02:26 UTC (rev 42917)
+++ branches/jbosstools-3.3.x/as/tests/org.jboss.ide.eclipse.as.ui.bot.test/pom.xml 2012-08-08 12:25:50 UTC (rev 42918)
@@ -82,12 +82,20 @@
<testSuite>org.jboss.ide.eclipse.as.ui.bot.test</testSuite>
<testClass>${test.class}</testClass>
<skip>${swtbot.test.skip}</skip>
+ <explodedBundles>
+ <explodedBundle>org.mozilla.xulrunner.gtk.linux.x86_64</explodedBundle>
+ </explodedBundles>
<dependencies combine.children="append">
<dependency>
<type>p2-installable-unit</type>
<artifactId>org.jboss.ide.eclipse.as.feature.feature.group</artifactId>
<version>0.0.0</version>
</dependency>
+ <dependency>
+ <type>p2-installable-unit</type>
+ <artifactId>org.jboss.tools.xulrunner.feature.feature.group</artifactId>
+ <version>0.0.0</version>
+ </dependency>
</dependencies>
</configuration>
</plugin>
12 years, 5 months
JBoss Tools SVN: r42917 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-08 07:02:26 -0400 (Wed, 08 Aug 2012)
New Revision: 42917
Added:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java
Log:
JBIDE-11927 part 2 to trunk
Added: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java (rev 0)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java 2012-08-08 11:02:26 UTC (rev 42917)
@@ -0,0 +1,65 @@
+package org.jboss.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModel;
+import org.jboss.ide.eclipse.archives.core.project.ArchivesNature;
+import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+
+public class DisableHandler extends AbstractHandler implements IHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil
+ .getCurrentSelectionChecked(event);
+ final Object e = selection.getFirstElement();
+ if (e instanceof IProject) {
+ String pName = ((IProject)e).getName();
+ final String jobName = NLS.bind(ArchivesUIMessages.DisableProjectArchivesJob, pName);
+ new Job(jobName) {
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(jobName, 300);
+ CoreException ce = null;
+ try {
+ SubProgressMonitor deletionMonitor = new SubProgressMonitor(monitor, 100);
+ IResource r = ((IProject)e).getFile(IArchiveModel.DEFAULT_PACKAGES_FILE);
+ if( r != null && r.exists() )
+ r.delete(true, deletionMonitor);
+
+ } catch(CoreException ce2) {
+ ce = ce2;
+ }
+
+ IPath loc = ((IProject) e).getLocation();
+ SubProgressMonitor mon1 = new SubProgressMonitor(monitor, 100);
+ ProjectUtils.removeProjectNature(((IProject) e), ArchivesNature.NATURE_ID, mon1);
+
+ SubProgressMonitor mon2 = new SubProgressMonitor(monitor, 100);
+ ArchivesModel.instance().unregisterProject(loc, mon2);
+
+ return ce == null ? Status.OK_STATUS : new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID,
+ "Unable to fully remove project archives support."); //$NON-NLS-1$
+ }
+ }.schedule();
+ }
+ return null; }
+
+}
Added: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java (rev 0)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java 2012-08-08 11:02:26 UTC (rev 42917)
@@ -0,0 +1,45 @@
+package org.jboss.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.project.ArchivesNature;
+import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+
+public class EnableHandler extends AbstractHandler {
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil
+ .getCurrentSelectionChecked(event);
+ final Object e = selection.getFirstElement();
+ if (e instanceof IProject) {
+ String pName = ((IProject)e).getName();
+ final String jobName = NLS.bind(ArchivesUIMessages.EnableProjectArchivesJob, pName);
+ new Job(jobName) {
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(jobName, 200);
+ IPath loc = ((IProject) e).getLocation();
+
+ SubProgressMonitor mon1 = new SubProgressMonitor(monitor, 100);
+ ProjectUtils.addProjectNature(((IProject) e), ArchivesNature.NATURE_ID, mon1);
+
+ SubProgressMonitor mon2 = new SubProgressMonitor(monitor, 100);
+ ArchivesModel.instance().registerProject(loc, mon2);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ return null;
+ }
+}
12 years, 5 months
JBoss Tools SVN: r42916 - branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-08 07:00:18 -0400 (Wed, 08 Aug 2012)
New Revision: 42916
Removed:
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java
Log:
JBIDE-11927 part 3 to maintenance
Deleted: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java 2012-08-08 10:59:36 UTC (rev 42915)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java 2012-08-08 11:00:18 UTC (rev 42916)
@@ -1,28 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.actions;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-public class RemoveProjectArchivesSupportAction implements
- IObjectActionDelegate {
-
- public RemoveProjectArchivesSupportAction() {
- }
-
- public void run(IAction action) {
- System.out.println("Removing support"); //$NON-NLS-1$
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // TODO Auto-generated method stub
-
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // TODO Auto-generated method stub
-
- }
-
-}
12 years, 5 months
JBoss Tools SVN: r42915 - branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-08 06:59:36 -0400 (Wed, 08 Aug 2012)
New Revision: 42915
Added:
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java
Log:
JBIDE-11927 part 2 to maintenance
Added: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java (rev 0)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/DisableHandler.java 2012-08-08 10:59:36 UTC (rev 42915)
@@ -0,0 +1,65 @@
+package org.jboss.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
+import org.jboss.ide.eclipse.archives.core.ArchivesCorePlugin;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModel;
+import org.jboss.ide.eclipse.archives.core.project.ArchivesNature;
+import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+
+public class DisableHandler extends AbstractHandler implements IHandler {
+
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil
+ .getCurrentSelectionChecked(event);
+ final Object e = selection.getFirstElement();
+ if (e instanceof IProject) {
+ String pName = ((IProject)e).getName();
+ final String jobName = NLS.bind(ArchivesUIMessages.DisableProjectArchivesJob, pName);
+ new Job(jobName) {
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(jobName, 300);
+ CoreException ce = null;
+ try {
+ SubProgressMonitor deletionMonitor = new SubProgressMonitor(monitor, 100);
+ IResource r = ((IProject)e).getFile(IArchiveModel.DEFAULT_PACKAGES_FILE);
+ if( r != null && r.exists() )
+ r.delete(true, deletionMonitor);
+
+ } catch(CoreException ce2) {
+ ce = ce2;
+ }
+
+ IPath loc = ((IProject) e).getLocation();
+ SubProgressMonitor mon1 = new SubProgressMonitor(monitor, 100);
+ ProjectUtils.removeProjectNature(((IProject) e), ArchivesNature.NATURE_ID, mon1);
+
+ SubProgressMonitor mon2 = new SubProgressMonitor(monitor, 100);
+ ArchivesModel.instance().unregisterProject(loc, mon2);
+
+ return ce == null ? Status.OK_STATUS : new Status(IStatus.ERROR, ArchivesCorePlugin.PLUGIN_ID,
+ "Unable to fully remove project archives support."); //$NON-NLS-1$
+ }
+ }.schedule();
+ }
+ return null; }
+
+}
Added: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java (rev 0)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/EnableHandler.java 2012-08-08 10:59:36 UTC (rev 42915)
@@ -0,0 +1,45 @@
+package org.jboss.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.project.ArchivesNature;
+import org.jboss.ide.eclipse.archives.core.project.ProjectUtils;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+
+public class EnableHandler extends AbstractHandler {
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ IStructuredSelection selection = (IStructuredSelection) HandlerUtil
+ .getCurrentSelectionChecked(event);
+ final Object e = selection.getFirstElement();
+ if (e instanceof IProject) {
+ String pName = ((IProject)e).getName();
+ final String jobName = NLS.bind(ArchivesUIMessages.EnableProjectArchivesJob, pName);
+ new Job(jobName) {
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(jobName, 200);
+ IPath loc = ((IProject) e).getLocation();
+
+ SubProgressMonitor mon1 = new SubProgressMonitor(monitor, 100);
+ ProjectUtils.addProjectNature(((IProject) e), ArchivesNature.NATURE_ID, mon1);
+
+ SubProgressMonitor mon2 = new SubProgressMonitor(monitor, 100);
+ ArchivesModel.instance().registerProject(loc, mon2);
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+ return null;
+ }
+}
Added: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java (rev 0)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/actions/RemoveProjectArchivesSupportAction.java 2012-08-08 10:59:36 UTC (rev 42915)
@@ -0,0 +1,28 @@
+package org.jboss.ide.eclipse.archives.ui.actions;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class RemoveProjectArchivesSupportAction implements
+ IObjectActionDelegate {
+
+ public RemoveProjectArchivesSupportAction() {
+ }
+
+ public void run(IAction action) {
+ System.out.println("Removing support"); //$NON-NLS-1$
+ }
+
+ public void selectionChanged(IAction action, ISelection selection) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
12 years, 5 months
JBoss Tools SVN: r42914 - in trunk/archives/plugins: org.jboss.ide.eclipse.archives.ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-08 06:55:18 -0400 (Wed, 08 Aug 2012)
New Revision: 42914
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
Log:
JBIDE-11927 to trunk
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java 2012-08-08 10:54:55 UTC (rev 42913)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java 2012-08-08 10:55:18 UTC (rev 42914)
@@ -10,47 +10,111 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.core.project;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
public class ProjectUtils {
-
+
public static boolean addProjectNature(IPath path) {
- IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for( int i = 0; i < allProjects.length; i++ ) {
- if( allProjects[i].getLocation().equals(path)) {
- return addProjectNature(allProjects[i], ArchivesNature.NATURE_ID);
+ IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < allProjects.length; i++) {
+ if (allProjects[i].getLocation().equals(path)) {
+ return addProjectNature(allProjects[i],
+ ArchivesNature.NATURE_ID);
}
}
return false;
}
- public static boolean addProjectNature(IProject project, String natureId) {
- boolean added = false;
- try {
- if (project != null && natureId != null) {
- IProjectDescription desc = project.getDescription();
-
- if (!project.hasNature(natureId)) {
- String natureIds[] = desc.getNatureIds();
- String newNatureIds[] = new String[natureIds.length + 1];
-
- System.arraycopy(natureIds, 0, newNatureIds, 1, natureIds.length);
- newNatureIds[0] = natureId;
- desc.setNatureIds(newNatureIds);
-
- project.getProject().setDescription(desc, new NullProgressMonitor());
- added = true;
- }
- }
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return added;
- }
+ public static boolean addProjectNature(IProject project, String natureId) {
+ return addProjectNature(project, natureId, null);
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean addProjectNature(IProject project, String natureId, IProgressMonitor monitor) {
+ monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ boolean added = false;
+ try {
+ if (project != null && natureId != null) {
+ IProjectDescription desc = project.getDescription();
+ if (!project.hasNature(natureId)) {
+ String natureIds[] = desc.getNatureIds();
+ String newNatureIds[] = new String[natureIds.length + 1];
+
+ System.arraycopy(natureIds, 0, newNatureIds, 1,
+ natureIds.length);
+ newNatureIds[0] = natureId;
+ desc.setNatureIds(newNatureIds);
+
+ project.getProject().setDescription(desc, monitor);
+ added = true;
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return added;
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IPath path) {
+ IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < allProjects.length; i++) {
+ if (allProjects[i].getLocation().equals(path)) {
+ return removeProjectNature(allProjects[i],
+ ArchivesNature.NATURE_ID);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IProject project, String natureId) {
+ return removeProjectNature(project, natureId, null);
+ }
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IProject project, String natureId, IProgressMonitor monitor) {
+ monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ boolean removed = false;
+ try {
+ if (project != null && natureId != null) {
+ IProjectDescription desc = project.getDescription();
+ if (project.hasNature(natureId)) {
+ String natureIds[] = desc.getNatureIds();
+ List<String> l = Arrays.asList(natureIds);
+ ArrayList<String> newDesc = new ArrayList<String>();
+ newDesc.addAll(l);
+ newDesc.remove(natureId);
+ String[] asArr = (String[]) newDesc.toArray(new String[newDesc.size()]);
+ desc.setNatureIds(asArr);
+ project.getProject().setDescription(desc, monitor);
+ removed = true;
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return removed;
+ }
+
}
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2012-08-08 10:54:55 UTC (rev 42913)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2012-08-08 10:55:18 UTC (rev 42914)
@@ -245,4 +245,64 @@
sequence="M3+M2+Y B">
</key>
</extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.jboss.ide.eclipse.archives.ui.actions.EnableHandler"
+ id="org.jboss.ide.eclipse.archives.ui.actions.enableProjectArchives"
+ name="Add Project Archives Support">
+ </command>
+ <command
+ defaultHandler="org.jboss.ide.eclipse.archives.ui.actions.DisableHandler"
+ id="org.jboss.ide.eclipse.archives.ui.actions.disableProjectArchives"
+ name="Remove Project Archives Support">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.projectConfigure?before=additions">
+ <command
+ commandId="org.jboss.ide.eclipse.archives.ui.actions.enableProjectArchives"
+ label="Add Project Archives Support"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count value="1"/>
+ <with variable="activeMenuSelection"/>
+ <iterate ifEmpty="false" operator="and">
+ <adapt type="org.eclipse.core.resources.IResource"/>
+ <not><test
+ forcePluginActivation="false"
+ property="org.eclipse.core.resources.projectNature"
+ value="org.jboss.ide.eclipse.archives.core.archivesNature">
+ </test> </not>
+ </iterate></and>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.jboss.ide.eclipse.archives.ui.actions.disableProjectArchives"
+ label="Remove Project Archives Support"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count value="1"/>
+ <with variable="activeMenuSelection"/>
+ <iterate ifEmpty="false" operator="and">
+ <adapt type="org.eclipse.core.resources.IResource"/>
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.core.resources.projectNature"
+ value="org.jboss.ide.eclipse.archives.core.archivesNature">
+ </test>
+ </iterate></and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
</plugin>
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2012-08-08 10:54:55 UTC (rev 42913)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2012-08-08 10:55:18 UTC (rev 42914)
@@ -115,6 +115,9 @@
public static String deleteNodeMBDesc;
public static String deleteNodeMBToggle;
+ public static String EnableProjectArchivesJob;
+ public static String DisableProjectArchivesJob;
+ public static String DisableProjectArchivesJobError;
static {
NLS.initializeMessages("org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages", ArchivesUIMessages.class); //$NON-NLS-1$
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2012-08-08 10:54:55 UTC (rev 42913)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2012-08-08 10:55:18 UTC (rev 42914)
@@ -97,3 +97,6 @@
deleteNodeMBTitle=Delete this node?
deleteNodeMBDesc=Are you sure you want to delete this node? This cannot be undone.
deleteNodeMBToggle=Always delete without prompting.
+EnableProjectArchivesJob=Enabling Project Archives on project {0}
+DisableProjectArchivesJob=Disabling Project Archives on project {0}
+DisableProjectArchivesJobError=Unable to completely remove Project Archives support on project {0}
\ No newline at end of file
12 years, 5 months
JBoss Tools SVN: r42913 - in branches/jbosstools-3.3.x/archives/plugins: org.jboss.ide.eclipse.archives.ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2012-08-08 06:54:55 -0400 (Wed, 08 Aug 2012)
New Revision: 42913
Modified:
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
Log:
JBIDE-11927 to maintenance
Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java 2012-08-08 10:51:05 UTC (rev 42912)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.core/src/eclipse/org/jboss/ide/eclipse/archives/core/project/ProjectUtils.java 2012-08-08 10:54:55 UTC (rev 42913)
@@ -10,47 +10,111 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.core.project;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
public class ProjectUtils {
-
+
public static boolean addProjectNature(IPath path) {
- IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- for( int i = 0; i < allProjects.length; i++ ) {
- if( allProjects[i].getLocation().equals(path)) {
- return addProjectNature(allProjects[i], ArchivesNature.NATURE_ID);
+ IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < allProjects.length; i++) {
+ if (allProjects[i].getLocation().equals(path)) {
+ return addProjectNature(allProjects[i],
+ ArchivesNature.NATURE_ID);
}
}
return false;
}
- public static boolean addProjectNature(IProject project, String natureId) {
- boolean added = false;
- try {
- if (project != null && natureId != null) {
- IProjectDescription desc = project.getDescription();
-
- if (!project.hasNature(natureId)) {
- String natureIds[] = desc.getNatureIds();
- String newNatureIds[] = new String[natureIds.length + 1];
-
- System.arraycopy(natureIds, 0, newNatureIds, 1, natureIds.length);
- newNatureIds[0] = natureId;
- desc.setNatureIds(newNatureIds);
-
- project.getProject().setDescription(desc, new NullProgressMonitor());
- added = true;
- }
- }
- } catch (CoreException e) {
- e.printStackTrace();
- }
- return added;
- }
+ public static boolean addProjectNature(IProject project, String natureId) {
+ return addProjectNature(project, natureId, null);
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean addProjectNature(IProject project, String natureId, IProgressMonitor monitor) {
+ monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ boolean added = false;
+ try {
+ if (project != null && natureId != null) {
+ IProjectDescription desc = project.getDescription();
+ if (!project.hasNature(natureId)) {
+ String natureIds[] = desc.getNatureIds();
+ String newNatureIds[] = new String[natureIds.length + 1];
+
+ System.arraycopy(natureIds, 0, newNatureIds, 1,
+ natureIds.length);
+ newNatureIds[0] = natureId;
+ desc.setNatureIds(newNatureIds);
+
+ project.getProject().setDescription(desc, monitor);
+ added = true;
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return added;
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IPath path) {
+ IProject[] allProjects = ResourcesPlugin.getWorkspace().getRoot()
+ .getProjects();
+ for (int i = 0; i < allProjects.length; i++) {
+ if (allProjects[i].getLocation().equals(path)) {
+ return removeProjectNature(allProjects[i],
+ ArchivesNature.NATURE_ID);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IProject project, String natureId) {
+ return removeProjectNature(project, natureId, null);
+ }
+ /**
+ * @since 3.3
+ */
+ public static boolean removeProjectNature(IProject project, String natureId, IProgressMonitor monitor) {
+ monitor = monitor == null ? new NullProgressMonitor() : monitor;
+ boolean removed = false;
+ try {
+ if (project != null && natureId != null) {
+ IProjectDescription desc = project.getDescription();
+ if (project.hasNature(natureId)) {
+ String natureIds[] = desc.getNatureIds();
+ List<String> l = Arrays.asList(natureIds);
+ ArrayList<String> newDesc = new ArrayList<String>();
+ newDesc.addAll(l);
+ newDesc.remove(natureId);
+ String[] asArr = (String[]) newDesc.toArray(new String[newDesc.size()]);
+ desc.setNatureIds(asArr);
+ project.getProject().setDescription(desc, monitor);
+ removed = true;
+ }
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ return removed;
+ }
+
}
Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2012-08-08 10:51:05 UTC (rev 42912)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2012-08-08 10:54:55 UTC (rev 42913)
@@ -245,4 +245,64 @@
sequence="M3+M2+Y B">
</key>
</extension>
+
+ <extension
+ point="org.eclipse.ui.commands">
+ <command
+ defaultHandler="org.jboss.ide.eclipse.archives.ui.actions.EnableHandler"
+ id="org.jboss.ide.eclipse.archives.ui.actions.enableProjectArchives"
+ name="Add Project Archives Support">
+ </command>
+ <command
+ defaultHandler="org.jboss.ide.eclipse.archives.ui.actions.DisableHandler"
+ id="org.jboss.ide.eclipse.archives.ui.actions.disableProjectArchives"
+ name="Remove Project Archives Support">
+ </command>
+ </extension>
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="false"
+ locationURI="popup:org.eclipse.ui.projectConfigure?before=additions">
+ <command
+ commandId="org.jboss.ide.eclipse.archives.ui.actions.enableProjectArchives"
+ label="Add Project Archives Support"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count value="1"/>
+ <with variable="activeMenuSelection"/>
+ <iterate ifEmpty="false" operator="and">
+ <adapt type="org.eclipse.core.resources.IResource"/>
+ <not><test
+ forcePluginActivation="false"
+ property="org.eclipse.core.resources.projectNature"
+ value="org.jboss.ide.eclipse.archives.core.archivesNature">
+ </test> </not>
+ </iterate></and>
+ </visibleWhen>
+ </command>
+
+ <command
+ commandId="org.jboss.ide.eclipse.archives.ui.actions.disableProjectArchives"
+ label="Remove Project Archives Support"
+ style="push">
+ <visibleWhen
+ checkEnabled="false">
+ <and>
+ <count value="1"/>
+ <with variable="activeMenuSelection"/>
+ <iterate ifEmpty="false" operator="and">
+ <adapt type="org.eclipse.core.resources.IResource"/>
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.core.resources.projectNature"
+ value="org.jboss.ide.eclipse.archives.core.archivesNature">
+ </test>
+ </iterate></and>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ </extension>
</plugin>
Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2012-08-08 10:51:05 UTC (rev 42912)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2012-08-08 10:54:55 UTC (rev 42913)
@@ -115,6 +115,9 @@
public static String deleteNodeMBDesc;
public static String deleteNodeMBToggle;
+ public static String EnableProjectArchivesJob;
+ public static String DisableProjectArchivesJob;
+ public static String DisableProjectArchivesJobError;
static {
NLS.initializeMessages("org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages", ArchivesUIMessages.class); //$NON-NLS-1$
Modified: branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
--- branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2012-08-08 10:51:05 UTC (rev 42912)
+++ branches/jbosstools-3.3.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2012-08-08 10:54:55 UTC (rev 42913)
@@ -97,3 +97,6 @@
deleteNodeMBTitle=Delete this node?
deleteNodeMBDesc=Are you sure you want to delete this node? This cannot be undone.
deleteNodeMBToggle=Always delete without prompting.
+EnableProjectArchivesJob=Enabling Project Archives on project {0}
+DisableProjectArchivesJob=Disabling Project Archives on project {0}
+DisableProjectArchivesJobError=Unable to completely remove Project Archives support on project {0}
\ No newline at end of file
12 years, 5 months
JBoss Tools SVN: r42912 - in trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test: src and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jpeterka
Date: 2012-08-08 06:51:05 -0400 (Wed, 08 Aug 2012)
New Revision: 42912
Added:
trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/log4j.xml
Modified:
trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/META-INF/MANIFEST.MF
trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/org/jboss/tools/dummy/ui/bot/test/DummyTest.java
Log:
Dummy bot test adde log4j.xml + minor updates
Modified: trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/META-INF/MANIFEST.MF 2012-08-08 10:46:01 UTC (rev 42911)
+++ trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/META-INF/MANIFEST.MF 2012-08-08 10:51:05 UTC (rev 42912)
@@ -1,13 +1,12 @@
Manifest-Version: 1.0
+Eclipse-RegisterBuddy: org.apache.log4j
Bundle-ManifestVersion: 2
Bundle-Name: Test
Bundle-SymbolicName: org.jboss.tools.dummy.ui.bot.test
Bundle-Version: 3.4.0.qualifier
Bundle-Activator: org.jboss.tools.dummy.ui.bot.test.Activator
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.swtbot.go;bundle-version="2.0.5",
- org.apache.log4j
-Eclipse-RegisterBuddy: org.apache.log4j
+ org.eclipse.core.runtime,org.apache.log4j,
+ org.eclipse.swtbot.go;bundle-version="2.0.5"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Added: trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/log4j.xml
===================================================================
(Binary files differ)
Property changes on: trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/log4j.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Modified: trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/org/jboss/tools/dummy/ui/bot/test/DummyTest.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/org/jboss/tools/dummy/ui/bot/test/DummyTest.java 2012-08-08 10:46:01 UTC (rev 42911)
+++ trunk/tests/tests/org.jboss.tools.dummy.ui.bot.test/src/org/jboss/tools/dummy/ui/bot/test/DummyTest.java 2012-08-08 10:51:05 UTC (rev 42912)
@@ -21,7 +21,7 @@
@RunWith(SWTBotJunit4ClassRunner.class)
public class DummyTest {
- static Logger log = Logger.getLogger("");
+ Logger log = Logger.getLogger("");
@BeforeClass
public static void before() {
12 years, 5 months
JBoss Tools SVN: r42910 - trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext.
by jbosstools-commits@lists.jboss.org
Author: vpakan(a)redhat.com
Date: 2012-08-08 06:33:57 -0400 (Wed, 08 Aug 2012)
New Revision: 42910
Modified:
trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
Log:
Add method waitForShellWithTextIsFound()
Modified: trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java
===================================================================
--- trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2012-08-08 10:30:50 UTC (rev 42909)
+++ trunk/tests/plugins/org.jboss.tools.ui.bot.ext/src/org/jboss/tools/ui/bot/ext/SWTUtilExt.java 2012-08-08 10:33:57 UTC (rev 42910)
@@ -1110,4 +1110,37 @@
},
timeout);
}
+ /**
+ * Waits until shell with text is found with timeout
+ * @param text
+ * @param timeout
+ */
+ public void waitForShellWithTextIsFound (final String text, final long timeout) {
+ bot.waitUntil(new ICondition() {
+
+ @Override
+ public boolean test() throws Exception {
+ boolean shellIsFound = false;
+ try {
+ bot.shell(text);
+ shellIsFound = true;
+ }
+ catch (WidgetNotFoundException wnfe){
+ shellIsFound = false;
+ }
+ return shellIsFound;
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "Shell with text " + text +
+ " was not available " + timeout + " miliseconds";
+ }
+ },
+ timeout);
+ }
}
\ No newline at end of file
12 years, 5 months