本文整理汇总了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.");
}
}
示例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());
}
}
示例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;
}
示例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);
}
示例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());
}
}
示例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);
}
示例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);
}
示例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;
}
示例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();
}
});
}
示例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());
}
示例11: MoveRefactoringSession
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //导入依赖的package包/类
public MoveRefactoringSession(Refactoring refactoring, JavaMoveProcessor processor) {
super(refactoring);
this.processor = processor;
}
示例12: ReorgMoveStarter
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //导入依赖的package包/类
private ReorgMoveStarter(JavaMoveProcessor moveProcessor) {
Assert.isNotNull(moveProcessor);
fMoveProcessor= moveProcessor;
}
示例13: isTextualMove
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //导入依赖的package包/类
private static boolean isTextualMove(JavaMoveProcessor moveProcessor) {
return moveProcessor.isTextualMove();
}
示例14: MoveInputPage
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //导入依赖的package包/类
public MoveInputPage(JavaMoveProcessor moveProcessor) {
super(PAGE_NAME);
fMoveProcessor= moveProcessor;
}
示例15: getJavaMoveProcessor
import org.eclipse.jdt.internal.corext.refactoring.reorg.JavaMoveProcessor; //导入依赖的package包/类
private JavaMoveProcessor getJavaMoveProcessor(){
return fMoveProcessor;
}