当前位置: 首页>>代码示例>>Java>>正文


Java IWorkbenchWizard类代码示例

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


IWorkbenchWizard类属于org.eclipse.ui包,在下文中一共展示了IWorkbenchWizard类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openWizard

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
public static void openWizard(final String id, final IStructuredSelection selection) {
	// First see if this is a "new wizard".
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(id);
	// If not check if it is an "import wizard".
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getImportWizardRegistry().findWizard(id);
	}
	// Or maybe an export wizard
	if (descriptor == null) {
		descriptor = PlatformUI.getWorkbench().getExportWizardRegistry().findWizard(id);
	}
	try {
		// Then if we have a wizard, open it.
		if (descriptor != null) {
			final IWorkbenchWizard wizard = descriptor.createWizard();
			wizard.init(PlatformUI.getWorkbench(), selection);
			final WizardDialog wd = new WizardDialog(WorkbenchHelper.getDisplay().getActiveShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		}
	} catch (final CoreException e) {
		e.printStackTrace();
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:25,代码来源:GamaNavigatorMenu.java

示例2: createNewPackageQuery

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
public ICreateTargetQuery createNewPackageQuery() {
	return new ICreateTargetQuery() {
		public Object getCreatedTarget(Object selection) {
			IWorkbenchWizard packageCreationWizard= new NewPackageCreationWizard();

			IWizardPage[] pages= openNewElementWizard(packageCreationWizard, getShell(), selection);

			NewPackageWizardPage page= (NewPackageWizardPage) pages[0];
			return page.getNewPackageFragment();
		}

		public String getNewButtonLabel() {
			return ReorgMessages.ReorgMoveWizard_newPackage;
		}
	};
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:CreateTargetQueries.java

示例3: execute

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Execute
public void execute(@Named("eu.cloudscaleproject.env.common.command.openwizard.param.id") String wizardID) {
	
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry()
			.findWizard(wizardID);
	
	if(descriptor != null){
		try {
			IWorkbenchWizard wizard = (IWorkbenchWizard)descriptor.createWizard();
			wizard.init(PlatformUI.getWorkbench(), null);
			
			WizardDialog wd = new  WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
	
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:OpenWizardHandler.java

示例4: execute

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Execute
public void execute(CommandExecutor commandExecutor) {
	
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry()
			.findWizard("eu.cloudscaleproject.env.product.wizard.newproject");
	
	if(descriptor != null){
		try {
			IWorkbenchWizard wizard = (IWorkbenchWizard)descriptor.createWizard();
			wizard.init(PlatformUI.getWorkbench(), null);
			
			WizardDialog wd = new  WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		} catch (CoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:CreateNewProjectHadler.java

示例5: execute

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Execute
public void execute(CommandExecutor commandExecutor) {
	
	IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry()
			.findWizard("eu.cloudscaleproject.env.product.wizard.exampleproject");
	
	if(descriptor != null){
		try {
			IWorkbenchWizard wizard = (IWorkbenchWizard)descriptor.createWizard();
			wizard.init(PlatformUI.getWorkbench(), null);
			
			WizardDialog wd = new  WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), wizard);
			wd.setTitle(wizard.getWindowTitle());
			wd.open();
		} catch (CoreException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:21,代码来源:CreateNewExampleProjectHandler.java

示例6: run

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
/**
 * The user has invoked this action.
 */
public void run() {
    Shell shell= VerilogPlugin.getActiveWorkbenchShell();
    try {
        Wizard wizard= createWizard();
        if (wizard instanceof IWorkbenchWizard) {
            ((IWorkbenchWizard)wizard).init(getWorkbench(), getCurrentSelection());
        }
        
        WizardDialog dialog= new WizardDialog(shell, wizard);
        dialog.create();
        int res= dialog.open();
        
        notifyResult(res == Window.OK);
    } catch (CoreException e) {
        MessageUI.error(e);
    }
}
 
开发者ID:Elphel,项目名称:vdt-plugin,代码行数:21,代码来源:AbstractOpenWizardAction.java

示例7: createTheProject

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Override
protected IProject createTheProject() throws Exception {
    final IWorkbench theWorkbench = get_the_workbench();
    final IWizardRegistry theNewWizardRegistry = theWorkbench.getNewWizardRegistry();
    final IWizardDescriptor wizardDescriptor = theNewWizardRegistry.findWizard(Activator.EXAMPLE_WIZARD_ID);

    final IWorkbenchWizard theWizard = wizardDescriptor.createWizard();
    theWizard.init(theWorkbench, StructuredSelection.EMPTY);

    final WizardDialog theDialog = new WizardDialog(null, theWizard);
    theDialog.setBlockOnOpen(false);
    theDialog.open();

    select_the_default_button(theDialog);

    return get_the_project(getTheProjectName());
}
 
开发者ID:info-sharing-environment,项目名称:NIEM-Modeling-Tool,代码行数:18,代码来源:CreatesAnExampleProject.java

示例8: getInstanceWizard

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
/**
 * Gets an editor instance creation wizard for this editor type.
 * 
 * @param initialSelection
 *            The selection used to initialize the wizard.
 * @return The editor creation wizard.
 * @throws MMINTException
 *             if the editor creation wizard couln't be found or
 *             initialized.
 * @generated NOT
 */
protected IWorkbenchWizard getInstanceWizard(IStructuredSelection initialSelection) throws MMINTException {

    Model modelType = MIDTypeRegistry.<Model>getType(getModelUri());
    IWorkbenchWizard wizard;
    if (getWizardId() == null) {
        EClass rootEClass = (EClass) modelType.getEMFTypeRoot().getEClassifiers().get(0);
        wizard = new DynamicModelWizard(rootEClass);
    }
    else {
        IWizardDescriptor descriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(getWizardId());
        if (descriptor == null) {
            throw new MMINTException("Wizard " + getId() + " not found");
        }
        try {
            wizard = descriptor.createWizard();
        }
        catch (CoreException e) {
            throw new MMINTException("Error creating the wizard", e);
        }
    }
    wizard.init(PlatformUI.getWorkbench(), initialSelection);

    return wizard;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:36,代码来源:EditorImpl.java

示例9: createCustomInstanceWizard

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
/**
 * Creates a custom editor instance creation wizard dialog for this editor
 * type.
 * 
 * @param wizard
 *            The editor creation wizard.
 * @return The editor creation wizard dialog.
 * @generated NOT
 */
protected EditorCreationWizardDialog createCustomInstanceWizard(IWorkbenchWizard wizard) {

    EditorCreationWizardDialog wizDialog;
    String wizardDialogClassName = getWizardDialogClass();
    Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
    try {
        wizDialog = (EditorCreationWizardDialog)
            MIDTypeRegistry.getTypeBundle(getUri()).
            loadClass(wizardDialogClassName).
            getConstructor(Shell.class, IWizard.class).
            newInstance(shell, wizard);
    }
    catch (Exception e) {
        MMINTException.print(IStatus.WARNING, "Custom editor creation wizard not found: " + wizardDialogClassName + " , using default as fallback", e);
        wizDialog = new EditorCreationWizardDialog(shell, wizard);
    }

    return wizDialog;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:29,代码来源:EditorImpl.java

示例10: invokeInstanceWizard

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
/**
 * @generated NOT
 */
public EditorCreationWizardDialog invokeInstanceWizard(IStructuredSelection initialSelection) throws MMINTException {

    MMINTException.mustBeType(this);

    IWorkbenchWizard wizard = getInstanceWizard(initialSelection);
    EditorCreationWizardDialog wizDialog;
    if (getWizardDialogClass() == null) {
        Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
        wizDialog = new EditorCreationWizardDialog(shell, wizard);
    }
    else {
        wizDialog = createCustomInstanceWizard(wizard);
    }
    wizDialog.setTitle(wizard.getWindowTitle());
    if (wizDialog.open() == Window.CANCEL) {
        return null;
    }

    return wizDialog;
}
 
开发者ID:adisandro,项目名称:MMINT,代码行数:24,代码来源:EditorImpl.java

示例11: run

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Override
public void run() {
	String wizardId = getWizardId();
	try {
		IWorkbenchWizard wizard = PlatformUI.getWorkbench()
				.getNewWizardRegistry()
				.findWizard(wizardId)
				.createWizard();
		if (wizard instanceof INewModelWizard) {
			INewModelWizard modelWizard = (INewModelWizard) wizard;
			modelWizard.setCategory(category);
		}
		WizardDialog dialog = new WizardDialog(UI.shell(), wizard);
		dialog.open();
		Navigator.refresh(parent);
	} catch (final CoreException e) {
		log.error("Open model wizard failed", e);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:20,代码来源:CreateModelAction.java

示例12: openProcessWizard

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
private void openProcessWizard() {
	Flow flow = getModel();
	try {
		String wizardId = "wizards.new.process";
		IWorkbenchWizard w = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(wizardId).createWizard();
		if (!(w instanceof ProcessWizard))
			return;
		ProcessWizard wizard = (ProcessWizard) w;
		wizard.setRefFlow(flow);
		WizardDialog dialog = new WizardDialog(UI.shell(), wizard);
		if (dialog.open() == Window.OK) {
			Navigator.refresh(Navigator.findElement(ModelType.PROCESS));
		}
	} catch (Exception e) {
		Logger log = LoggerFactory.getLogger(getClass());
		log.error("failed to open process dialog from flow " + flow, e);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:19,代码来源:FlowInfoPage.java

示例13: doIt

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
private void doIt() {
	try {
		String wizardId = "wizards.new.productsystem";
		IWorkbenchWizard wizard = PlatformUI.getWorkbench()
				.getNewWizardRegistry().findWizard(wizardId).createWizard();
		if (!(wizard instanceof ProductSystemWizard))
			return;
		ProductSystemWizard systemWizard = (ProductSystemWizard) wizard;
		systemWizard.setProcess(process);
		WizardDialog dialog = new WizardDialog(UI.shell(), wizard);
		if (dialog.open() == Window.OK) {
			Navigator.refresh(Navigator.findElement(ModelType.PRODUCT_SYSTEM));
		}
	} catch (Exception e) {
		Logger log = LoggerFactory.getLogger(getClass());
		log.error("failed to open product system dialog for process", e);
	}
}
 
开发者ID:GreenDelta,项目名称:olca-app,代码行数:19,代码来源:SystemCreation.java

示例14: openWizardForModule

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
/**
 * Opens the wizard with the given id and passes it the selection.
 *
 * @param wizardId
 *            The wizard id of the eclipse newWizard registry
 * @param selection
 *            The selection
 */
private void openWizardForModule(String wizardId, IStructuredSelection selection, boolean nested) {

	// Retrieve wizard from registry
	IWizardDescriptor wizardDescriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(wizardId);

	if (wizardDescriptor == null) {
		return;
	}

	try {
		IWorkbenchWizard wizard = wizardDescriptor.createWizard();

		// Inject wizard members
		injector.injectMembers(wizard);

		// Create and open a new wizard dialog
		WizardDialog wizardDialog = new WizardDialog(UIUtils.getShell(), wizard);

		// If the wizard supports it, enable in module option
		if (wizard instanceof N4JSNewClassifierWizard<?>) {
			((N4JSNewClassifierWizard<?>) wizard).init(PlatformUI.getWorkbench(), selection, nested);
		} else {
			// Otherwise just pass it the initial selection
			wizard.init(PlatformUI.getWorkbench(), selection);
		}

		// wizardDialog.setTitle(wizard.getWindowTitle());
		wizardDialog.open();

	} catch (CoreException e) {
		/** Failed to create the wizard */
		Shell workbenchShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		MessageDialog.open(MessageDialog.ERROR, workbenchShell, "Failed to launch wizard",
				String.format("Failed to launch wizard %s", wizardId), SWT.SHEET);
		return;
	}

}
 
开发者ID:eclipse,项目名称:n4js,代码行数:47,代码来源:CreateNewN4JSElementInModuleHandler.java

示例15: runWithStructuredSelection

import org.eclipse.ui.IWorkbenchWizard; //导入依赖的package包/类
@Override
public void runWithStructuredSelection(IStructuredSelection selection) {
    IWorkbenchWizard wizard = getWizard(selection);
    wizard.init(getWorkbench(), selection);
    WizardDialog wizardDialog = new WizardDialog(getActiveShell(), wizard);

    wizardDialog.setBlockOnOpen(true);
    wizardDialog.open();
}
 
开发者ID:baloise,项目名称:eZooKeeper,代码行数:10,代码来源:BaseWizardAction.java


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