Package org.pdtextensions.core.ui.refactoring

Examples of org.pdtextensions.core.ui.refactoring.RenameSupport


    // Work around for http://dev.eclipse.org/bugs/show_bug.cgi?id=19104
    if (!ActionUtil.isProcessable(getShell(), element)) return;
    //XXX workaround bug 31998
    if (ActionUtil.mustDisableScriptModelAction(getShell(), element)) return;

    final RenameSupport support = createRenameSupport(element, null, RenameSupport.UPDATE_REFERENCES);
    if (support != null && support.preCheck().isOK()) {
      support.openDialog(getShell());
    }
  }
View Full Code Here


  }

  private static RenameSupport createRenameSupport(IModelElement element, String newName, int flags) throws CoreException {
    switch (element.getElementType()) {
    case IModelElement.SCRIPT_PROJECT:
      return new RenameSupport(new RenameScriptProjectProcessor((IScriptProject) element), newName, flags);
    case IModelElement.PROJECT_FRAGMENT:
      return new RenameSupport(new RenameSourceFolderProcessor((IProjectFragment) element), newName);
    case IModelElement.SCRIPT_FOLDER:
      // TODO Add namespace support like JDT
      return new RenameSupport(new RenameScriptFolderProcessor((IScriptFolder) element), newName, flags);
    case IModelElement.SOURCE_MODULE:
      return new RenameSupport(new RenameSourceModuleProcessor((ISourceModule) element), newName, flags);
    case IModelElement.TYPE:
      return new RenameSupport(new RenameTypeProcessor((IType) element), newName, flags);
    case IModelElement.METHOD:
      return new RenameSupport(new RenameMethodProcessor((IMethod) element), newName, flags);
    case IModelElement.FIELD:
      if (((IField) element).getDeclaringType() == null) {
        return new RenameSupport(new RenameLocalVariableProcessor((IField) element), newName, flags);
      } else {
        if (PHPFlags.isConstant(((IField) element).getFlags())) {
          return new RenameSupport(new RenameConstantProcessor((IField) element), newName, flags);
        } else if (PHPFlags.isStatic(((IField) element).getFlags())) {
          return new RenameSupport(new RenameStaticPropertyProcessor((IField) element), newName, flags);
        } else {
          return new RenameSupport(new RenamePropertyProcessor((IField) element), newName, flags);
        }
      }
    default:
      return null;
    }
View Full Code Here

TOP

Related Classes of org.pdtextensions.core.ui.refactoring.RenameSupport

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.