Author: dazarov
Date: 2009-06-03 09:15:26 -0400 (Wed, 03 Jun 2009)
New Revision: 15676
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java
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/SeamContextVariableRenameHandler.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContributionFactory.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/RenameComponentAction.java
Log:
Rename handlers were replaced by Contribution factory
https://jira.jboss.org/jira/browse/JBIDE-1077
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-06-03 10:31:35 UTC (rev
15675)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-06-03 13:15:26 UTC (rev
15676)
@@ -542,51 +542,12 @@
<extension
point="org.eclipse.ui.menus">
<menuContribution
- locationURI="popup:#CompilationUnitEditorContext?after=org.eclipse.jdt.ui.refactoring.menu">
- <menu
- id="java.editor.seam.popup.menu"
- label="Seam Refactor">
- <command
- commandId="org.jboss.tools.seam.ui.refactoring.component"
- id="org.jboss.tools.seam.ui.open.component.submenu"
- label="Rename Seam Component"
- style="push"
- tooltip="Rename Seam Component">
- </command>
- <command
- commandId="org.jboss.tools.seam.ui.refactoring.variable"
- id="org.jboss.tools.seam.ui.open.component.submenu2"
- label="Rename Seam Context Variable"
- style="push"
- tooltip="Rename Seam Context Variable">
- </command>
- </menu>
+
class="org.jboss.tools.seam.ui.refactoring.SeamRefactorContributionFactory"
+
locationURI="popup:#CompilationUnitEditorContext?after=org.eclipse.jdt.ui.refactoring.menu">
</menuContribution>
</extension>
- <extension
- point="org.eclipse.ui.commands">
- <command
- id="org.jboss.tools.seam.ui.refactoring.component"
- description="Seam Component Renaming"
- name="Seam Component Renaming">
- </command>
- <command
- id="org.jboss.tools.seam.ui.refactoring.variable"
- description="Seam Context Variable Renaming"
- name="Seam Context Variable Renaming">
- </command>
- </extension>
- <extension
- point="org.eclipse.ui.handlers">
- <handler
- commandId="org.jboss.tools.seam.ui.refactoring.component"
-
class="org.jboss.tools.seam.ui.refactoring.SeamComponentRenameHandler"/>
- <handler
- commandId="org.jboss.tools.seam.ui.refactoring.variable"
- class="org.jboss.tools.seam.ui.refactoring.SeamContextVariableRenameHandler"/>
- </extension>
<extension
point="org.jboss.tools.common.model.ui.attributeContentProposalProviders">
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -383,9 +383,13 @@
public static String SeamRuntimeListFieldEditor_ActionEdit;
public static String SeamRuntimeListFieldEditor_ActionRemove;
+
+ public static String SEAM_REFACTOR;
public static String RENAME_SEAM_COMPONENT;
+ public static String RENAME_SEAM_CONTEXT_VARIABLE;
+
public static String SEAM_COMPONENT_RENAME_HANDLER_ERROR;
static {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2009-06-03
13:15:26 UTC (rev 15676)
@@ -201,5 +201,7 @@
ENTITY_CLASS_ALREADY_EXISTS=Such entity class already exists!
PAGE_ALREADY_EXISTS=Such page already exists!
MASTER_PAGE_ALREADY_EXISTS=Such master page already exists!
+SEAM_REFACTOR = Seam Refactor
RENAME_SEAM_COMPONENT = Rename Seam Component
+RENAME_SEAM_CONTEXT_VARIABLE = Rename Seam Context Variable
SEAM_COMPONENT_RENAME_HANDLER_ERROR = Error
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamAbstractHandler.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -1,19 +0,0 @@
-package org.jboss.tools.seam.ui.refactoring;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.jobs.Job;
-import org.jboss.tools.seam.ui.SeamGuiPlugin;
-
-public abstract class SeamAbstractHandler extends AbstractHandler {
- protected static void saveAndBuild(){
- if(!SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
- return;
-
- try {
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
- } catch (InterruptedException e) {
- // do nothing
- }
- }
-}
Deleted:
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-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamComponentRenameHandler.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 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.refactoring;
-
-import java.util.Set;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.seam.core.ISeamComponent;
-import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
-import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
-
-/**
- * @author Alexey Kazakov
- */
-public class SeamComponentRenameHandler extends SeamAbstractHandler {
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
- * ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- Shell activeShell = HandlerUtil.getActiveShell(event);
-
- saveAndBuild();
-
- IEditorInput input = editor.getEditorInput();
- if (input instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput)input).getFile();
-
- IProject project = file.getProject();
- ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
- if (seamProject != null) {
- Set<ISeamComponent> components =
seamProject.getComponentsByPath(file.getFullPath());
- for(ISeamComponent component : components){
- ISeamJavaComponentDeclaration declaration = component.getJavaDeclaration();
- if(declaration != null){
- IResource resource = declaration.getResource();
- if(resource != null && resource.getFullPath().equals(file.getFullPath())){
- if(declaration.getName().equals(component.getName())){
- invokeRenameWizard(component, activeShell);
- return null;
- }
- }
- }
- }
- }
- }
- invokeRenameWizard(null, activeShell);
- return null;
- }
-
- public static void invokeRenameWizard(ISeamComponent component, Shell activeShell) {
- saveAndBuild();
-
- RenameComponentProcessor processor = new RenameComponentProcessor(component);
- RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
- RenameComponentWizard wizard = new RenameComponentWizard(refactoring, component);
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
- try {
- String titleForFailedChecks = SeamUIMessages.SEAM_COMPONENT_RENAME_HANDLER_ERROR;
- op.run(activeShell, titleForFailedChecks);
- } catch (final InterruptedException irex) {
- // operation was canceled
- }
- }
-}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContextVariableRenameHandler.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * 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.refactoring;
-
-import java.io.IOException;
-
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.jboss.tools.common.el.core.model.ELInstance;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.seam.core.ISeamComponent;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
-import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
-import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
-
-/**
- * @author Daniel Azarov
- */
-public class SeamContextVariableRenameHandler extends SeamAbstractHandler {
- private static final String JAVA_EXT = "java"; //$NON-NLS-1$
- private static final String XML_EXT = "xml"; //$NON-NLS-1$
- private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
- private static final String JSP_EXT = "jsp"; //$NON-NLS-1$
- private static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
-
- String selectedText = "";
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
- * ExecutionEvent)
- */
- public Object execute(ExecutionEvent event) throws ExecutionException {
- boolean status = false;
-
- IEditorPart editor = HandlerUtil.getActiveEditor(event);
- Shell activeShell = HandlerUtil.getActiveShell(event);
-
- saveAndBuild();
-
- ISelection sel = editor.getEditorSite().getSelectionProvider().getSelection();
-
- if(sel == null || sel.isEmpty())
- invokeRenameWizard(null, activeShell);
-
- if(sel instanceof TextSelection && editor.getEditorInput() instanceof
FileEditorInput){
- TextSelection selection = (TextSelection)sel;
-
- selectedText = selection.getText();
-
- System.out.println("Selection text - "+selectedText);
- System.out.println("Selection offset - "+selection.getOffset());
- System.out.println("Selection length - "+selection.getLength());
-
- FileEditorInput input = (FileEditorInput)editor.getEditorInput();
-
- IFile file = input.getFile();
-
- String ext = file.getFileExtension();
- String content = null;
- try {
- content = FileUtil.readStream(file.getContents());
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- return null;
- }
-
- if(JAVA_EXT.equalsIgnoreCase(ext)){
- status = findContextVariableInJava(file, content, selection);
- } else if(XML_EXT.equalsIgnoreCase(ext) || XHTML_EXT.equalsIgnoreCase(ext) ||
JSP_EXT.equalsIgnoreCase(ext))
- status = findContextVariableInDOM(file, content, selection);
- else if(PROPERTIES_EXT.equalsIgnoreCase(ext))
- status = findContextVariableInProperties(file, content, selection);
- }
- if(status){
-
- }
-
- System.out.println("Status - "+status);
- return null;
- }
-
- private boolean findContextVariableInJava(IFile file, String content, TextSelection
selection){
- try {
- FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
- Document document = new Document(content);
- scaner.setRange(document, 0, document.getLength());
- IToken token = scaner.nextToken();
- while(token!=null && token!=Token.EOF) {
- if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
- int length = scaner.getTokenLength();
- int offset = scaner.getTokenOffset();
- if(offset <= selection.getOffset() && (offset+length) >=
(selection.getOffset()+selection.getLength())){
- String value = document.get(offset, length);
- if(value.indexOf('{')>-1) {
- return scanString(file, value, offset, selection);
- }
- }
- }
- token = scaner.nextToken();
- }
- } catch (BadLocationException e) {
- SeamCorePlugin.getDefault().logError(e);
- }
- return false;
- }
-
- private boolean scanString(IFile file, String string, int offset, TextSelection
selection) {
- int startEl = string.indexOf("#{"); //$NON-NLS-1$
- if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(string);
- for (ELInstance instance : model.getInstances()) {
- for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELPropertyInvocation pi = findComponentReference(ie);
- if(pi != null){
- if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength()
== selection.getLength())
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private ELPropertyInvocation findComponentReference(ELInvocationExpression
invocationExpression){
- ELInvocationExpression invExp = invocationExpression;
- while(invExp != null){
- if(invExp instanceof ELPropertyInvocation){
- if(((ELPropertyInvocation)invExp).getQualifiedName() != null &&
((ELPropertyInvocation)invExp).getQualifiedName().equals(selectedText))
- return (ELPropertyInvocation)invExp;
- else
- invExp = invExp.getLeft();
-
- }else{
- invExp = invExp.getLeft();
- }
- }
- return null;
- }
-
- private boolean findContextVariableInDOM(IFile file, String content, TextSelection
selection){
- IModelManager manager = StructuredModelManager.getModelManager();
- if(manager == null) {
- return false;
- }
- IStructuredModel model = null;
- try {
- model = manager.getModelForRead(file);
- if (model instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) model;
- IDOMDocument document = domModel.getDocument();
- //scanChildNodes(file, document);
- }
- } catch (CoreException e) {
- SeamCorePlugin.getDefault().logError(e);
- } catch (IOException e) {
- SeamCorePlugin.getDefault().logError(e);
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return false;
- }
-
- private boolean findContextVariableInProperties(IFile file, String content,
TextSelection selection){
- return false;
- }
-
-
-
- public static void invokeRenameWizard(ISeamComponent component, Shell activeShell) {
- saveAndBuild();
-
- RenameComponentProcessor processor = new RenameComponentProcessor(component);
- RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
- RenameComponentWizard wizard = new RenameComponentWizard(refactoring, component);
- RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
- try {
- String titleForFailedChecks = SeamUIMessages.SEAM_COMPONENT_RENAME_HANDLER_ERROR;
- op.run(activeShell, titleForFailedChecks);
- } catch (final InterruptedException irex) {
- // operation was canceled
- }
- }
-
-
-}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContributionFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContributionFactory.java 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContributionFactory.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * 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.refactoring;
-
-import java.io.IOException;
-
-import org.eclipse.core.resources.IFile;
-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.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.ISourceRange;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
-import org.eclipse.jdt.ui.text.IJavaPartitions;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.text.rules.IToken;
-import org.eclipse.jface.text.rules.Token;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.internal.services.IWorkbenchLocationService;
-import org.eclipse.ui.menus.AbstractContributionFactory;
-import org.eclipse.ui.menus.IContributionRoot;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.services.IServiceLocator;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.jboss.tools.common.el.core.model.ELInstance;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-
-/**
- * @author Daniel Azarov
- */
-public class SeamContributionFactory extends AbstractContributionFactory {
- private static final String ANNOTATION_NAME =
"org.jboss.seam.annotations.Name";
- private static final String JAVA_EXT = "java"; //$NON-NLS-1$
- private static final String XML_EXT = "xml"; //$NON-NLS-1$
- private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
- private static final String JSP_EXT = "jsp"; //$NON-NLS-1$
- private static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
-
- String selectedText;
- IFile editorFile;
- String fileContent;
-
- public SeamContributionFactory(){
- super("","");
- }
-
- public SeamContributionFactory(String location, String namespace){
- super(location, namespace);
- }
-
- @Override
- public void createContributionItems(IServiceLocator serviceLocator,
- IContributionRoot additions) {
-
- if(serviceLocator.hasService(IWorkbenchLocationService.class)){
- IWorkbenchLocationService service =
(IWorkbenchLocationService)serviceLocator.getService(IWorkbenchLocationService.class);
- IEditorPart editor = service.getWorkbenchWindow().getActivePage().getActiveEditor();
- Shell activeShell = service.getWorkbenchWindow().getShell();
-
- ISelection sel = editor.getEditorSite().getSelectionProvider().getSelection();
-
- if(sel == null || sel.isEmpty())
- return;
-
- if(sel instanceof TextSelection && editor.getEditorInput() instanceof
FileEditorInput){
- TextSelection selection = (TextSelection)sel;
-
- selectedText = selection.getText();
-
- FileEditorInput input = (FileEditorInput)editor.getEditorInput();
-
- editorFile = input.getFile();
-
- String ext = editorFile.getFileExtension();
- fileContent = null;
- try {
- fileContent = FileUtil.readStream(editorFile.getContents());
- } catch (CoreException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- return;
- }
-
- MenuManager mm = new MenuManager("Seam Refactor");
- mm.setVisible(true);
-
- IAnnotation nameAnnotation = getNameAnnotation(editorFile);
- if(nameAnnotation != null){
- try{
- ISourceRange range = nameAnnotation.getSourceRange();
- if(selection.getOffset() >= range.getOffset() &&
selection.getOffset()+selection.getLength() <= range.getOffset()+range.getLength()){
- mm.add(new SeamComponentRefactoringAction());
-
- additions.addContributionItem(mm, null);
- }
- }catch(JavaModelException ex){
- SeamCorePlugin.getPluginLog().logError(ex);
- return;
- }
- }
-
- boolean status = false;
-
- if(JAVA_EXT.equalsIgnoreCase(ext)){
- status = findContextVariableInJava(editorFile, fileContent, selection);
- } else if(XML_EXT.equalsIgnoreCase(ext) || XHTML_EXT.equalsIgnoreCase(ext) ||
JSP_EXT.equalsIgnoreCase(ext))
- status = findContextVariableInDOM(editorFile, fileContent, selection);
- else if(PROPERTIES_EXT.equalsIgnoreCase(ext))
- status = findContextVariableInProperties(editorFile, fileContent, selection);
-
- if(status){
- mm.add(new SeamContextVariableRefactoringAction());
-
- additions.addContributionItem(mm, null);
- }
- }
- }
- }
-
- private boolean findContextVariableInJava(IFile file, String content, TextSelection
selection){
- try {
- FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
- Document document = new Document(content);
- scaner.setRange(document, 0, document.getLength());
- IToken token = scaner.nextToken();
- while(token!=null && token!=Token.EOF) {
- if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
- int length = scaner.getTokenLength();
- int offset = scaner.getTokenOffset();
- if(offset <= selection.getOffset() && (offset+length) >=
(selection.getOffset()+selection.getLength())){
- String value = document.get(offset, length);
- if(value.indexOf('{')>-1) {
- return scanString(file, value, offset, selection);
- }
- }
- }
- token = scaner.nextToken();
- }
- } catch (BadLocationException e) {
- SeamCorePlugin.getDefault().logError(e);
- }
- return false;
- }
-
- private boolean scanString(IFile file, String string, int offset, TextSelection
selection) {
- int startEl = string.indexOf("#{"); //$NON-NLS-1$
- if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(string);
- for (ELInstance instance : model.getInstances()) {
- for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELPropertyInvocation pi = findComponentReference(ie);
- if(pi != null){
- if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength()
== selection.getLength())
- return true;
- }
- }
- }
- }
- return false;
- }
-
- private ELPropertyInvocation findComponentReference(ELInvocationExpression
invocationExpression){
- ELInvocationExpression invExp = invocationExpression;
- while(invExp != null){
- if(invExp instanceof ELPropertyInvocation){
- if(((ELPropertyInvocation)invExp).getQualifiedName() != null &&
((ELPropertyInvocation)invExp).getQualifiedName().equals(selectedText))
- return (ELPropertyInvocation)invExp;
- else
- invExp = invExp.getLeft();
-
- }else{
- invExp = invExp.getLeft();
- }
- }
- return null;
- }
-
- private boolean findContextVariableInDOM(IFile file, String content, TextSelection
selection){
- IModelManager manager = StructuredModelManager.getModelManager();
- if(manager == null) {
- return false;
- }
- IStructuredModel model = null;
- try {
- model = manager.getModelForRead(file);
- if (model instanceof IDOMModel) {
- IDOMModel domModel = (IDOMModel) model;
- IDOMDocument document = domModel.getDocument();
- //scanChildNodes(file, document);
- }
- } catch (CoreException e) {
- SeamCorePlugin.getDefault().logError(e);
- } catch (IOException e) {
- SeamCorePlugin.getDefault().logError(e);
- } finally {
- if (model != null) {
- model.releaseFromRead();
- }
- }
- return false;
- }
-
- private boolean findContextVariableInProperties(IFile file, String content,
TextSelection selection){
- return false;
- }
-
- private IAnnotation getNameAnnotation(IFile file){
- try{
- ICompilationUnit unit = getCompilationUnit(file);
- for(IType type : unit.getAllTypes()){
- for(IAnnotation annotation : type.getAnnotations()){
- if(EclipseJavaUtil.resolveType(type,
annotation.getElementName()).equals(ANNOTATION_NAME))
- return annotation;
- }
- }
- }catch(CoreException ex){
- SeamCorePlugin.getDefault().logError(ex);
- }
- return null;
- }
-
- private ICompilationUnit getCompilationUnit(IFile file) throws CoreException {
- IProject project = file.getProject();
- IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
- for (IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)) {
- if(resource.getFullPath().isPrefixOf(file.getFullPath())) {
- IPath path =
file.getFullPath().removeFirstSegments(resource.getFullPath().segmentCount());
- IJavaElement element = javaProject.findElement(path);
- if(element instanceof ICompilationUnit) {
- return (ICompilationUnit)element;
- }
- }
- }
- return null;
- }
-
- class SeamComponentRefactoringAction extends Action{
- public SeamComponentRefactoringAction(){
- super("Rename Seam Component");
- }
- public void run(){
-
- }
- }
- class SeamContextVariableRefactoringAction extends Action{
- public SeamContextVariableRefactoringAction(){
- super("Rename Seam Context Variable");
- }
- public void run(){
-
- }
- }
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
(from rev 15675,
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamContributionFactory.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -0,0 +1,357 @@
+/*******************************************************************************
+ * 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.refactoring;
+
+import java.io.IOException;
+import java.util.Set;
+
+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.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.ISourceRange;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
+import org.eclipse.jdt.ui.text.IJavaPartitions;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.Document;
+import org.eclipse.jface.text.TextSelection;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.internal.services.IWorkbenchLocationService;
+import org.eclipse.ui.menus.AbstractContributionFactory;
+import org.eclipse.ui.menus.IContributionRoot;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.services.IServiceLocator;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.seam.core.ISeamComponent;
+import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentProcessor;
+import org.jboss.tools.seam.internal.core.refactoring.RenameComponentRefactoring;
+import org.jboss.tools.seam.ui.SeamGuiPlugin;
+import org.jboss.tools.seam.ui.SeamUIMessages;
+import org.jboss.tools.seam.ui.wizard.RenameComponentWizard;
+
+/**
+ * @author Daniel Azarov
+ */
+public class SeamRefactorContributionFactory extends AbstractContributionFactory {
+ private static final String ANNOTATION_NAME =
"org.jboss.seam.annotations.Name"; //$NON-NLS-1$
+ private static final String JAVA_EXT = "java"; //$NON-NLS-1$
+ private static final String XML_EXT = "xml"; //$NON-NLS-1$
+ private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
+ private static final String JSP_EXT = "jsp"; //$NON-NLS-1$
+ private static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
+
+ private String selectedText;
+ private IFile editorFile;
+ private String fileContent;
+ private IEditorPart editor;
+ private Shell shell;
+
+ public SeamRefactorContributionFactory(){
+ super("","");
+ }
+
+ public SeamRefactorContributionFactory(String location, String namespace){
+ super(location, namespace);
+ }
+
+ @Override
+ public void createContributionItems(IServiceLocator serviceLocator,
+ IContributionRoot additions) {
+
+ if(serviceLocator.hasService(IWorkbenchLocationService.class)){
+ IWorkbenchLocationService service =
(IWorkbenchLocationService)serviceLocator.getService(IWorkbenchLocationService.class);
+ editor = service.getWorkbenchWindow().getActivePage().getActiveEditor();
+ shell = service.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ ISelection sel = editor.getEditorSite().getSelectionProvider().getSelection();
+
+ if(sel == null || sel.isEmpty())
+ return;
+
+ if(sel instanceof TextSelection && editor.getEditorInput() instanceof
FileEditorInput){
+ TextSelection selection = (TextSelection)sel;
+
+ selectedText = selection.getText();
+
+ FileEditorInput input = (FileEditorInput)editor.getEditorInput();
+
+ editorFile = input.getFile();
+
+
+ fileContent = null;
+ try {
+ fileContent = FileUtil.readStream(editorFile.getContents());
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return;
+ }
+
+ MenuManager mm = new MenuManager(SeamUIMessages.SEAM_REFACTOR);
+ mm.setVisible(true);
+
+ boolean status = false;
+
+ String ext = editorFile.getFileExtension();
+ if(JAVA_EXT.equalsIgnoreCase(ext)){
+ if(checkNameAnnotation(selection)){
+ mm.add(new RenameSeamComponentAction());
+
+ additions.addContributionItem(mm, null);
+ }
+ status = checkContextVariableInJava(editorFile, fileContent, selection);
+ } else if(XML_EXT.equalsIgnoreCase(ext) || XHTML_EXT.equalsIgnoreCase(ext) ||
JSP_EXT.equalsIgnoreCase(ext))
+ status = checkContextVariableInDOM(editorFile, fileContent, selection);
+ else if(PROPERTIES_EXT.equalsIgnoreCase(ext))
+ status = checkContextVariableInProperties(editorFile, fileContent, selection);
+
+ if(status){
+ mm.add(new RenameSeamContextVariableAction());
+
+ additions.addContributionItem(mm, null);
+ }
+ }
+ }
+ }
+
+ private boolean checkNameAnnotation(TextSelection selection){
+ IAnnotation nameAnnotation = getNameAnnotation(editorFile);
+ if(nameAnnotation != null){
+ try{
+ ISourceRange range = nameAnnotation.getSourceRange();
+ if(selection.getOffset() >= range.getOffset() &&
selection.getOffset()+selection.getLength() <= range.getOffset()+range.getLength())
+ return true;
+ }catch(JavaModelException ex){
+ SeamCorePlugin.getPluginLog().logError(ex);
+ }
+ }
+ return false;
+ }
+
+ private boolean checkContextVariableInJava(IFile file, String content, TextSelection
selection){
+ try {
+ FastJavaPartitionScanner scaner = new FastJavaPartitionScanner();
+ Document document = new Document(content);
+ scaner.setRange(document, 0, document.getLength());
+ IToken token = scaner.nextToken();
+ while(token!=null && token!=Token.EOF) {
+ if(IJavaPartitions.JAVA_STRING.equals(token.getData())) {
+ int length = scaner.getTokenLength();
+ int offset = scaner.getTokenOffset();
+ if(offset <= selection.getOffset() && (offset+length) >=
(selection.getOffset()+selection.getLength())){
+ String value = document.get(offset, length);
+ if(value.indexOf('{')>-1) {
+ return scanString(file, value, offset, selection);
+ }
+ }
+ }
+ token = scaner.nextToken();
+ }
+ } catch (BadLocationException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ }
+ return false;
+ }
+
+ private boolean scanString(IFile file, String string, int offset, TextSelection
selection) {
+ int startEl = string.indexOf("#{"); //$NON-NLS-1$
+ if(startEl>-1) {
+ ELParser parser = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = parser.parse(string);
+ for (ELInstance instance : model.getInstances()) {
+ for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
+ ELPropertyInvocation pi = findSeamContextVariable(ie);
+ if(pi != null){
+ if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength()
== selection.getLength())
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private ELPropertyInvocation findSeamContextVariable(ELInvocationExpression
invocationExpression){
+ ELInvocationExpression invExp = invocationExpression;
+ while(invExp != null){
+ if(invExp instanceof ELPropertyInvocation){
+ if(((ELPropertyInvocation)invExp).getQualifiedName() != null &&
((ELPropertyInvocation)invExp).getQualifiedName().equals(selectedText))
+ return (ELPropertyInvocation)invExp;
+ else
+ invExp = invExp.getLeft();
+
+ }else{
+ invExp = invExp.getLeft();
+ }
+ }
+ return null;
+ }
+
+ private boolean checkContextVariableInDOM(IFile file, String content, TextSelection
selection){
+ IModelManager manager = StructuredModelManager.getModelManager();
+ if(manager == null) {
+ return false;
+ }
+ IStructuredModel model = null;
+ try {
+ model = manager.getModelForRead(file);
+ if (model instanceof IDOMModel) {
+ IDOMModel domModel = (IDOMModel) model;
+ IDOMDocument document = domModel.getDocument();
+ //scanChildNodes(file, document);
+ }
+ } catch (CoreException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ } catch (IOException e) {
+ SeamCorePlugin.getDefault().logError(e);
+ } finally {
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+ return false;
+ }
+
+ private boolean checkContextVariableInProperties(IFile file, String content,
TextSelection selection){
+ return false;
+ }
+
+ private IAnnotation getNameAnnotation(IFile file){
+ try{
+ ICompilationUnit unit = getCompilationUnit(file);
+ for(IType type : unit.getAllTypes()){
+ for(IAnnotation annotation : type.getAnnotations()){
+ if(EclipseJavaUtil.resolveType(type,
annotation.getElementName()).equals(ANNOTATION_NAME))
+ return annotation;
+ }
+ }
+ }catch(CoreException ex){
+ SeamCorePlugin.getDefault().logError(ex);
+ }
+ return null;
+ }
+
+ private ICompilationUnit getCompilationUnit(IFile file) throws CoreException {
+ IProject project = file.getProject();
+ IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
+ for (IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)) {
+ if(resource.getFullPath().isPrefixOf(file.getFullPath())) {
+ IPath path =
file.getFullPath().removeFirstSegments(resource.getFullPath().segmentCount());
+ IJavaElement element = javaProject.findElement(path);
+ if(element instanceof ICompilationUnit) {
+ return (ICompilationUnit)element;
+ }
+ }
+ }
+ return null;
+ }
+
+ private static void saveAndBuild(){
+ if(!SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
+ return;
+
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+ }
+
+ public static void invokeRenameComponentWizard(ISeamComponent component, Shell
activeShell) {
+ saveAndBuild();
+
+ RenameComponentProcessor processor = new RenameComponentProcessor(component);
+ RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
+ RenameComponentWizard wizard = new RenameComponentWizard(refactoring, component);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ try {
+ String titleForFailedChecks = SeamUIMessages.SEAM_COMPONENT_RENAME_HANDLER_ERROR;
+ op.run(activeShell, titleForFailedChecks);
+ } catch (final InterruptedException irex) {
+ // operation was canceled
+ }
+ }
+
+ class RenameSeamComponentAction extends Action{
+ public RenameSeamComponentAction(){
+ super(SeamUIMessages.RENAME_SEAM_COMPONENT);
+ }
+
+ public void run(){
+ saveAndBuild();
+
+ IEditorInput input = editor.getEditorInput();
+ if (input instanceof IFileEditorInput) {
+ IProject project = editorFile.getProject();
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if (seamProject != null) {
+ Set<ISeamComponent> components =
seamProject.getComponentsByPath(editorFile.getFullPath());
+ for(ISeamComponent component : components){
+ ISeamJavaComponentDeclaration declaration = component.getJavaDeclaration();
+ if(declaration != null){
+ IResource resource = declaration.getResource();
+ if(resource != null &&
resource.getFullPath().equals(editorFile.getFullPath())){
+ if(declaration.getName().equals(component.getName())){
+ invokeRenameComponentWizard(component, shell);
+ return;
+ }
+ }
+ }
+ }
+ }
+ }
+ invokeRenameComponentWizard(null, shell);
+ }
+ }
+
+ class RenameSeamContextVariableAction extends Action{
+ public RenameSeamContextVariableAction(){
+ super(SeamUIMessages.RENAME_SEAM_CONTEXT_VARIABLE);
+ }
+ public void run(){
+
+ }
+ }
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/RenameComponentAction.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/RenameComponentAction.java 2009-06-03
10:31:35 UTC (rev 15675)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/actions/RenameComponentAction.java 2009-06-03
13:15:26 UTC (rev 15676)
@@ -25,7 +25,7 @@
import org.jboss.tools.seam.internal.core.SeamObject;
import org.jboss.tools.seam.ui.SeamGuiPlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
-import org.jboss.tools.seam.ui.refactoring.SeamComponentRenameHandler;
+import org.jboss.tools.seam.ui.refactoring.SeamRefactorContributionFactory;
/**
* Rename component action for Seam Components view.
@@ -46,7 +46,7 @@
public void run() {
if(component != null) {
Shell activeShell =
SeamGuiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
- SeamComponentRenameHandler.invokeRenameWizard(component, activeShell);
+ SeamRefactorContributionFactory.invokeRenameComponentWizard(component, activeShell);
}
}