Author: dazarov
Date: 2009-10-14 11:02:03 -0400 (Wed, 14 Oct 2009)
New Revision: 18085
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/schema/elSearcher.exsd
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcher.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcherExtension.java
trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamELSearcher.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/plugin.xml
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4989
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/plugin.xml 2009-10-14 14:46:32 UTC
(rev 18084)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/plugin.xml 2009-10-14 15:02:03 UTC
(rev 18085)
@@ -2,5 +2,6 @@
<?eclipse version="3.4"?>
<plugin>
<extension-point id="elResolver" name="EL Resolver"
schema="schema/elResolver.exsd"/>
+ <extension-point id="elSearcher" name="EL Search"
schema="schema/elSearcher.exsd"/>
</plugin>
Added: trunk/common/plugins/org.jboss.tools.common.el.core/schema/elSearcher.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/schema/elSearcher.exsd
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/schema/elSearcher.exsd 2009-10-14
15:02:03 UTC (rev 18085)
@@ -0,0 +1,127 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.common.el.core"
xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appinfo>
+ <meta.schema plugin="org.jboss.tools.common.el.core"
id="elSearch" name="EL Search"/>
+ </appinfo>
+ <documentation>
+ This extenion point is used to send information about seam project to search and
rename participants. In order to have one search participand and one rename participant
for seam and jsf projects.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appinfo>
+ <meta.element />
+ </appinfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="el-search" minOccurs="1"
maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute translatable="true"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="el-search">
+ <complexType>
+ <attribute name="id" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="identifier"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ <attribute name="searcher-class" type="string"
use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appinfo>
+ <meta.attribute kind="java"
basedOn=":org.jboss.tools.common.el.core.refactoring.ELSearcher"/>
+ </appinfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="since"/>
+ </appinfo>
+ <documentation>
+ JBoss Tools 3.1
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="examples"/>
+ </appinfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="apiinfo"/>
+ </appinfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="implementation"/>
+ </appinfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appinfo>
+ <meta.section type="copyright"/>
+ </appinfo>
+ <documentation>
+ 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
+ </documentation>
+ </annotation>
+
+</schema>
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.core/schema/elSearcher.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcher.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcher.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcher.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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.common.el.core.refactoring;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+
+public interface ELSearcher {
+ public void init(IProject project);
+
+ public IProject[] getLinkedProjects();
+
+ public IContainer getViewFolder(IProject project);
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcherExtension.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcherExtension.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcherExtension.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -0,0 +1,47 @@
+package org.jboss.tools.common.el.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.common.el.core.Activator;
+
+public class ELSearcherExtension {
+ public static String EXTENSION_POINT =
"org.jboss.tools.common.el.core.elSearcher"; //$NON-NLS-1$
+
+ String id;
+ ELSearcher searcher;
+
+ public ELSearcherExtension() {}
+
+ public String getId() {
+ return id;
+ }
+
+ public ELSearcher getELSearcher() {
+ return searcher;
+ }
+
+ static ELSearcherExtension[] INSTANCES;
+
+ public static ELSearcherExtension[] getInstances() {
+ if(INSTANCES != null) return INSTANCES;
+ List<ELSearcherExtension> list = new ArrayList<ELSearcherExtension>();
+ IExtensionPoint point =
Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
+ IConfigurationElement[] es = point.getConfigurationElements();
+ for (IConfigurationElement e: es) {
+ ELSearcherExtension n = new ELSearcherExtension();
+ n.id = e.getAttribute("id"); //$NON-NLS-1$
+ try{
+ n.searcher = (ELSearcher)e.createExecutableExtension("searcher-class");
//$NON-NLS-1$
+ }catch(CoreException ex){
+ Activator.getDefault().logError(ex);
+ }
+ list.add(n);
+ }
+ return INSTANCES = list.toArray(new ELSearcherExtension[0]);
+ }
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELSearcherExtension.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-10-14
14:46:32 UTC (rev 18084)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/resolver/ELResolutionImpl.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -39,7 +39,7 @@
ArrayList<ELSegment> list = new ArrayList<ELSegment>();
for(ELSegment segment : segments){
for(IVariable var : segment.getVariables()){
- if(var.getName().equals(variable.getName())){
+ if(var.equals(variable)){
list.add(segment);
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF 2009-10-14
14:46:32 UTC (rev 18084)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/META-INF/MANIFEST.MF 2009-10-14
15:02:03 UTC (rev 18085)
@@ -13,7 +13,9 @@
org.jboss.tools.common.resref.ui;bundle-version="1.0.0",
org.eclipse.core.resources;bundle-version="3.4.0",
org.jboss.tools.common.model.ui;bundle-version="2.0.0",
- org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0",
+ org.eclipse.jdt.ui;bundle-version="3.5.0",
+ org.eclipse.search;bundle-version="3.5.0"
Bundle-Vendor: %Bundle-Vendor.0
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.jboss.tools.vpe.resref.core
Added: trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
(rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml 2009-10-14 15:02:03 UTC
(rev 18085)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+ <extension
+ point="org.eclipse.jdt.ui.queryParticipants">
+ <queryParticipant
+
class="org.jboss.tools.common.el.ui.refactoring.ELReferencesQueryParticipant"
+
id="org.jboss.tools.common.el.ui.refactoring.ELReferencesQueryParticipant"
+ name="jsf-SearchELReferencesParticipant"
+ nature="org.jboss.tools.jsf.jsfnature">
+ </queryParticipant>
+ </extension>
+
+
+</plugin>
Property changes on: trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * 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.common.el.ui.refactoring;
+
+import org.eclipse.core.resources.IContainer;
+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.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.internal.ui.search.JavaSearchResultPage;
+import org.eclipse.jdt.ui.search.ElementQuerySpecification;
+import org.eclipse.jdt.ui.search.IMatchPresentation;
+import org.eclipse.jdt.ui.search.IQueryParticipant;
+import org.eclipse.jdt.ui.search.ISearchRequestor;
+import org.eclipse.jdt.ui.search.QuerySpecification;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.search.ui.text.Match;
+import org.eclipse.ui.PartInitException;
+import org.jboss.tools.common.el.core.refactoring.ELSearcher;
+import org.jboss.tools.common.el.core.refactoring.ELSearcherExtension;
+import org.jboss.tools.common.el.core.refactoring.RefactorSearcher;
+import org.jboss.tools.common.model.project.ProjectHome;
+
+public class ELReferencesQueryParticipant implements IQueryParticipant,
IMatchPresentation{
+ private ELSearch search;
+ JavaSearchResultPage searchPage = null;
+
+ public int estimateTicks(QuerySpecification specification) {
+ return 10;
+ }
+
+ public IMatchPresentation getUIParticipant() {
+ return this;
+ }
+
+ public void search(ISearchRequestor requestor,
+ QuerySpecification querySpecification, IProgressMonitor monitor)
+ throws CoreException {
+
+ if(querySpecification instanceof ElementQuerySpecification){
+ ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
+ if(qs.getElement() instanceof IMethod){
+ IFile file = (IFile)qs.getElement().getResource();
+ String name = qs.getElement().getElementName();
+
+ search = new ELSearch(requestor, qs.getElement(), file, name);
+ search.setSearchScope(qs.getScope());
+
+ search.findELReferences();
+ }
+ }
+ }
+
+ public ILabelProvider createLabelProvider() {
+ return null;
+ }
+
+ public void showMatch(Match match, int currentOffset,
+ int currentLength, boolean activate) throws PartInitException {
+ }
+
+ class ELSearch extends RefactorSearcher{
+ ISearchRequestor requestor;
+ ELSearcher searcher=null;
+
+ public ELSearch(ISearchRequestor requestor, IJavaElement element, IFile file, String
name){
+ super(file, name, element);
+ this.requestor = requestor;
+ ELSearcherExtension[] extensions = ELSearcherExtension.getInstances();
+ if(extensions.length > 0){
+ searcher = extensions[0].getELSearcher();
+ if(searcher != null)
+ searcher.init(file.getProject());
+ }
+
+ }
+
+ protected boolean isFileCorrect(IFile file){
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ return false;
+ }else if(file.isPhantom()){
+ return false;
+ }else if(file.isReadOnly()){
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ protected void match(IFile file, int offset, int length) {
+ Match match = new Match(file, offset, length);
+ requestor.reportMatch(match);
+ }
+
+ protected IProject[] getProjects(){
+ if(searcher != null){
+ return searcher.getLinkedProjects();
+ }
+ return new IProject[]{baseFile.getProject()};
+ }
+
+ protected IContainer getViewFolder(IProject project){
+ if(searcher != null){
+ return searcher.getViewFolder(project);
+ }
+
+ IPath path =
ProjectHome.getFirstWebContentPath(baseFile.getProject()).removeFirstSegments(1);
+
+ return baseFile.getProject().getFolder(path);
+ }
+ }
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELReferencesQueryParticipant.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-10-14 14:46:32 UTC (rev
18084)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2009-10-14 15:02:03 UTC (rev
18085)
@@ -578,5 +578,10 @@
<project-nature id="org.jboss.tools.seam.core.seamnature"
resolver-class="org.jboss.tools.seam.internal.core.el.SeamELCompletionEngine"/>
</el-resolver>
+ </extension>
+
+ <extension
+ point="org.jboss.tools.common.el.core.elSearcher">
+ <el-search id="seam.searcher"
searcher-class="org.jboss.tools.seam.internal.core.refactoring.SeamELSearcher"
/>
</extension>
</plugin>
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamELSearcher.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamELSearcher.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamELSearcher.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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.internal.core.refactoring;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IPath;
+import org.jboss.tools.common.el.core.refactoring.ELSearcher;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.seam.core.SeamProjectsSet;
+
+public class SeamELSearcher implements ELSearcher {
+ SeamProjectsSet projectsSet;
+ IProject project;
+
+ public void init(IProject project){
+ projectsSet = new SeamProjectsSet(project);
+ this.project = project;
+ }
+
+ public IProject[] getLinkedProjects() {
+ IProject[] projects = projectsSet.getAllProjects();
+ if(projects.length == 0 || projects[0] == null){
+ return new IProject[]{project};
+ }
+ return projects;
+ }
+
+ public IContainer getViewFolder(IProject project){
+ if(project.equals(projectsSet.getWarProject()))
+ return projectsSet.getDefaultViewsFolder();
+ else if(project.equals(projectsSet.getEarProject()))
+ return projectsSet.getDefaultEarViewsFolder();
+
+ IPath path = ProjectHome.getFirstWebContentPath(project).removeFirstSegments(1);
+
+ return project.getFolder(path);
+ }
+
+}
Property changes on:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamELSearcher.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-10-14
14:46:32 UTC (rev 18084)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core.refactoring;
import java.util.List;
+import java.util.Set;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
@@ -29,6 +30,10 @@
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
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.ISeamXmlComponentDeclaration;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.SeamProjectsSet;
public abstract class SeamRefactorSearcher extends RefactorSearcher {
@@ -83,8 +88,39 @@
else
match(file, offset, length);
}
-
+ protected void updateEnvironment(IProject project){
+ if(component == null)
+ return;
+
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
+ if(seamProject == null)
+ return;
+
+ ISeamComponent oldComponent = component;
+
+ if(oldComponent.getJavaDeclaration() != null){
+ component = getComponent(seamProject, oldComponent.getName(),
(IFile)oldComponent.getJavaDeclaration().getResource());
+ }else{
+ for(ISeamXmlComponentDeclaration xDecl : oldComponent.getXmlDeclarations()){
+ component = getComponent(seamProject, oldComponent.getName(),
(IFile)xDecl.getResource());
+ if(component != null)
+ return;
+ }
+ }
+ if(component == null)
+ component = oldComponent;
+ }
+
+ private ISeamComponent getComponent(ISeamProject seamProject, String name, IFile file){
+ Set<ISeamComponent> components =
seamProject.getComponentsByPath(file.getFullPath());
+ for(ISeamComponent component : components){
+ if(component.getName().equals(name))
+ return component;
+ }
+ return null;
+ }
+
private void resolveComponentsReferences(IFile file, ELExpression operand, int offset)
{
ELResolver[] resolvers = ELResolverFactoryManager.getInstance()
.getResolvers(file);
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-10-14 14:46:32 UTC (rev
18084)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2009-10-14 15:02:03 UTC (rev
18085)
@@ -662,13 +662,4 @@
<xclass
id="org.jboss.tools.seam.ui.views.actions.RenameComponentAction"
class="org.jboss.tools.seam.ui.views.actions.RenameComponentAction"/>
</extension>
- <extension
- point="org.eclipse.jdt.ui.queryParticipants">
- <queryParticipant
-
class="org.jboss.tools.seam.ui.search.SeamELReferencesQueryParticipant"
-
id="org.jboss.tools.seam.ui.search.SeamELReferencesQueryParticipant"
- name="seam-SearchELReferencesParticipant"
- nature="org.jboss.tools.seam.core.seamnature">
- </queryParticipant>
- </extension>
</plugin>
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-10-14
14:46:32 UTC (rev 18084)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/search/SeamELReferencesQueryParticipant.java 2009-10-14
15:02:03 UTC (rev 18085)
@@ -1,91 +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.search;
-
-import org.eclipse.core.resources.IContainer;
-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.IProgressMonitor;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.internal.ui.search.JavaSearchResultPage;
-import org.eclipse.jdt.ui.search.ElementQuerySpecification;
-import org.eclipse.jdt.ui.search.IMatchPresentation;
-import org.eclipse.jdt.ui.search.IQueryParticipant;
-import org.eclipse.jdt.ui.search.ISearchRequestor;
-import org.eclipse.jdt.ui.search.QuerySpecification;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.search.ui.text.Match;
-import org.eclipse.ui.PartInitException;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELMethodInvocation;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.refactoring.RefactorSearcher;
-import org.jboss.tools.seam.core.SeamProjectsSet;
-import org.jboss.tools.seam.internal.core.refactoring.SeamRefactorSearcher;
-
-public class SeamELReferencesQueryParticipant implements IQueryParticipant,
IMatchPresentation{
- private ELSearcher searcher;
- JavaSearchResultPage searchPage = null;
-
- public int estimateTicks(QuerySpecification specification) {
- return 10;
- }
-
- public IMatchPresentation getUIParticipant() {
- return this;
- }
-
- public void search(ISearchRequestor requestor,
- QuerySpecification querySpecification, IProgressMonitor monitor)
- throws CoreException {
-
- if(querySpecification instanceof ElementQuerySpecification){
- ElementQuerySpecification qs = (ElementQuerySpecification)querySpecification;
- if(qs.getElement() instanceof IMethod){
- IFile file = (IFile)qs.getElement().getResource();
- String name = qs.getElement().getElementName();
-
- searcher = new ELSearcher(requestor, qs.getElement(), file, name);
- searcher.setSearchScope(qs.getScope());
-
- searcher.findELReferences();
- }
- }
- }
-
- public ILabelProvider createLabelProvider() {
- return null;
- }
-
- public void showMatch(Match match, int currentOffset,
- int currentLength, boolean activate) throws PartInitException {
- }
-
- class ELSearcher extends SeamRefactorSearcher{
- ISearchRequestor requestor;
-
- public ELSearcher(ISearchRequestor requestor, IJavaElement element, IFile file, String
name){
- super(file, name, element);
- this.requestor = requestor;
- }
-
-
- @Override
- protected void match(IFile file, int offset, int length) {
- Match match = new Match(file, offset, length);
- requestor.reportMatch(match);
- }
-
- }
-}