[Nice-commit] eclipse/src/nice/eclipse/ui/wizards NewNiceFileCreationWizard.nice,NONE,1.1 _wizards.n
Brought to you by:
bonniot
From: <ag...@us...> - 2003-08-09 03:23:21
|
Update of /cvsroot/nice/eclipse/src/nice/eclipse/ui/wizards In directory sc8-pr-cvs1:/tmp/cvs-serv19849/src/nice/eclipse/ui/wizards Modified Files: _wizards.nice Added Files: NewNiceFileCreationWizard.nice Log Message: syntax highlight proto --- NEW FILE: NewNiceFileCreationWizard.nice --- /**************************************************************************/ /* Nice Eclipse-Plugin */ /* (c) Alex Greif 2003 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.eclipse.ui.wizards; public class NewNiceFileCreationWizard extends Wizard implements INewWizard { NiceFileCreationWizardPage wizardPage = cast(null); IStructuredSelection selection = cast(null); IWorkbench workbench = cast(null); addPages() { wizardPage = new NiceFileCreationWizardPage(workbench: workbench, "niceFileCreationPage", // pageName selection // selection ); this.addPage(wizardPage); } //void init(IWorkbench aWorkbench,IStructuredSelection currentSelection) { init(aWorkbench, currentSelection) { workbench = notNull(aWorkbench); selection = notNull(currentSelection); } performFinish(){ return wizardPage.finish(); } } class NiceFileCreationWizardPage extends WizardNewFileCreationPage //implements SelectionListener { IWorkbench workbench; String pageName = cast(null); IStructuredSelection selection = cast(null); // initializer { this.setTitle("Create Nice File"); this.setDescription("Create a new Nice file resource"); //this.setImageDescriptor(ImageDescriptor.createFromFile(getClass(),"icons/logicbanner.gif")); //$NON-NLS-1$ } validatePage() {return super;} createControl(parentComposite) { super; this.setFileName("untitled.nice"); //$NON-NLS-2$//$NON-NLS-1$ this.setPageComplete(this.validatePage()); } boolean finish() { ?IFile newFile = this.createNewFile(); if (newFile == null) return false; // ie.- creation was unsuccessful // Since the file resource was created fine, open it for editing // iff requested by the user try { ?IWorkbenchWindow dwindow = workbench.getActiveWorkbenchWindow(); if (dwindow != null) { ?IWorkbenchPage page = dwindow.getActivePage(); if (page != null) page.openEditor(newFile); } } catch (org.eclipse.ui.PartInitException e) { e.printStackTrace(); return false; } return true; } } Index: _wizards.nice =================================================================== RCS file: /cvsroot/nice/eclipse/src/nice/eclipse/ui/wizards/_wizards.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _wizards.nice 1 Aug 2003 20:09:43 -0000 1.1 --- _wizards.nice 9 Aug 2003 03:23:17 -0000 1.2 *************** *** 20,23 **** --- 20,24 ---- import org.eclipse.jface.operation.*; import org.eclipse.jface.viewers.*; + import org.eclipse.jface.wizard.*; import org.eclipse.ui.actions.*; |