Author: dazarov
Date: 2009-05-19 10:32:53 -0400 (Tue, 19 May 2009)
New Revision: 15346
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4262
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-19
14:07:58 UTC (rev 15345)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-05-19
14:32:53 UTC (rev 15346)
@@ -18,6 +18,8 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -48,11 +50,11 @@
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
IEditorPart editor = HandlerUtil.getActiveEditor(event);
+ Shell activeShell = HandlerUtil.getActiveShell(event);
IEditorInput input = editor.getEditorInput();
if (input instanceof IFileEditorInput) {
IFile file = ((IFileEditorInput)input).getFile();
- Shell activeShell = HandlerUtil.getActiveShell(event);
IProject project = file.getProject();
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
@@ -72,12 +74,20 @@
}
}
}
+ invokeRenameWizard(null, activeShell);
return null;
}
public static void invokeRenameWizard(ISeamComponent component, Shell activeShell) {
if(!SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
return;
+
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+
RenameComponentProcessor processor = new RenameComponentProcessor(component);
RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
RenameComponentWizard wizard = new RenameComponentWizard(refactoring, component);