albumwizardhandler.java

来自「eclise rcp 项目,是非常好的学习源码」· Java 代码 · 共 26 行

JAVA
26
字号
package com.siemens.ct.mp3m.ui.wizards;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.handlers.HandlerUtil;

public class AlbumWizardHandler extends AbstractHandler implements IHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		// Instantiates and initializes the wizard
		AlbumWizard wizard = new AlbumWizard();
		
		// Instantiates the wizard container with the wizard and opens it
		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
		WizardDialog dialog = new WizardDialog( window.getShell(), wizard);
		dialog.create();
		dialog.open();
		return null;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?