本文整理汇总了Java中org.eclipse.ltk.ui.refactoring.RefactoringWizard类的典型用法代码示例。如果您正苦于以下问题:Java RefactoringWizard类的具体用法?Java RefactoringWizard怎么用?Java RefactoringWizard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RefactoringWizard类属于org.eclipse.ltk.ui.refactoring包,在下文中一共展示了RefactoringWizard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* @param refactoring
* @param wizard
* @param parent
* @param dialogTitle
* @param saveMode
* a save mode from {@link RefactoringSaveHelper}
* @return <code>true</code> if the refactoring was executed,
* <code>false</code> otherwise
* @throws JavaScriptModelException
*/
public boolean activate(Refactoring refactoring, RefactoringWizard wizard, Shell parent, String dialogTitle,
int saveMode) {
RefactoringSaveHelper saveHelper = new RefactoringSaveHelper(saveMode);
if (!canActivate(saveHelper, parent))
return false;
try {
RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
int result = op.run(parent, dialogTitle);
fStatus = op.getInitialConditionCheckingStatus();
if (result == IDialogConstants.CANCEL_ID
|| result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED) {
saveHelper.triggerIncrementalBuild();
return false;
} else {
return true;
}
} catch (InterruptedException e) {
return false; // User action got cancelled
}
}
示例2: run
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
@Override
public void run() {
KeyTreeNode node = getNodeSelection();
// Rename single item
RenameKeyProcessor refactoring = new RenameKeyProcessor(node,
getBundleGroup());
RefactoringWizard wizard = new RenameKeyWizard(node, refactoring);
try {
RefactoringWizardOpenOperation operation = new RefactoringWizardOpenOperation(
wizard);
operation.run(getShell(), "Introduce Indirection");
} catch (InterruptedException exception) {
// Do nothing
}
}
示例3: activate
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public boolean activate(RefactoringWizard wizard, Shell parent, String dialogTitle, int saveMode) {
RefactoringSaveHelper saveHelper= new RefactoringSaveHelper(saveMode);
if (! canActivate(saveHelper, parent))
return false;
try {
RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(wizard);
int result= op.run(parent, dialogTitle);
fStatus= op.getInitialConditionCheckingStatus();
if (result == IDialogConstants.CANCEL_ID || result == RefactoringWizardOpenOperation.INITIAL_CONDITION_CHECKING_FAILED) {
saveHelper.triggerIncrementalBuild();
return false;
} else {
return true;
}
} catch (InterruptedException e) {
return false; // User action got cancelled
}
}
示例4: run
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public boolean run(Shell parent) throws InterruptedException, InvocationTargetException {
Refactoring ref= new MoveRefactoring(fMoveProcessor);
if (fMoveProcessor.hasAllInputSet()) {
IRunnableContext context= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(parent));
fMoveProcessor.setReorgQueries(new ReorgQueries(parent));
new RefactoringExecutionHelper(ref, RefactoringCore.getConditionCheckingFailedSeverity(), fMoveProcessor.getSaveMode(), parent, context).perform(false, false);
return true;
} else {
RefactoringWizard wizard= new ReorgMoveWizard(fMoveProcessor, ref);
/*
* We want to get the shell from the refactoring dialog but it's not known at this point,
* so we pass the wizard and then, once the dialog is open, we will have access to its shell.
*/
fMoveProcessor.setCreateTargetQueries(new CreateTargetQueries(wizard));
fMoveProcessor.setReorgQueries(new ReorgQueries(wizard));
return new RefactoringStarter().activate(wizard, parent, RefactoringMessages.OpenRefactoringWizardAction_refactoring, fMoveProcessor.getSaveMode());
}
}
示例5: startRefactoring
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public static void startRefactoring(IMethod[] methods, Shell shell, Optional<IProgressMonitor> monitor)
throws JavaModelException {
// TODO: Will need to set the target type at some point but see #23.
Refactoring refactoring = Util.createRefactoring(methods, monitor);
RefactoringWizard wizard = new MigrateSkeletalImplementationToInterfaceRefactoringWizard(refactoring);
new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring,
RefactoringSaveHelper.SAVE_REFACTORING);
}
开发者ID:ponder-lab,项目名称:Migrate-Skeletal-Implementation-to-Interface-Refactoring,代码行数:10,代码来源:MigrateSkeletalImplementationToInterfaceRefactoringWizard.java
示例6: createRefactoringWizardDialog
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* Copied from {@link RefactoringUI} as the original is package private.
*/
protected Dialog createRefactoringWizardDialog(RefactoringWizard wizard, Shell parent) {
Dialog result;
if (needsWizardBasedUserInterface(wizard))
result = new RefactoringWizardDialog(parent, wizard);
else
result = new RefactoringWizardDialog2(parent, wizard);
return result;
}
示例7: RenamePluginWizard
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public RenamePluginWizard(IPluginModelBase pluginModel) {
super(new EmptyRefactoring(), RefactoringWizard.DIALOG_BASED_USER_INTERFACE | RefactoringWizard.NO_PREVIEW_PAGE);
setWindowTitle(TITLE);
this.refactoringInfo = new RefactoringPluginInfo();
this.refactoringInfo.setSelection(pluginModel);
}
示例8: RenameUMLElementRefactoringWizard
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* Instantiates the wizard.
*
* @param namedElement
* The UML element to be renamed.
* @param editor
* The editor that called the wizard.
*/
public RenameUMLElementRefactoringWizard(UMLReferencingElement<NamedElement> namedElement, IEditorPart editor) {
super(new RenameUMLElementRefactoring(), RefactoringWizard.DIALOG_BASED_USER_INTERFACE);
nameMightBeEmpty = determineIfNameMightBeEmpty(namedElement);
aliasIsAvailable = determineIfAliasIsAvailable(namedElement);
getTypedRefactoring().setElementToRename(namedElement);
Optional<String> umlName = Optional.ofNullable(namedElement.getReferencedElement()).map(NamedElement::getName);
Optional<String> umlAlias = Optional.ofNullable(namedElement.getReferencedElement())
.map(NamedElement::getNameExpression).map(StringExpression::getName);
String aliasToShow;
String nameToShow;
// please refer to handleValuesChanged() for an explanation of this piece of code
if (umlAlias.isPresent()) {
aliasToShow = umlName.orElse(null);
nameToShow = umlAlias.orElse(null);
} else {
nameToShow = umlName.orElse(null);
aliasToShow = null;
}
newAlias.setValue(aliasToShow);
newAlias.addChangeListener(e -> handleValuesChanged());
newName.setValue(nameToShow);
newName.addChangeListener(e -> handleValuesChanged());
getTypedRefactoring().setEditor(editor);
}
开发者ID:Cooperate-Project,项目名称:CooperateModelingEnvironment,代码行数:35,代码来源:RenameUMLElementRefactoringWizard.java
示例9: run
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
KeyTreeNode node = getNodeSelection();
// Rename single item
RenameKeyProcessor refactoring = new RenameKeyProcessor(node, getBundleGroup());
RefactoringWizard wizard = new RenameKeyWizard(node, refactoring);
try {
RefactoringWizardOpenOperation operation= new RefactoringWizardOpenOperation(wizard);
operation.run(getShell(), "Introduce Indirection");
} catch (InterruptedException exception) {
// Do nothing
}
}
示例10: startCopyRefactoring
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public static void startCopyRefactoring(IResource[] resources, IJavaElement[] javaElements, Shell shell) throws JavaModelException {
ICopyPolicy copyPolicy= ReorgPolicyFactory.createCopyPolicy(resources, javaElements);
if (copyPolicy.canEnable()) {
JavaCopyProcessor processor= new JavaCopyProcessor(copyPolicy);
Refactoring refactoring= new CopyRefactoring(processor);
RefactoringWizard wizard= new ReorgCopyWizard(processor, refactoring);
processor.setNewNameQueries(new NewNameQueries(wizard));
processor.setReorgQueries(new ReorgQueries(wizard));
new RefactoringStarter().activate(wizard, shell, RefactoringMessages.OpenRefactoringWizardAction_refactoring, processor.getSaveMode());
}
}
示例11: startMoveRefactoring
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的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());
}
}
示例12: run
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
// MessageDialog.openInformation(shell,"Refactor Plug-in","Replace Known Tokens was executed.");
Hashtable<String,String> ht = buildReplacements();
XaaTemplateRefactoring refactoring = new XaaTemplateRefactoring(file,ht);
TokenRefactoringWizard wizard = new TokenRefactoringWizard(refactoring,RefactoringWizard.DIALOG_BASED_USER_INTERFACE);
RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
try {
op.run(shell,"Replace Tokens");
} catch (InterruptedException e) {}
}
示例13: MigrateSkeletalImplementationToInterfaceRefactoringWizard
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public MigrateSkeletalImplementationToInterfaceRefactoringWizard(Refactoring refactoring) {
super(refactoring,
RefactoringWizard.DIALOG_BASED_USER_INTERFACE & RefactoringWizard.CHECK_INITIAL_CONDITIONS_ON_OPEN);
this.setWindowTitle(Messages.Name);
}
开发者ID:ponder-lab,项目名称:Migrate-Skeletal-Implementation-to-Interface-Refactoring,代码行数:6,代码来源:MigrateSkeletalImplementationToInterfaceRefactoringWizard.java
示例14: RefactoringWizardOpenOperation_NonForking
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
/**
* @see RefactoringWizardOpenOperation#RefactoringWizardOpenOperation
*/
public RefactoringWizardOpenOperation_NonForking(RefactoringWizard wizard) {
Assert.isNotNull(wizard);
fWizard = wizard;
}
示例15: RenameProductWizard
import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public RenameProductWizard(IProductModel productModel) {
super(new EmptyRefactoring(), RefactoringWizard.DIALOG_BASED_USER_INTERFACE | RefactoringWizard.NO_PREVIEW_PAGE);
setWindowTitle(TITLE);
this.refactoringInfo = new ProductRefactoringInfo(productModel);
}