[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.jdt] Hot to create New Java Wizard by using some code ?
|
Hello, have to create a New Java Wizard for example or some wizard for
new project my purpose is form cheat sheet to call some action, and in
action to create this wizard. A try with follow code but there is a
problem when try to instance BasicNewFileResourceWizard.
Where I wrong ?
public void run(String[] params, ICheatSheetManager manager) {
String projectName = null;
if (params != null && params.length > 0) {
projectName = params[0];
} else {
projectName = "PhiDesigner";
}
// as IWorkbenchWizard
IWorkbenchWizard wizard = new BasicNewFileResourceWizard();
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
IWorkbenchWindow window =
PlatformUI.getWorkbench().getActiveWorkbenchWindow();
wizard.init((IWorkbench) window, new StructuredSelection());
WizardDialog dialog = new
WizardDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
(IWizard)wizard);
dialog.create();
dialog.getShell().setSize(Math.max(SIZING_WIZARD_WIDTH,
dialog.getShell().getSize().x), SIZING_WIZARD_HEIGHT);
dialog.open();
notifyResult(dialog.getReturnCode() == Dialog.OK);
}
Thanks in advance.