当前位置: 首页>>代码示例>>Java>>正文


Java ExtractClassDescriptor类代码示例

本文整理汇总了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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:ExtractClassRefactoring.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:RefactoringExecutionStarter.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:38,代码来源:ExtractClassRefactoring.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:ExtractClassContribution.java

示例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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:8,代码来源:ExtractClassWizard.java

示例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);
}
 
开发者ID:eclipse,项目名称:che,代码行数:6,代码来源:RefactoringSignatureDescriptorFactory.java

示例7: ExtractClassDescriptorVerification

import org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor; //导入依赖的package包/类
public ExtractClassDescriptorVerification(ExtractClassDescriptor descriptor) {
	fDescriptor= descriptor;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:ExtractClassRefactoring.java

示例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);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:6,代码来源:ExtractClassWizard.java


注:本文中的org.eclipse.jdt.core.refactoring.descriptors.ExtractClassDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。