Package org.springframework.ide.eclipse.beans.ui.refactoring.ltk

Examples of org.springframework.ide.eclipse.beans.ui.refactoring.ltk.RenameIdType


        attributeName = getSelectedAttributeName(textSelection);
      }

      if (node != null && attributeName != null) {
        // start Spring IDE's own bean id refactoring
        RenameIdType idType = null;

        if ("bean".equals(node.getLocalName()) && "http://www.springframework.org/schema/beans".equals(node.getNamespaceURI())
            && "id".equals(attributeName)) {
          idType = RenameIdType.BEAN;
        } else if ("advice".equals(node.getLocalName()) && "http://www.springframework.org/schema/tx".equals(node.getNamespaceURI())
            && "id".equals(attributeName)) {
          idType = RenameIdType.ADVICE;
        } else if ("pointcut".equals(node.getLocalName()) && "http://www.springframework.org/schema/aop".equals(node.getNamespaceURI())
            && "id".equals(attributeName)) {
          idType = RenameIdType.POINTCUT;
        }

        if (idType != null) {
          RenameIdRefactoring refactoring = new RenameIdRefactoring();
          refactoring.setType(idType);
          refactoring.setNode((IDOMNode) node);
          refactoring.setBeanId(BeansEditorUtils.getAttribute(node,
              "id"));
          refactoring.setFile(getConfigFile(event));
          refactoring.setOffset(textSelection.getOffset());
          RenameIdRefactoringWizard wizard = new RenameIdRefactoringWizard(
              refactoring, "Rename " + idType.getType() + " id");
          run(wizard, BeansUIPlugin.getActiveWorkbenchShell(),
              "Rename " + idType.getType() + " id");
        } else {
          processAction(event, document, textSelection);
        }
      }
    }
View Full Code Here


    return null;
  }

  public static TextFileChange createRenameBeanRefsChange(IFile file,
      String oldBeanId, String newBeanId, IProgressMonitor monitor) throws CoreException {
    RenameIdType descriptor = RenameIdType.BEAN;
    return createRenameBeanRefsChange(file, descriptor, oldBeanId, newBeanId, monitor);
  }
View Full Code Here

TOP

Related Classes of org.springframework.ide.eclipse.beans.ui.refactoring.ltk.RenameIdType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.