當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。