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


Java JavaMoveProcessor類代碼示例

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


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

示例1: createMoveRefactoringSession

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
/**
 * Create move refactoring session.
 *
 * @param javaElements the java elements
 * @return the ID of the refactoring session
 */
public String createMoveRefactoringSession(IJavaElement[] javaElements)
    throws JavaModelException, RefactoringException {
  IReorgPolicy.IMovePolicy policy =
      ReorgPolicyFactory.createMovePolicy(new IResource[0], javaElements);
  if (policy.canEnable()) {
    JavaMoveProcessor processor = new JavaMoveProcessor(policy);
    // TODO this may overwrite existing sources.
    processor.setReorgQueries(new NullReorgQueries());
    processor.setCreateTargetQueries(() -> null);
    Refactoring refactoring = new MoveRefactoring(processor);
    MoveRefactoringSession session = new MoveRefactoringSession(refactoring, processor);
    final String id = String.format("move-%s", sessionId.getAndIncrement());
    sessions.put(id, session);
    return id;
  } else {
    throw new RefactoringException("Can't create move refactoring session.");
  }
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:25,代碼來源:RefactoringManager.java

示例2: updateUIStatus

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private void updateUIStatus() {
	getRefactoringWizard().setForcePreviewReview(false);
	JavaMoveProcessor processor= getJavaMoveProcessor();
	if (fReferenceCheckbox != null){
		processor.setUpdateReferences(fReferenceCheckbox.getSelection());
	}
	if (fQualifiedNameCheckbox != null){
		boolean enabled= processor.canEnableQualifiedNameUpdating();
		fQualifiedNameCheckbox.setEnabled(enabled);
		if (enabled) {
			fQualifiedNameComponent.setEnabled(processor.getUpdateQualifiedNames());
			if (processor.getUpdateQualifiedNames())
				getRefactoringWizard().setForcePreviewReview(true);
		} else {
			fQualifiedNameComponent.setEnabled(false);
		}
		processor.setUpdateQualifiedNames(fQualifiedNameCheckbox.getEnabled() && fQualifiedNameCheckbox.getSelection());
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:20,代碼來源:ReorgMoveWizard.java

示例3: handleValidateMove

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private int handleValidateMove(Object target) throws JavaModelException {
	if (target == null)
		return DND.DROP_NONE;

	IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(ReorgUtils.getResources(fElements), ReorgUtils.getJavaElements(fElements));
	fMoveProcessor= (policy.canEnable()) ? new JavaMoveProcessor(policy) : null;

	if (!canMoveElements())
		return DND.DROP_NONE;

	if (fMoveProcessor == null)
		return DND.DROP_NONE;

	if (!fMoveProcessor.setDestination(ReorgDestinationFactory.createDestination(target)).isOK())
		return DND.DROP_NONE;

	return DND.DROP_MOVE;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:19,代碼來源:JavaDropAdapterAssistant.java

示例4: createRefactoring

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
/**
 * {@inheritDoc}
 */
@Override
public final Refactoring createRefactoring(JavaRefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException {
	JavaRefactoringArguments arguments= new JavaRefactoringArguments(descriptor.getProject(), retrieveArgumentMap(descriptor));
	JavaMoveProcessor processor= new JavaMoveProcessor(arguments, status);
	return new MoveRefactoring(processor);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:MoveRefactoringContribution.java

示例5: startMoveRefactoring

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
public static void startMoveRefactoring(final IResource[] resources, final IJavaElement[] elements, final Shell shell) throws JavaModelException {
	IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, elements);
	if (policy.canEnable()) {
		JavaMoveProcessor processor= new JavaMoveProcessor(policy);
		Refactoring refactoring= new MoveRefactoring(processor);
		RefactoringWizard wizard= new ReorgMoveWizard(processor, refactoring);
		processor.setCreateTargetQueries(new CreateTargetQueries(wizard));
		processor.setReorgQueries(new ReorgQueries(wizard));
		new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, processor.getSaveMode());
	}
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:12,代碼來源:RefactoringExecutionStarter.java

示例6: create

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
public static ReorgMoveStarter create(IJavaElement[] javaElements, IResource[] resources, IReorgDestination destination) throws JavaModelException {
	Assert.isNotNull(javaElements);
	Assert.isNotNull(resources);
	Assert.isNotNull(destination);
	IMovePolicy policy= ReorgPolicyFactory.createMovePolicy(resources, javaElements);
	if (!policy.canEnable())
		return null;
	JavaMoveProcessor processor= new JavaMoveProcessor(policy);
	if (processor.setDestination(destination).hasError())
		return null;
	return new ReorgMoveStarter(processor);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:13,代碼來源:ReorgMoveStarter.java

示例7: ReorgMoveWizard

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
public ReorgMoveWizard(JavaMoveProcessor moveProcessor, Refactoring ref) {
	super(ref, DIALOG_BASED_USER_INTERFACE);
	fMoveProcessor= moveProcessor;
	if (isTextualMove(fMoveProcessor))
		setDefaultPageTitle(ReorgMessages.ReorgMoveWizard_textual_move);
	else
		setDefaultPageTitle(ReorgMessages.ReorgMoveWizard_3);
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:9,代碼來源:ReorgMoveWizard.java

示例8: verifyDestination

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
@Override
protected RefactoringStatus verifyDestination(Object selected) throws JavaModelException{
	JavaMoveProcessor processor= getJavaMoveProcessor();
	final RefactoringStatus refactoringStatus= processor.setDestination(ReorgDestinationFactory.createDestination(selected));

	updateUIStatus();
	fDestination= selected;
	return refactoringStatus;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:10,代碼來源:ReorgMoveWizard.java

示例9: addUpdateReferenceComponent

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private void addUpdateReferenceComponent(Composite result) {
	final JavaMoveProcessor processor= getJavaMoveProcessor();
	if (! processor.canUpdateJavaReferences())
		return;

	String text;
	int resources= getResources().length;
	int javaElements= getJavaElements().length;
	if (resources == 0 && javaElements == 1) {
		text= Messages.format(
				ReorgMessages.JdtMoveAction_update_references_singular,
				JavaElementLabels.getElementLabel(getJavaElements()[0], LABEL_FLAGS));
	} else if (resources == 1 && javaElements == 0) {
		text= Messages.format(
				ReorgMessages.JdtMoveAction_update_references_singular,
				BasicElementLabels.getResourceName(getResources()[0]));
	} else {
		text= Messages.format(
				ReorgMessages.JdtMoveAction_update_references_plural,
				String.valueOf(resources + javaElements));
	}

	fReferenceCheckbox= new Button(result, SWT.CHECK);
	fReferenceCheckbox.setText(text);
	fReferenceCheckbox.setSelection(processor.getUpdateReferences());

	fReferenceCheckbox.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			processor.setUpdateReferences(((Button)e.widget).getSelection());
			updateUIStatus();
		}
	});
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:35,代碼來源:ReorgMoveWizard.java

示例10: addUpdateQualifiedNameComponent

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private void addUpdateQualifiedNameComponent(Composite parent, int marginWidth) {
	final JavaMoveProcessor processor= getJavaMoveProcessor();
	if (!processor.canEnableQualifiedNameUpdating() || !processor.canUpdateQualifiedNames())
		return;
	fQualifiedNameCheckbox= new Button(parent, SWT.CHECK);
	int indent= marginWidth + fQualifiedNameCheckbox.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
	fQualifiedNameCheckbox.setText(RefactoringMessages.RenameInputWizardPage_update_qualified_names);
	fQualifiedNameCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	fQualifiedNameCheckbox.setSelection(processor.getUpdateQualifiedNames());

	fQualifiedNameComponent= new QualifiedNameComponent(parent, SWT.NONE, processor, getRefactoringSettings());
	fQualifiedNameComponent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	GridData gd= (GridData)fQualifiedNameComponent.getLayoutData();
	gd.horizontalAlignment= GridData.FILL;
	gd.horizontalIndent= indent;
	updateQualifiedNameUpdating(processor, processor.getUpdateQualifiedNames());

	fQualifiedNameCheckbox.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			boolean enabled= ((Button)e.widget).getSelection();
			updateQualifiedNameUpdating(processor, enabled);
		}
	});
	fQualifiedNameCheckbox.setSelection(getRefactoringSettings().getBoolean(UPDATE_QUALIFIED_NAMES));
	updateQualifiedNameUpdating(processor, fQualifiedNameCheckbox.getSelection());
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:28,代碼來源:ReorgMoveWizard.java

示例11: MoveRefactoringSession

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
public MoveRefactoringSession(Refactoring refactoring, JavaMoveProcessor processor) {
  super(refactoring);
  this.processor = processor;
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:5,代碼來源:MoveRefactoringSession.java

示例12: ReorgMoveStarter

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private ReorgMoveStarter(JavaMoveProcessor moveProcessor) {
	Assert.isNotNull(moveProcessor);
	fMoveProcessor= moveProcessor;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:5,代碼來源:ReorgMoveStarter.java

示例13: isTextualMove

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private static boolean isTextualMove(JavaMoveProcessor moveProcessor) {
	return moveProcessor.isTextualMove();
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:4,代碼來源:ReorgMoveWizard.java

示例14: MoveInputPage

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
public MoveInputPage(JavaMoveProcessor moveProcessor) {
	super(PAGE_NAME);
	fMoveProcessor= moveProcessor;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:5,代碼來源:ReorgMoveWizard.java

示例15: getJavaMoveProcessor

import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //導入依賴的package包/類
private JavaMoveProcessor getJavaMoveProcessor(){
	return fMoveProcessor;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:4,代碼來源:ReorgMoveWizard.java


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