當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。