Author: dazarov
Date: 2009-11-05 09:39:41 -0500 (Thu, 05 Nov 2009)
New Revision: 18415
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIUtil.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5139
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIUtil.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIUtil.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIUtil.java 2009-11-05
14:39:41 UTC (rev 18415)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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.seam.ui;
+
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.ui.internal.Workbench;
+import org.eclipse.ui.navigator.CommonNavigator;
+
+/**
+ * @author Daniel Azarov
+ */
+
+public class SeamUIUtil {
+ public static void refreshSeamComponentView(){
+ CommonNavigator navigator =
(CommonNavigator)Workbench.getInstance().getActiveWorkbenchWindow().getActivePage().findView("org.jboss.tools.seam.ui.views.SeamComponentsNavigator");
+ if(navigator != null)
+ navigator.getCommonViewer().refresh();
+ }
+
+ public static boolean saveAll(){
+ return
SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true);
+ }
+
+ public static void waiteForBuild(){
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-11-05
14:25:20 UTC (rev 18414)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-11-05
14:39:41 UTC (rev 18415)
@@ -78,6 +78,7 @@
import
org.jboss.tools.seam.internal.core.refactoring.RenameSeamContextVariableProcessor;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.SeamUIUtil;
import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
import org.jboss.tools.seam.ui.wizard.RenameSeamContextVariableWizard;
import org.w3c.dom.Node;
@@ -423,6 +424,8 @@
} catch (final InterruptedException irex) {
// operation was canceled
}
+ SeamUIUtil.waiteForBuild();
+ SeamUIUtil.refreshSeamComponentView();
}
public static void invokeRenameSeamContextVariableWizard(String oldName, Shell
activeShell) {
@@ -438,6 +441,8 @@
} catch (final InterruptedException irex) {
// operation was canceled
}
+ SeamUIUtil.waiteForBuild();
+ SeamUIUtil.refreshSeamComponentView();
}
class RenameSeamComponentAction extends Action{