org.eclipse.wst.jsdt.manipulation_1.0.300.v201104272153

16:49:12.862 INFO  jd.cli.Main - Decompiling org.eclipse.wst.jsdt.manipulation_1.0.300.v201104272153.jar
package org.eclipse.wst.jsdt.core.manipulation;

public class JavaScriptManipulation
{
  public static final String ID_PLUGIN = "org.eclipse.wst.jsdt.manipulation";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.manipulation.JavaScriptManipulation
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring;

import org.eclipse.wst.jsdt.core.IJavaScriptElement;

public abstract interface IJavaScriptElementMapper
{
  public abstract IJavaScriptElement getRefactoredJavaScriptElement(IJavaScriptElement paramIJavaScriptElement);
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.IJavaScriptElementMapper
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring;

public abstract interface IJavaScriptRefactorings
{
  public static final String CHANGE_METHOD_SIGNATURE = "org.eclipse.wst.jsdt.ui.change.method.signature";
  public static final String CONVERT_ANONYMOUS = "org.eclipse.wst.jsdt.ui.convert.anonymous";
  public static final String CONVERT_LOCAL_VARIABLE = "org.eclipse.wst.jsdt.ui.promote.temp";
  public static final String CONVERT_MEMBER_TYPE = "org.eclipse.wst.jsdt.ui.move.inner";
  public static final String COPY = "org.eclipse.wst.jsdt.ui.copy";
  public static final String DELETE = "org.eclipse.wst.jsdt.ui.delete";
  public static final String ENCAPSULATE_FIELD = "org.eclipse.wst.jsdt.ui.self.encapsulate";
  public static final String EXTRACT_CONSTANT = "org.eclipse.wst.jsdt.ui.extract.constant";
  public static final String EXTRACT_INTERFACE = "org.eclipse.wst.jsdt.ui.extract.interface";
  public static final String EXTRACT_LOCAL_VARIABLE = "org.eclipse.wst.jsdt.ui.extract.temp";
  public static final String EXTRACT_METHOD = "org.eclipse.wst.jsdt.ui.extract.method";
  public static final String EXTRACT_SUPERCLASS = "org.eclipse.wst.jsdt.ui.extract.superclass";
  public static final String GENERALIZE_TYPE = "org.eclipse.wst.jsdt.ui.change.type";
  public static final String INFER_TYPE_ARGUMENTS = "org.eclipse.wst.jsdt.ui.infer.typearguments";
  public static final String INLINE_CONSTANT = "org.eclipse.wst.jsdt.ui.inline.constant";
  public static final String INLINE_LOCAL_VARIABLE = "org.eclipse.wst.jsdt.ui.inline.temp";
  public static final String INLINE_METHOD = "org.eclipse.wst.jsdt.ui.inline.method";
  public static final String INTRODUCE_FACTORY = "org.eclipse.wst.jsdt.ui.introduce.factory";
  public static final String INTRODUCE_INDIRECTION = "org.eclipse.wst.jsdt.ui.introduce.indirection";
  public static final String INTRODUCE_PARAMETER = "org.eclipse.wst.jsdt.ui.introduce.parameter";
  public static final String MOVE = "org.eclipse.wst.jsdt.ui.move";
  public static final String MOVE_METHOD = "org.eclipse.wst.jsdt.ui.move.method";
  public static final String MOVE_STATIC_MEMBERS = "org.eclipse.wst.jsdt.ui.move.static";
  public static final String PULL_UP = "org.eclipse.wst.jsdt.ui.pull.up";
  public static final String PUSH_DOWN = "org.eclipse.wst.jsdt.ui.push.down";
  public static final String RENAME_JAVASCRIPT_UNIT = "org.eclipse.wst.jsdt.ui.rename.compilationunit";
  public static final String RENAME_ENUM_CONSTANT = "org.eclipse.wst.jsdt.ui.rename.enum.constant";
  public static final String RENAME_FIELD = "org.eclipse.wst.jsdt.ui.rename.field";
  public static final String RENAME_JAVA_PROJECT = "org.eclipse.wst.jsdt.ui.rename.java.project";
  public static final String RENAME_LOCAL_VARIABLE = "org.eclipse.wst.jsdt.ui.rename.local.variable";
  public static final String RENAME_METHOD = "org.eclipse.wst.jsdt.ui.rename.method";
  public static final String RENAME_PACKAGE = "org.eclipse.wst.jsdt.ui.rename.package";
  public static final String RENAME_RESOURCE = "org.eclipse.wst.jsdt.ui.rename.resource";
  public static final String RENAME_SOURCE_FOLDER = "org.eclipse.wst.jsdt.ui.rename.source.folder";
  public static final String RENAME_TYPE = "org.eclipse.wst.jsdt.ui.rename.type";
  public static final String RENAME_TYPE_PARAMETER = "org.eclipse.wst.jsdt.ui.rename.type.parameter";
  public static final String USE_SUPER_TYPE = "org.eclipse.wst.jsdt.ui.use.supertype";
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.IJavaScriptRefactorings
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring;

import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.participants.RenameArguments;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;

public class RenameTypeArguments
  extends RenameArguments
{
  private boolean updateSimilarDeclarations;
  private IJavaScriptElement[] similarDeclarations;
  
  public RenameTypeArguments(String newName, boolean updateReferences, boolean updateSimilarDeclarations, IJavaScriptElement[] similarDeclarations)
  {
    super(newName, updateReferences);
    if (updateSimilarDeclarations) {
      Assert.isNotNull(similarDeclarations);
    }
    this.updateSimilarDeclarations = updateSimilarDeclarations;
    this.similarDeclarations = similarDeclarations;
  }
  
  public boolean getUpdateSimilarDeclarations()
  {
    return updateSimilarDeclarations;
  }
  
  public IJavaScriptElement[] getSimilarDeclarations()
  {
    return similarDeclarations;
  }
  
  public String toString()
  {
    return 
      super.toString() + (updateSimilarDeclarations ? " (update derived elements)" : " (don't update derived elements)");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.RenameTypeArguments
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ChangeMethodSignatureDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ChangeMethodSignatureDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.change.method.signature");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ChangeMethodSignatureDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ConvertAnonymousDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ConvertAnonymousDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.convert.anonymous");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ConvertAnonymousDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ConvertLocalVariableDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ConvertLocalVariableDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.promote.temp");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ConvertLocalVariableDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ConvertMemberTypeDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ConvertMemberTypeDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.move.inner");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ConvertMemberTypeDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class CopyDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public CopyDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.copy");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.CopyDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class DeleteDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public DeleteDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.delete");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.DeleteDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class EncapsulateFieldDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public EncapsulateFieldDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.self.encapsulate");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.EncapsulateFieldDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ExtractConstantDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ExtractConstantDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.extract.constant");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ExtractConstantDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ExtractInterfaceDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ExtractInterfaceDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.extract.interface");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ExtractInterfaceDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ExtractLocalDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ExtractLocalDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.extract.temp");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ExtractLocalDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ExtractMethodDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ExtractMethodDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.extract.method");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ExtractMethodDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class ExtractSuperclassDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public ExtractSuperclassDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.extract.superclass");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.ExtractSuperclassDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class GeneralizeTypeDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public GeneralizeTypeDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.change.type");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.GeneralizeTypeDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class InferTypeArgumentsDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public InferTypeArgumentsDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.infer.typearguments");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.InferTypeArgumentsDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class InlineConstantDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public InlineConstantDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.inline.constant");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.InlineConstantDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class InlineLocalVariableDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public InlineLocalVariableDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.inline.temp");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.InlineLocalVariableDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class InlineMethodDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public InlineMethodDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.inline.method");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.InlineMethodDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class IntroduceFactoryDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public IntroduceFactoryDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.introduce.factory");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.IntroduceFactoryDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class IntroduceIndirectionDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public IntroduceIndirectionDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.introduce.indirection");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.IntroduceIndirectionDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class IntroduceParameterDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public IntroduceParameterDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.introduce.parameter");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.IntroduceParameterDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.RefactoringContribution;
import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;

public abstract class JavaScriptRefactoringContribution
  extends RefactoringContribution
{
  public final Map retrieveArgumentMap(RefactoringDescriptor descriptor)
  {
    Assert.isNotNull(descriptor);
    if ((descriptor instanceof JavaScriptRefactoringDescriptor)) {
      return ((JavaScriptRefactoringDescriptor)descriptor).getArguments();
    }
    return super.retrieveArgumentMap(descriptor);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.JavaScriptRefactoringContribution
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

import java.text.MessageFormat;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringContribution;
import org.eclipse.ltk.core.refactoring.RefactoringCore;
import org.eclipse.ltk.core.refactoring.RefactoringDescriptor;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.IFunction;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptModel;
import org.eclipse.wst.jsdt.core.IJavaScriptProject;
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.core.JavaScriptCore;
import org.eclipse.wst.jsdt.core.WorkingCopyOwner;
import org.eclipse.wst.jsdt.internal.core.manipulation.JavaManipulationPlugin;
import org.eclipse.wst.jsdt.internal.core.refactoring.descriptors.DescriptorMessages;

public abstract class JavaScriptRefactoringDescriptor
  extends RefactoringDescriptor
{
  protected static final String ATTRIBUTE_ELEMENT = "element";
  protected static final String ATTRIBUTE_INPUT = "input";
  protected static final String ATTRIBUTE_NAME = "name";
  protected static final String ATTRIBUTE_REFERENCES = "references";
  protected static final String ATTRIBUTE_SELECTION = "selection";
  protected static final String ATTRIBUTE_VERSION = "version";
  public static final int JAR_MIGRATION = 65536;
  public static final int JAR_REFACTORING = 524288;
  public static final int JAR_SOURCE_ATTACHMENT = 262144;
  protected static final String VALUE_VERSION_1_0 = "1.0";
  protected final Map fArguments;
  
  protected static String elementToHandle(String project, IJavaScriptElement element)
  {
    String handle = element.getHandleIdentifier();
    if ((project != null) && (!(element instanceof IJavaScriptProject)))
    {
      String id = element.getJavaScriptProject().getHandleIdentifier();
      return handle.substring(id.length());
    }
    return handle;
  }
  
  protected static IJavaScriptElement handleToElement(String project, String handle)
  {
    return handleToElement(project, handle, true);
  }
  
  protected static IJavaScriptElement handleToElement(String project, String handle, boolean check)
  {
    return handleToElement(null, project, handle, check);
  }
  
  protected static IJavaScriptElement handleToElement(WorkingCopyOwner owner, String project, String handle, boolean check)
  {
    IJavaScriptElement element = null;
    if (owner != null) {
      element = JavaScriptCore.create(handle, owner);
    } else {
      element = JavaScriptCore.create(handle);
    }
    if ((element == null) && (project != null))
    {
      IJavaScriptProject javaProject = JavaScriptCore.create(ResourcesPlugin.getWorkspace().getRoot()).getJavaScriptProject(project);
      String identifier = javaProject.getHandleIdentifier();
      if (owner != null) {
        element = JavaScriptCore.create(identifier + handle, owner);
      } else {
        element = JavaScriptCore.create(identifier + handle);
      }
    }
    if ((check) && ((element instanceof IFunction)))
    {
      IFunction method = (IFunction)element;
      IFunction[] methods = 
        {method.getDeclaringType() != null ? method.getDeclaringType().findMethods(method) : method.getJavaScriptUnit().getFunction(method.getElementName(), method.getParameterTypes()) };
      if ((methods != null) && (methods.length > 0)) {
        element = methods[0];
      }
    }
    if ((element != null) && ((!check) || (element.exists()))) {
      return element;
    }
    return null;
  }
  
  protected static IResource handleToResource(String project, String handle)
  {
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    if ("".equals(handle)) {
      return null;
    }
    IPath path = Path.fromPortableString(handle);
    if (path == null) {
      return null;
    }
    if ((project != null) && (!"".equals(project))) {
      return root.getProject(project).findMember(path);
    }
    return root.findMember(path);
  }
  
  protected static String resourceToHandle(String project, IResource resource)
  {
    if ((project != null) && (!"".equals(project))) {
      return resource.getProjectRelativePath().toPortableString();
    }
    return resource.getFullPath().toPortableString();
  }
  
  protected JavaScriptRefactoringDescriptor(String id)
  {
    this(id, new HashMap());
  }
  
  protected JavaScriptRefactoringDescriptor(String id, Map arguments)
  {
    super(id, null, DescriptorMessages.JavaRefactoringDescriptor_not_available, null, 6);
    fArguments = arguments;
    fArguments.put("version", "1.0");
  }
  
  public Refactoring createRefactoring(RefactoringStatus status)
    throws CoreException
  {
    populateArgumentMap();
    Refactoring refactoring = null;
    String id = getID();
    RefactoringContribution contribution = RefactoringCore.getRefactoringContribution(id);
    if (contribution != null)
    {
      RefactoringDescriptor descriptor = contribution.createDescriptor(id, getProject(), getDescription(), getComment(), fArguments, getFlags());
      if (descriptor != null) {
        refactoring = descriptor.createRefactoring(status);
      } else {
        JavaManipulationPlugin.log(new Status(4, JavaManipulationPlugin.getPluginId(), 0, MessageFormat.format(DescriptorMessages.JavaRefactoringDescriptor_no_resulting_descriptor, new Object[] { id }), null));
      }
    }
    return refactoring;
  }
  
  protected Map getArguments()
  {
    populateArgumentMap();
    return new HashMap(fArguments);
  }
  
  protected void populateArgumentMap()
  {
    Assert.isTrue(!validateDescriptor().hasFatalError(), "Validation returns a fatal error status.");
  }
  
  public void setComment(String comment)
  {
    super.setComment(comment);
  }
  
  public void setDescription(String description)
  {
    super.setDescription(description);
  }
  
  public void setFlags(int flags)
  {
    super.setFlags(flags);
  }
  
  public void setProject(String project)
  {
    super.setProject(project);
  }
  
  public RefactoringStatus validateDescriptor()
  {
    RefactoringStatus status = new RefactoringStatus();
    String description = getDescription();
    if ((description == null) || ("".equals(description))) {
      status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.JavaRefactoringDescriptor_no_description));
    }
    return status;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.JavaScriptRefactoringDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

import java.util.Map;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.core.IJavaScriptUnit;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IPackageFragment;
import org.eclipse.wst.jsdt.core.IPackageFragmentRoot;
import org.eclipse.wst.jsdt.internal.core.refactoring.descriptors.DescriptorMessages;

public final class MoveDescriptor
  extends JavaScriptRefactoringDescriptor
{
  private static final String ATTRIBUTE_DESTINATION = "destination";
  private static final String ATTRIBUTE_FILES = "files";
  private static final String ATTRIBUTE_FOLDERS = "folders";
  private static final String ATTRIBUTE_FRAGMENTS = "fragments";
  private static final String ATTRIBUTE_MEMBERS = "members";
  private static final String ATTRIBUTE_PATTERNS = "patterns";
  private static final String ATTRIBUTE_POLICY = "policy";
  private static final String ATTRIBUTE_QUALIFIED = "qualified";
  private static final String ATTRIBUTE_ROOTS = "roots";
  private static final String ATTRIBUTE_TARGET = "target";
  private static final String ATTRIBUTE_UNITS = "units";
  private static final String POLICY_MOVE_MEMBERS = "org.eclipse.wst.jsdt.ui.moveMembers";
  private static final String POLICY_MOVE_PACKAGES = "org.eclipse.wst.jsdt.ui.movePackages";
  private static final String POLICY_MOVE_RESOURCES = "org.eclipse.wst.jsdt.ui.moveResources";
  private static final String POLICY_MOVE_ROOTS = "org.eclipse.wst.jsdt.ui.moveRoots";
  private Object fDestination;
  private IFile[] fFiles;
  private IFolder[] fFolders;
  private IPackageFragment[] fFragments;
  private IMember[] fMembers;
  private String fMovePolicy = null;
  private String fPatterns = null;
  private boolean fQualified = false;
  private boolean fReferences = false;
  private IPackageFragmentRoot[] fRoots;
  private IJavaScriptUnit[] fUnits;
  
  public MoveDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.move");
  }
  
  protected void populateArgumentMap()
  {
    super.populateArgumentMap();
    fArguments.put("policy", fMovePolicy);
    String project = getProject();
    if ((fDestination instanceof IJavaScriptElement)) {
      fArguments.put("destination", JavaScriptRefactoringDescriptor.elementToHandle(project, (IJavaScriptElement)fDestination));
    } else if ((fDestination instanceof IResource)) {
      fArguments.put("target", JavaScriptRefactoringDescriptor.resourceToHandle(null, (IResource)fDestination));
    }
    if ("org.eclipse.wst.jsdt.ui.moveResources".equals(fMovePolicy))
    {
      fArguments.put("references", Boolean.toString(fReferences));
      fArguments.put("qualified", Boolean.toString(fQualified));
      if ((fPatterns != null) && (!"".equals(fPatterns))) {
        fArguments.put("patterns", fPatterns);
      }
      fArguments.put("files", new Integer(fFiles.length).toString());
      for (int offset = 0; offset < fFiles.length; offset++) {
        fArguments.put("element" + (offset + 1), JavaScriptRefactoringDescriptor.resourceToHandle(project, fFiles[offset]));
      }
      fArguments.put("folders", new Integer(fFolders.length).toString());
      for (int offset = 0; offset < fFolders.length; offset++) {
        fArguments.put("element" + (offset + fFiles.length + 1), JavaScriptRefactoringDescriptor.resourceToHandle(project, fFolders[offset]));
      }
      fArguments.put("units", new Integer(fUnits.length).toString());
      for (int offset = 0; offset < fUnits.length; offset++) {
        fArguments.put("element" + (offset + fFolders.length + fFiles.length + 1), JavaScriptRefactoringDescriptor.elementToHandle(project, fUnits[offset]));
      }
    }
    else if ("org.eclipse.wst.jsdt.ui.moveRoots".equals(fMovePolicy))
    {
      fArguments.put("roots", new Integer(fRoots.length).toString());
      for (int offset = 0; offset < fRoots.length; offset++) {
        fArguments.put("element" + (offset + 1), JavaScriptRefactoringDescriptor.elementToHandle(project, fRoots[offset]));
      }
    }
    else if ("org.eclipse.wst.jsdt.ui.movePackages".equals(fMovePolicy))
    {
      fArguments.put("fragments", new Integer(fFragments.length).toString());
      for (int offset = 0; offset < fFragments.length; offset++) {
        fArguments.put("element" + (offset + 1), JavaScriptRefactoringDescriptor.elementToHandle(project, fFragments[offset]));
      }
    }
    else if ("org.eclipse.wst.jsdt.ui.moveMembers".equals(fMovePolicy))
    {
      fArguments.put("members", new Integer(fMembers.length).toString());
      for (int offset = 0; offset < fMembers.length; offset++) {
        fArguments.put("element" + (offset + 1), JavaScriptRefactoringDescriptor.elementToHandle(project, fMembers[offset]));
      }
    }
  }
  
  public void setDestination(IJavaScriptElement element)
  {
    Assert.isNotNull(element);
    fDestination = element;
  }
  
  public void setDestination(IResource resource)
  {
    Assert.isNotNull(resource);
    fDestination = resource;
  }
  
  public void setFileNamePatterns(String patterns)
  {
    Assert.isNotNull(patterns);
    Assert.isLegal(!"".equals(patterns), "Pattern must not be empty");
    fPatterns = patterns;
  }
  
  public void setMoveMembers(IMember[] members)
  {
    Assert.isNotNull(members);
    Assert.isTrue(fMovePolicy == null, "Clients must only call one of the 'setMoveXXX' methods.");
    fMembers = members;
    fMovePolicy = "org.eclipse.wst.jsdt.ui.moveMembers";
  }
  
  public void setMovePackageFragmentRoots(IPackageFragmentRoot[] roots)
  {
    Assert.isNotNull(roots);
    Assert.isTrue(fMovePolicy == null, "Clients must only call one of the 'setMoveXXX' methods.");
    fRoots = roots;
    fMovePolicy = "org.eclipse.wst.jsdt.ui.moveRoots";
  }
  
  public void setMovePackages(IPackageFragment[] fragments)
  {
    Assert.isNotNull(fragments);
    Assert.isTrue(fMovePolicy == null, "Clients must only call one of the 'setMoveXXX' methods.");
    fFragments = fragments;
    fMovePolicy = "org.eclipse.wst.jsdt.ui.movePackages";
  }
  
  public void setMoveResources(IFile[] files, IFolder[] folders, IJavaScriptUnit[] units)
  {
    Assert.isNotNull(files);
    Assert.isNotNull(folders);
    Assert.isNotNull(units);
    Assert.isTrue(fMovePolicy == null, "Clients must only call one of the 'setMoveXXX' methods.");
    fFiles = files;
    fFolders = folders;
    fUnits = units;
    fMovePolicy = "org.eclipse.wst.jsdt.ui.moveResources";
  }
  
  public void setUpdateQualifiedNames(boolean update)
  {
    fQualified = update;
  }
  
  public void setUpdateReferences(boolean update)
  {
    fReferences = update;
  }
  
  public RefactoringStatus validateDescriptor()
  {
    RefactoringStatus status = super.validateDescriptor();
    if (!status.hasFatalError())
    {
      if (fMovePolicy == null) {
        status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveDescriptor_no_elements_set));
      }
      if (fDestination == null) {
        status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveDescriptor_no_destination_set));
      }
    }
    return status;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.MoveDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class MoveMethodDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public MoveMethodDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.move.method");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.MoveMethodDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.IMember;
import org.eclipse.wst.jsdt.core.IType;
import org.eclipse.wst.jsdt.internal.core.refactoring.descriptors.DescriptorMessages;

public final class MoveStaticMembersDescriptor
  extends JavaScriptRefactoringDescriptor
{
  private static final String ATTRIBUTE_DELEGATE = "delegate";
  private static final String ATTRIBUTE_DEPRECATE = "deprecate";
  private boolean fDelegate = false;
  private boolean fDeprecate = false;
  private IMember[] fMembers;
  private IType fType = null;
  
  public MoveStaticMembersDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.move.static");
  }
  
  protected void populateArgumentMap()
  {
    super.populateArgumentMap();
    fArguments.put("input", elementToHandle(getProject(), fType));
    fArguments.put("delegate", Boolean.valueOf(fDelegate).toString());
    fArguments.put("deprecate", Boolean.valueOf(fDeprecate).toString());
    for (int index = 0; index < fMembers.length; index++) {
      fArguments.put("element" + (index + 1), elementToHandle(getProject(), fMembers[index]));
    }
  }
  
  public void setDeprecateDelegate(boolean deprecate)
  {
    fDeprecate = deprecate;
  }
  
  public void setDestinationType(IType type)
  {
    Assert.isNotNull(type);
    fType = type;
  }
  
  public void setKeepOriginal(boolean delegate)
  {
    fDelegate = delegate;
  }
  
  public void setMembers(IMember[] members)
  {
    Assert.isNotNull(members);
    fMembers = members;
  }
  
  public RefactoringStatus validateDescriptor()
  {
    RefactoringStatus status = super.validateDescriptor();
    if (fType == null) {
      status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_type));
    }
    if (fMembers == null) {
      status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_no_members));
    } else {
      for (int index = 0; index < fMembers.length; index++) {
        if (fMembers[index] == null)
        {
          status.merge(RefactoringStatus.createFatalErrorStatus(DescriptorMessages.MoveStaticMembersDescriptor_invalid_members));
          break;
        }
      }
    }
    return status;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.MoveStaticMembersDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class PullUpDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public PullUpDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.pull.up");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.PullUpDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

public final class PushDownDescriptor
  extends JavaScriptRefactoringDescriptor
{
  public PushDownDescriptor()
  {
    super("org.eclipse.wst.jsdt.ui.push.down");
  }
}

/* Location:
 * Qualified Name:     org.eclipse.wst.jsdt.core.refactoring.descriptors.PushDownDescriptor
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.wst.jsdt.core.refactoring.descriptors;

import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.wst.jsdt.core.IJavaScriptElement;
import org.eclipse.wst.jsdt.internal.core.refactoring.descriptors.DescriptorMessages;

public final class RenameJavaScriptElementDescriptor
  extends JavaScriptRefactoringDescriptor
{
  private static final String ATTRIBUTE_DELEGATE = "delegate";
  private static final String ATTRIBUTE_DEPRECATE = "deprecate";
  private static final String ATTRIBUTE_HIERARCHICAL = "hierarchical";
  private static final String ATTRIBUTE_MATCH_STRATEGY = "matchStrategy";
  private static final String ATTRIBUTE_PARAMETER = "parameter";
  private static final String ATTRIBUTE_PATTERNS = "patterns";
  private static final String ATTRIBUTE_QUALIFIED = "qualified";
  private static final String ATTRIBUTE_RENAME_GETTER = "getter";
  private static final String ATTRIBUTE_RENAME_SETTER = "setter";
  private static final String ATTRIBUTE_SIMILAR_DECLARATIONS = "similarDeclarations";
  private static final String ATTRIBUTE_TEXTUAL_MATCHES = "textual";
  public static final int STRATEGY_EMBEDDED = 2;
  public static final int STRATEGY_EXACT = 1;
  public static final int STRATEGY_SUFFIX = 3;
  private boolean fDelegate = false;
  private boolean fDeprecate = false;
  private boolean fHierarchical = false;
  private IJavaScriptElement fJavaElement = null;
  private int fMatchStrategy = 1;
  private String fName = null;
  private String fPatterns = null;
  private boolean fQualified = false;
  private boolean fReferences = false;
  private boolean fRenameGetter = false;
  private boolean fRenameSetter = false;
  private boolean fSimilarDeclarations = false;
  private boolean fTextual = false;
  
  public RenameJavaScriptElementDescriptor(String id)
  {
    super(id);
    Assert.isLegal(checkId(id), "Refactoring id is not a rename refactoring id");
  }
  
  private boolean checkId(String id)
  {
    Assert.isNotNull(id);
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.compilationunit")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.enum.constant")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.field")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.java.project")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.local.variable")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.method")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.package")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.resource")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.source.folder")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.type")) {
      return true;
    }
    if (id.equals("org.eclipse.wst.jsdt.ui.rename.type.parameter")) {
      return true;
    }
    return false;
  }
  
  protected void populateArgumentMap()
  {
    super.populateArgumentMap();
    fArguments.put("name", fName);
    if (getID().equals("org.eclipse.wst.jsdt.ui.rename.type.parameter"))
    {
      fArguments.put("input", elementToHandle(getProject(), null));
      fArguments.put("parameter", null);
    }
    else
    {
      fArguments.put("input", elementToHandle(getProject(), fJavaElement));
    }
    int type = fJavaElement.getElementType();
    if (type != 3) {
      fArguments.put("references", Boolean.toString(fReferences));
    }
    if (type == 8)
    {
      fArguments.put("getter", Boolean.toString(fRenameGetter));
      fArguments.put("setter", Boolean.toString(fRenameSetter));
    }
    switch (type)
    {
    case 4: 
    case 7: 
    case 8: 
      fArguments.put("textual", Boolean.toString(fTextual));
      break;
    }
    switch (type)
    {
    case 8: 
    case 9: 
      fArguments.put("deprecate", Boolean.toString(fDeprecate));
      fArguments.put("delegate", Boolean.toString(fDelegate));
      break;
    }
    switch (type)
    {
    case 4: 
    case 7: 
      fArguments.put("qualified", Boolean.toString(fQualified));
      if ((fPatterns != null) && (!"".equals(fPatterns))) {
        fArguments.put("patterns", fPatterns);
      }
      break;
    }
    switch (type)
    {
    case 7: 
      fArguments.put("similarDeclarations", Boolean.toString(fSimilarDeclarations));
      fArguments.put("matchStrategy", Integer.toString(fMatchStrategy));
      break;
    }
    switch (type)
    {
    case 4: 
      fArguments.put("hierarchical", Boolean.toString(fHierarchical));
      break;
    }
  }
  
  public void setDeprecateDelegate(boolean deprecate)
  {
    fDeprecate = deprecate;
  }
  
  public void setFileNamePatterns(String patterns)
  {
    Assert.isNotNull(patterns);
    Assert.isLegal(!"".equals(patterns), "Pattern must not be empty");
    fPatterns = patterns;
  }
  
  public void setJavaElement(IJavaScriptElement element)
  {
    Assert.isNotNull(element);
    fJavaElement = element;
  }
  
  public void setKeepOriginal(boolean delegate)
  {
    fDelegate = delegate;
  }
  
  public void setMatchStrategy(int strategy)
  {
    Assert.isLegal((strategy == 1) || (strategy == 2) || (strategy == 3), "Wrong match strategy argument");
    fMatchStrategy = strategy;
  }
  
  public void setNewName(String name)
  {
    Assert.isNotNull(name);
    Assert.isLegal(!"".equals(name), "Name must not be empty");
    fName = name;
  }
  
  public void setProject(String project)
  {
    super.setProject(project);
  }
  
  public void setRenameGetters(boolean rename)
  {
    fRenameGetter = rename;
  }
  
  public void setRenameSetters(boolean rename)
  {
    fRenameSetter = rename;
  }
  
  public void setUpdateHierarchy(boolean update)
  {
    fHierarchical = update;
  }
  
  public void setUpdateQualifiedNames(boolean update)
  {
    fQualified = update;
  }
  
  public void setUpdateReferences(boolean update)
  {
    fReferences = update;
  }
  
  public void setUpdateSimilarDeclarations(boolean update)
  {
    fSimilarDeclarations = update;
  }
  
  public void setUpdateTextualOccurrences(boolean update)
  {
    fTextua
1 2

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd