本文整理汇总了Java中org.eclipse.ltk.core.refactoring.ChangeDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ChangeDescriptor类的具体用法?Java ChangeDescriptor怎么用?Java ChangeDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChangeDescriptor类属于org.eclipse.ltk.core.refactoring包,在下文中一共展示了ChangeDescriptor类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createChange
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public Change createChange(IProgressMonitor monitor) throws CoreException,
OperationCanceledException {
try {
monitor.beginTask(
Messages.ConvertConstantsToEnumRefactoring_CreatingChange,
1);
final Collection changes = this.changes.values();
final CompositeChange change = new CompositeChange(this.getName(),
(Change[]) changes.toArray(new Change[changes.size()])) {
public ChangeDescriptor getDescriptor() {
String project = ConvertConstantsToEnumRefactoring.this
.getJavaProject().getElementName();
String description = Messages.ConvertConstantsToEnum_Name;
Map arguments = new HashMap();
return new RefactoringChangeDescriptor(
new ConvertConstantsToEnumDescriptor(project,
description, new String(), arguments));
}
};
return change;
} finally {
monitor.done();
}
}
开发者ID:ponder-lab,项目名称:Constants-to-Enum-Eclipse-Plugin,代码行数:25,代码来源:ConvertConstantsToEnumRefactoring.java
示例2: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public final ChangeDescriptor getDescriptor() {
final Map<String, String> arguments= new HashMap<String, String>();
final int length= fFiles.length + fFolders.length + fCus.length;
final String description= length == 1 ? getDescriptionSingular() : getDescriptionPlural();
final IProject resource= getSingleProject();
final String project= resource != null ? resource.getName() : null;
final String header= length == 1 ? Messages.format(getHeaderPatternSingular(), new String[] { getSingleElementName(), getDestinationLabel() }) : Messages.format(
getHeaderPatternPlural(),
new String[] { String.valueOf(length), getDestinationLabel() });
int flags= JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;
final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(project, this, header);
arguments.put(ATTRIBUTE_POLICY, getPolicyId());
arguments.put(ATTRIBUTE_FILES, new Integer(fFiles.length).toString());
for (int offset= 0; offset < fFiles.length; offset++)
arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + 1), JavaRefactoringDescriptorUtil.resourceToHandle(project, fFiles[offset]));
arguments.put(ATTRIBUTE_FOLDERS, new Integer(fFolders.length).toString());
for (int offset= 0; offset < fFolders.length; offset++)
arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + fFiles.length + 1), JavaRefactoringDescriptorUtil.resourceToHandle(project, fFolders[offset]));
arguments.put(ATTRIBUTE_UNITS, new Integer(fCus.length).toString());
for (int offset= 0; offset < fCus.length; offset++)
arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + fFolders.length + fFiles.length + 1), JavaRefactoringDescriptorUtil.elementToHandle(project, fCus[offset]));
arguments.putAll(getRefactoringArguments(project));
final JavaRefactoringDescriptor descriptor= createRefactoringDescriptor(comment, arguments, description, project, flags);
return new RefactoringChangeDescriptor(descriptor);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:26,代码来源:ReorgPolicyFactory.java
示例3: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public final ChangeDescriptor getDescriptor() {
final Map<String, String> arguments = new HashMap<String, String>();
final int length = fPackageFragmentRoots.length;
final String description = length == 1 ? getDescriptionSingular() : getDescriptionPlural();
final IProject resource = getSingleProject();
final String project = resource != null ? resource.getName() : null;
final String header =
length == 1
? Messages.format(
getHeaderPatternSingular(),
new String[] {fPackageFragmentRoots[0].getElementName(), getDestinationLabel()})
: Messages.format(
getHeaderPatternPlural(),
new String[] {String.valueOf(length), getDestinationLabel()});
int flags = RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;
final JDTRefactoringDescriptorComment comment =
new JDTRefactoringDescriptorComment(project, this, header);
arguments.put(ATTRIBUTE_POLICY, getPolicyId());
arguments.put(ATTRIBUTE_ROOTS, new Integer(fPackageFragmentRoots.length).toString());
for (int offset = 0; offset < fPackageFragmentRoots.length; offset++)
arguments.put(
JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (offset + 1),
JavaRefactoringDescriptorUtil.elementToHandle(project, fPackageFragmentRoots[offset]));
arguments.putAll(getRefactoringArguments(project));
final JavaRefactoringDescriptor descriptor =
createRefactoringDescriptor(comment, arguments, description, project, flags);
return new RefactoringChangeDescriptor(descriptor);
}
开发者ID:eclipse,项目名称:che,代码行数:29,代码来源:ReorgPolicyFactory.java
示例4: getRefactoringDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
private RefactoringDescriptor getRefactoringDescriptor(IUndoableOperation operation) {
if (operation instanceof TriggeredOperations) {
operation = ((TriggeredOperations) operation).getTriggeringOperation();
}
if (operation instanceof UndoableOperation2ChangeAdapter) {
ChangeDescriptor changeDescriptor =
((UndoableOperation2ChangeAdapter) operation).getChangeDescriptor();
if (changeDescriptor instanceof RefactoringChangeDescriptor) {
return ((RefactoringChangeDescriptor) changeDescriptor).getRefactoringDescriptor();
}
}
return null;
}
开发者ID:eclipse,项目名称:che,代码行数:14,代码来源:RefactoringHistoryService.java
示例5: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public final ChangeDescriptor getDescriptor() {
final ChangeDescriptor descriptor = super.getDescriptor();
if (descriptor == null) {
return new RefactoringChangeDescriptor(
new UnknownRefactoringDescriptor(getChildren()[0].getName()));
}
return descriptor;
}
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:RefactoringDescriptorChange.java
示例6: createChange
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
pm.beginTask("", 1); //$NON-NLS-1$
try {
DynamicValidationStateChange result= new DynamicValidationStateChange(RefactoringCoreMessages.InferTypeArgumentsRefactoring_name, fChangeManager.getAllChanges()) {
@Override
public final ChangeDescriptor getDescriptor() {
final Map<String, String> arguments= new HashMap<String, String>();
final IJavaProject project= getSingleProject();
final String description= RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
final String header= project != null ? Messages.format(RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description_project, BasicElementLabels.getJavaElementName(project.getElementName())) : RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
final String name= project != null ? project.getElementName() : null;
final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(name, this, header);
final String[] settings= new String[fElements.length];
for (int index= 0; index < settings.length; index++)
settings[index]= JavaElementLabels.getTextLabel(fElements[index], JavaElementLabels.ALL_FULLY_QUALIFIED);
comment.addSetting(JDTRefactoringDescriptorComment.createCompositeSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_original_elements, settings));
if (fAssumeCloneReturnsSameType)
comment.addSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_assume_clone);
if (fLeaveUnconstrainedRaw)
comment.addSetting(RefactoringCoreMessages.InferTypeArgumentsRefactoring_leave_unconstrained);
final InferTypeArgumentsDescriptor descriptor= RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor(name, description, comment.asString(), arguments, RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
for (int index= 0; index < fElements.length; index++)
arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1), JavaRefactoringDescriptorUtil.elementToHandle(name, fElements[index]));
arguments.put(ATTRIBUTE_CLONE, Boolean.valueOf(fAssumeCloneReturnsSameType).toString());
arguments.put(ATTRIBUTE_LEAVE, Boolean.valueOf(fLeaveUnconstrainedRaw).toString());
return new RefactoringChangeDescriptor(descriptor);
}
};
return result;
} finally {
pm.done();
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:36,代码来源:InferTypeArgumentsRefactoring.java
示例7: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
@Override
public ChangeDescriptor getDescriptor() {
return delegate.getDescriptor();
}
开发者ID:cplutte,项目名称:bts,代码行数:5,代码来源:DisplayChangeWrapper.java
示例8: createChange
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
pm.beginTask("", 1); // $NON-NLS-1$
try {
DynamicValidationStateChange result =
new DynamicValidationStateChange(
RefactoringCoreMessages.InferTypeArgumentsRefactoring_name,
fChangeManager.getAllChanges()) {
@Override
public final ChangeDescriptor getDescriptor() {
final Map<String, String> arguments = new HashMap<String, String>();
final IJavaProject project = getSingleProject();
final String description =
RefactoringCoreMessages.InferTypeArgumentsRefactoring_descriptor_description;
final String header =
project != null
? Messages.format(
RefactoringCoreMessages
.InferTypeArgumentsRefactoring_descriptor_description_project,
BasicElementLabels.getJavaElementName(project.getElementName()))
: RefactoringCoreMessages
.InferTypeArgumentsRefactoring_descriptor_description;
final String name = project != null ? project.getElementName() : null;
final JDTRefactoringDescriptorComment comment =
new JDTRefactoringDescriptorComment(name, this, header);
final String[] settings = new String[fElements.length];
for (int index = 0; index < settings.length; index++)
settings[index] =
JavaElementLabels.getTextLabel(
fElements[index], JavaElementLabels.ALL_FULLY_QUALIFIED);
comment.addSetting(
JDTRefactoringDescriptorComment.createCompositeSetting(
RefactoringCoreMessages.InferTypeArgumentsRefactoring_original_elements,
settings));
if (fAssumeCloneReturnsSameType)
comment.addSetting(
RefactoringCoreMessages.InferTypeArgumentsRefactoring_assume_clone);
if (fLeaveUnconstrainedRaw)
comment.addSetting(
RefactoringCoreMessages.InferTypeArgumentsRefactoring_leave_unconstrained);
final InferTypeArgumentsDescriptor descriptor =
RefactoringSignatureDescriptorFactory.createInferTypeArgumentsDescriptor(
name,
description,
comment.asString(),
arguments,
RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE);
for (int index = 0; index < fElements.length; index++)
arguments.put(
JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1),
JavaRefactoringDescriptorUtil.elementToHandle(name, fElements[index]));
arguments.put(
ATTRIBUTE_CLONE, Boolean.valueOf(fAssumeCloneReturnsSameType).toString());
arguments.put(ATTRIBUTE_LEAVE, Boolean.valueOf(fLeaveUnconstrainedRaw).toString());
return new RefactoringChangeDescriptor(descriptor);
}
};
return result;
} finally {
pm.done();
}
}
开发者ID:eclipse,项目名称:che,代码行数:64,代码来源:InferTypeArgumentsRefactoring.java
示例9: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
/** @return a descriptor describing a reorg from source to target */
public ChangeDescriptor getDescriptor();
开发者ID:eclipse,项目名称:che,代码行数:3,代码来源:IReorgPolicy.java
示例10: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public ChangeDescriptor getDescriptor() {
return new RefactoringChangeDescriptor(fDescriptor);
}
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:DynamicValidationRefactoringChange.java
示例11: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
/** {@inheritDoc} */
public ChangeDescriptor getDescriptor() {
return fDescriptor;
}
开发者ID:eclipse,项目名称:che,代码行数:5,代码来源:CompilationUnitChange.java
示例12: getChangeDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public ChangeDescriptor getChangeDescriptor() {
return fChangeDescriptor;
}
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:UndoableOperation2ChangeAdapter.java
示例13: setChangeDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public void setChangeDescriptor(ChangeDescriptor descriptor) {
fChangeDescriptor = descriptor;
}
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:UndoableOperation2ChangeAdapter.java
示例14: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public ChangeDescriptor getDescriptor() {
return fDescriptor;
}
开发者ID:eclipse,项目名称:che,代码行数:4,代码来源:MoveResourceChange.java
示例15: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public ChangeDescriptor getDescriptor() {
return fDescriptor;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:4,代码来源:RenameKeyChange.java
示例16: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
public ChangeDescriptor getDescriptor() {
return fDescriptor;
}
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:4,代码来源:RenameKeyChange.java
示例17: createChange
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
@Override
public Change createChange(IProgressMonitor pm) throws CoreException {
Assert.isNotNull(fNewNameQueries);
Assert.isTrue(fCopyPolicy.getJavaElementDestination() == null || fCopyPolicy.getResourceDestination() == null);
Assert.isTrue(fCopyPolicy.getJavaElementDestination() != null || fCopyPolicy.getResourceDestination() != null);
try {
final DynamicValidationStateChange result= new DynamicValidationStateChange(getChangeName()) {
@Override
public Object getAdapter(Class adapter) {
if (ReorgExecutionLog.class.equals(adapter))
return fExecutionLog;
return super.getAdapter(adapter);
}
@Override
public ChangeDescriptor getDescriptor() {
return fCopyPolicy.getDescriptor();
}
@Override
public Change perform(IProgressMonitor pm2) throws CoreException {
try {
super.perform(pm2);
} catch (OperationCanceledException e) {
fExecutionLog.markAsCanceled();
throw e;
}
return null;
}
};
Change change= fCopyPolicy.createChange(pm, new MonitoringNewNameQueries(fNewNameQueries, fExecutionLog));
if (change instanceof CompositeChange) {
CompositeChange subComposite= (CompositeChange) change;
result.merge(subComposite);
} else {
result.add(change);
}
return result;
} finally {
pm.done();
}
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:44,代码来源:JavaCopyProcessor.java
示例18: getDescriptor
import org.eclipse.ltk.core.refactoring.ChangeDescriptor; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public ChangeDescriptor getDescriptor() {
return new RefactoringChangeDescriptor(fDescriptor);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:DynamicValidationRefactoringChange.java
注:本文中的org.eclipse.ltk.core.refactoring.ChangeDescriptor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论