• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RefactoringWizard类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.ltk.ui.refactoring.RefactoringWizard的典型用法代码示例。如果您正苦于以下问题:Java RefactoringWizard类的具体用法?Java RefactoringWizard怎么用?Java RefactoringWizard使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RefactoringWizard类属于org.eclipse.ltk.ui.refactoring包,在下文中一共展示了RefactoringWizard类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
	}
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:33,代码来源:RefactoringStarter.java


示例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
    }
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:RenameKeyAction.java


示例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
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:RefactoringStarter.java


示例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());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:20,代码来源:ReorgMoveStarter.java


示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:RefactoringWizardOpenOperation_NonForking.java


示例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);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:8,代码来源:RenamePluginWizard.java


示例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
}
  }
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:18,代码来源:RenameKeyAction.java


示例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());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:RefactoringExecutionStarter.java


示例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());
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:12,代码来源:RefactoringExecutionStarter.java


示例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) {}
	}
 
开发者ID:chrisGerken,项目名称:transformAuthoring,代码行数:16,代码来源:ReplaceTokens.java


示例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;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:8,代码来源:RefactoringWizardOpenOperation_NonForking.java


示例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);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:7,代码来源:RenameProductWizard.java


示例16: RenameFeatureWizard

import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public RenameFeatureWizard(IFeatureModel featureModel) {
	super(new EmptyRefactoring(), RefactoringWizard.DIALOG_BASED_USER_INTERFACE | RefactoringWizard.NO_PREVIEW_PAGE);
	setWindowTitle(TITLE);

	this.refactoringInfo = new FeatureRefactoringInfo(featureModel);
}
 
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:7,代码来源:RenameFeatureWizard.java


示例17: ForeachLoopToLambdaRefactoringWizard

import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public ForeachLoopToLambdaRefactoringWizard(Refactoring refactoring) {
	super(refactoring, RefactoringWizard.DIALOG_BASED_USER_INTERFACE);
}
 
开发者ID:mdarefin,项目名称:Convert-For-Each-Loop-to-Lambda-Expression-Eclipse-Plugin,代码行数:4,代码来源:ForeachLoopToLambdaRefactoringWizard.java


示例18: Tuple

import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
public Tuple(Class<? extends UserInterfaceStarter> s, Class<? extends RefactoringWizard> w) {
	starter= s;
	wizard= w;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:UserInterfaceManager.java


示例19: put

import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
protected void put(Class<? extends RefactoringProcessor> processor, Class<? extends UserInterfaceStarter> starter, Class<? extends RefactoringWizard> wizard) {
	fMap.put(processor, new Tuple(starter, wizard));
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:4,代码来源:UserInterfaceManager.java


示例20: getWizardFlags

import org.eclipse.ltk.ui.refactoring.RefactoringWizard; //导入依赖的package包/类
protected int getWizardFlags() {
    return RefactoringWizard.WIZARD_BASED_USER_INTERFACE;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:4,代码来源:AbstractRefactoringAction.java



注:本文中的org.eclipse.ltk.ui.refactoring.RefactoringWizard类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JacksonStore类代码示例发布时间:2022-05-21
下一篇:
Java SpecificRecordBase类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap