本文整理汇总了Java中org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor类的典型用法代码示例。如果您正苦于以下问题:Java ExtractClassDescriptor类的具体用法?Java ExtractClassDescriptor怎么用?Java ExtractClassDescriptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExtractClassDescriptor类属于org.eclipse.jdt.core.refactoring.descriptors包,在下文中一共展示了ExtractClassDescriptor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ExtractClassRefactoring
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public ExtractClassRefactoring(ExtractClassDescriptor descriptor) {
fDescriptor= descriptor;
IType type= fDescriptor.getType();
if (fDescriptor.getPackage() == null) {
fDescriptor.setPackage(type.getPackageFragment().getElementName());
}
if (fDescriptor.getClassName() == null) {
fDescriptor.setClassName(type.getElementName() + "Data"); //$NON-NLS-1$
}
if (fDescriptor.getFieldName() == null) {
fDescriptor.setFieldName(StubUtility.getVariableNameSuggestions(NamingConventions.VK_INSTANCE_FIELD, type.getJavaProject(), "data", 0, null, true)[0]); //$NON-NLS-1$
}
if (fDescriptor.getFields() == null) {
try {
fDescriptor.setFields(ExtractClassDescriptor.getFields(type));
} catch (JavaModelException e) {
JavaPlugin.log(e);
}
}
fVerification= new ExtractClassDescriptorVerification(descriptor);
}
示例2: startExtractClassRefactoring
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public static void startExtractClassRefactoring(IType type, Shell shell) {
ExtractClassDescriptor descriptor= RefactoringSignatureDescriptorFactory.createExtractClassDescriptor();
descriptor.setType(type);
ExtractClassRefactoring refactoring= new ExtractClassRefactoring(descriptor);
ExtractClassWizard wizard= new ExtractClassWizard(descriptor, refactoring);
new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, RefactoringSaveHelper.SAVE_REFACTORING);
}
示例3: checkInitialConditions
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
RefactoringStatus result= new RefactoringStatus();
pm.beginTask(RefactoringCoreMessages.ExtractClassRefactoring_progress_msg_check_initial_condition, 5);
try {
result.merge(fDescriptor.validateDescriptor());
if (!result.isOK())
return result;
IType type= fDescriptor.getType();
result.merge(Checks.checkAvailability(type));
if (!result.isOK())
return result;
pm.worked(1);
Field[] fields= ExtractClassDescriptor.getFields(fDescriptor.getType());
pm.worked(1);
if (pm.isCanceled())
throw new OperationCanceledException();
fVariables= new LinkedHashMap<String, FieldInfo>();
if (fields.length == 0) {
result.addFatalError(RefactoringCoreMessages.ExtractClassRefactoring_error_no_usable_fields, JavaStatusContext.create(type));
return result;
}
for (int i= 0; i < fields.length; i++) {
Field field= fields[i];
String fieldName= field.getFieldName();
IField declField= type.getField(fieldName);
ParameterInfo info= new ParameterInfo(Signature.toString(declField.getTypeSignature()), fieldName, i);
fVariables.put(fieldName, new FieldInfo(info, declField));
if (pm.isCanceled())
throw new OperationCanceledException();
}
pm.worked(3);
} finally {
pm.done();
}
return result;
}
示例4: createRefactoring
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
@Override
public Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException {
if (!(descriptor instanceof ExtractClassDescriptor)) {
status.addFatalError(RefactoringCoreMessages.ExtractClassContribution_error_unknown_descriptor);
return null;
}
return new ExtractClassRefactoring((ExtractClassDescriptor) descriptor);
}
示例5: getElements
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public Object[] getElements(Object inputElement) {
if (inputElement instanceof ExtractClassDescriptor) {
ExtractClassDescriptor descriptor= (ExtractClassDescriptor) inputElement;
return descriptor.getFields();
}
return null;
}
示例6: createExtractClassDescriptor
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public static ExtractClassDescriptor createExtractClassDescriptor(
String project, String description, String comment, Map arguments, int flags)
throws IllegalArgumentException {
return new ExtractClassDescriptor(project, description, comment, arguments, flags);
}
示例7: ExtractClassDescriptorVerification
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public ExtractClassDescriptorVerification(ExtractClassDescriptor descriptor) {
fDescriptor= descriptor;
}
示例8: ExtractClassWizard
import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public ExtractClassWizard(ExtractClassDescriptor descriptor, Refactoring refactoring) {
super(refactoring, DIALOG_BASED_USER_INTERFACE);
fDescriptor= descriptor;
setDefaultPageTitle(RefactoringMessages.ExtractClassWizard_page_title);
}