[jbosstools-commits] JBoss Tools SVN: r17493 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/refactoring and 1 other directory.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Sep 9 12:01:21 EDT 2009


Author: dazarov
Date: 2009-09-09 12:01:21 -0400 (Wed, 09 Sep 2009)
New Revision: 17493

Added:
   trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
Modified:
   trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-4856

Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml	2009-09-09 15:05:52 UTC (rev 17492)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml	2009-09-09 16:01:21 UTC (rev 17493)
@@ -517,6 +517,21 @@
                 </or>
             </with>
          </enablement>
+      </renameParticipant>
+      <renameParticipant
+            class="org.jboss.tools.seam.internal.core.refactoring.SeamRenameMethodParticipant"
+            id="org.jboss.tools.seam.internal.core.refactoring.SeamRenameMethodParticipant"
+            name="seam-RenameMethodParticipant">
+         <enablement>
+            <with
+                  variable="element">
+               <or>
+                  <instanceof
+                        value="org.eclipse.jdt.core.IMethod">
+                  </instanceof>
+               </or>
+            </with>
+         </enablement>
       </renameParticipant>
 	</extension>
 

Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java	                        (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java	2009-09-09 16:01:21 UTC (rev 17493)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+  * 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.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
+
+public class SeamRenameMethodParticipant extends RenameParticipant{
+	private IMethod method;
+	private String oldName;
+	private String newName;
+	private SeamRenameMethodSearcher searcher;
+	
+	
+	@Override
+	public RefactoringStatus checkConditions(IProgressMonitor pm,
+			CheckConditionsContext context) throws OperationCanceledException {
+		return null;
+	}
+
+	@Override
+	public Change createChange(IProgressMonitor pm) throws CoreException,
+			OperationCanceledException {
+		return null;
+	}
+
+	@Override
+	public String getName() {
+		return oldName;
+	}
+
+	@Override
+	protected boolean initialize(Object element) {
+		if(element instanceof IMethod){
+			method = (IMethod)element;
+			oldName = method.getElementName();
+			newName = getArguments().getNewName();
+			
+			searcher = new SeamRenameMethodSearcher((IFile)method.getResource(), oldName);
+			return true;
+		}
+		return false;
+	}
+	
+	class SeamRenameMethodSearcher extends SeamRefactorSearcher{
+		public SeamRenameMethodSearcher(IFile file, String name){
+			super(file, name);
+		}
+
+		@Override
+		protected boolean isFileCorrect(IFile file) {
+			return false;
+		}
+
+		@Override
+		protected void match(IFile file, int offset, int length) {
+		}
+	}
+
+}


Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRenameMethodParticipant.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain



More information about the jbosstools-commits mailing list