當前位置: 首頁>>代碼示例>>Java>>正文


Java PushDownDescriptor類代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.refactoring.descriptors.PushDownDescriptor的典型用法代碼示例。如果您正苦於以下問題:Java PushDownDescriptor類的具體用法?Java PushDownDescriptor怎麽用?Java PushDownDescriptor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PushDownDescriptor類屬於org.eclipse.jdt.core.refactoring.descriptors包,在下文中一共展示了PushDownDescriptor類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createPushDownDescriptor

import org.eclipse.jdt.core.refactoring.descriptors.PushDownDescriptor; //導入依賴的package包/類
public static PushDownDescriptor createPushDownDescriptor() {
  return new PushDownDescriptor();
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:4,代碼來源:RefactoringSignatureDescriptorFactory.java

示例2: createChange

import org.eclipse.jdt.core.refactoring.descriptors.PushDownDescriptor; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
	try {
		final Map<String, String> arguments= new HashMap<String, String>();
		String project= null;
		final IType declaring= getDeclaringType();
		final IJavaProject javaProject= declaring.getJavaProject();
		if (javaProject != null)
			project= javaProject.getElementName();
		int flags= JavaRefactoringDescriptor.JAR_MIGRATION | JavaRefactoringDescriptor.JAR_REFACTORING | RefactoringDescriptor.STRUCTURAL_CHANGE | RefactoringDescriptor.MULTI_CHANGE;
		try {
			if (declaring.isLocal() || declaring.isAnonymous())
				flags|= JavaRefactoringDescriptor.JAR_SOURCE_ATTACHMENT;
		} catch (JavaModelException exception) {
			JavaPlugin.log(exception);
		}
		final String description= fMembersToMove.length == 1 ? Messages.format(RefactoringCoreMessages.PushDownRefactoring_descriptor_description_short_multi, BasicElementLabels.getJavaElementName(fMembersToMove[0].getElementName())) : RefactoringCoreMessages.PushDownRefactoring_descriptor_description_short;
		final String header= fMembersToMove.length == 1 ? Messages.format(RefactoringCoreMessages.PushDownRefactoring_descriptor_description_full, new String[] { JavaElementLabels.getElementLabel(fMembersToMove[0], JavaElementLabels.ALL_FULLY_QUALIFIED), JavaElementLabels.getElementLabel(declaring, JavaElementLabels.ALL_FULLY_QUALIFIED) }) : Messages.format(RefactoringCoreMessages.PushDownRefactoring_descriptor_description, new String[] { JavaElementLabels.getElementLabel(declaring, JavaElementLabels.ALL_FULLY_QUALIFIED) });
		final JDTRefactoringDescriptorComment comment= new JDTRefactoringDescriptorComment(project, this, header);
		final String[] settings= new String[fMembersToMove.length];
		for (int index= 0; index < settings.length; index++)
			settings[index]= JavaElementLabels.getElementLabel(fMembersToMove[index], JavaElementLabels.ALL_FULLY_QUALIFIED);
		comment.addSetting(JDTRefactoringDescriptorComment.createCompositeSetting(RefactoringCoreMessages.PushDownRefactoring_pushed_members_pattern, settings));
		addSuperTypeSettings(comment, true);
		final PushDownDescriptor descriptor= RefactoringSignatureDescriptorFactory.createPushDownDescriptor(project, description, comment.asString(), arguments, flags);
		if (fCachedDeclaringType != null)
			arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_INPUT, JavaRefactoringDescriptorUtil.elementToHandle(project, fCachedDeclaringType));
		for (int index= 0; index < fMembersToMove.length; index++) {
			arguments.put(JavaRefactoringDescriptorUtil.ATTRIBUTE_ELEMENT + (index + 1), JavaRefactoringDescriptorUtil.elementToHandle(project, fMembersToMove[index]));
			for (int offset= 0; offset < fMemberInfos.length; offset++) {
				if (fMemberInfos[offset].getMember().equals(fMembersToMove[index])) {
					switch (fMemberInfos[offset].getAction()) {
						case MemberActionInfo.PUSH_ABSTRACT_ACTION:
							arguments.put(ATTRIBUTE_ABSTRACT + (index + 1), Boolean.valueOf(true).toString());
							break;
						case MemberActionInfo.PUSH_DOWN_ACTION:
							arguments.put(ATTRIBUTE_PUSH + (index + 1), Boolean.valueOf(true).toString());
							break;
					}
				}
			}
		}
		return new DynamicValidationRefactoringChange(descriptor, RefactoringCoreMessages.PushDownRefactoring_change_name, fChangeManager.getAllChanges());
	} finally {
		pm.done();
		clearCaches();
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:52,代碼來源:PushDownRefactoringProcessor.java


注:本文中的org.eclipse.jdt.core.refactoring.descriptors.PushDownDescriptor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。