Author: koen.aers(a)jboss.com
Date: 2011-05-10 04:31:41 -0400 (Tue, 10 May 2011)
New Revision: 31174
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectConfigurationUpdater.java
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
Log:
update project configuration after setting up prettyfaces
Modified:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-05-10
06:45:39 UTC (rev 31173)
+++
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/console/CommandRecorder.java 2011-05-10
08:31:41 UTC (rev 31174)
@@ -25,6 +25,7 @@
import org.eclipse.ui.part.ISetSelectionTarget;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.seam.forge.ForgePlugin;
+import org.jboss.tools.seam.forge.importer.ProjectConfigurationUpdater;
import org.jboss.tools.seam.forge.importer.ProjectImporter;
public class CommandRecorder implements IDocumentListener {
@@ -167,6 +168,7 @@
ForgePlugin.log(e);
}
}
+ new ProjectConfigurationUpdater(project).updateProject();
IViewPart projectExplorer =
workbenchPage.findView("org.eclipse.ui.navigator.ProjectExplorer");
if (projectExplorer != null && projectExplorer instanceof
ISetSelectionTarget) {
((ISetSelectionTarget)projectExplorer).selectReveal(new
StructuredSelection(objectToSelect));
Added:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectConfigurationUpdater.java
===================================================================
---
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectConfigurationUpdater.java
(rev 0)
+++
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectConfigurationUpdater.java 2011-05-10
08:31:41 UTC (rev 31174)
@@ -0,0 +1,37 @@
+package org.jboss.tools.seam.forge.importer;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.m2e.core.MavenPlugin;
+
+public class ProjectConfigurationUpdater {
+
+ private IProject project;
+
+ public ProjectConfigurationUpdater(IProject project) {
+ this.project = project;
+ }
+
+ public void updateProject() {
+ Job job = new WorkspaceJob("Importing Forge project") {
+ public IStatus runInWorkspace(IProgressMonitor monitor) {
+ try {
+
MavenPlugin.getDefault().getProjectConfigurationManager().updateProjectConfiguration(
+ project,
+ monitor);
+ } catch(CoreException ex) {
+ return ex.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ job.setRule(MavenPlugin.getDefault().getProjectConfigurationManager().getRule());
+ job.schedule();
+ }
+
+}
Property changes on:
trunk/forge/plugins/org.jboss.tools.seam.forge/src/org/jboss/tools/seam/forge/importer/ProjectConfigurationUpdater.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Show replies by date