Getting user data in NewProjectCreationPage in Eclipse Plugin -
i have been successful in making plugin. need on project creation page add more textboxes user information. need use information add auto generated .php files made in project directory.
i want know how can override wizardnewprojectcreationpage
add more textboxes given layout. pretty new plugin development. here code custom wizard.
import java.net.uri; import org.eclipse.core.runtime.coreexception; import org.eclipse.core.runtime.iconfigurationelement; import org.eclipse.core.runtime.iexecutableextension; import org.eclipse.jface.viewers.istructuredselection; import org.eclipse.jface.wizard.wizard; import org.eclipse.jface.wizard.wizarddialog; import org.eclipse.ui.inewwizard; import org.eclipse.ui.iworkbench; import org.eclipse.ui.dialogs.wizardnewprojectcreationpage; import org.eclipse.ui.wizards.newresource.basicnewprojectresourcewizard; import rudraxplugin.pages.mypageone; import rudraxplugin.projects.rudraxsupport; public class customprojectnewwizard extends wizard implements inewwizard, iexecutableextension { private wizardnewprojectcreationpage _pageone; protected mypageone one; private iconfigurationelement _configurationelement; public customprojectnewwizard() { // todo auto-generated constructor stub setwindowtitle("rudrax"); } @override public void init(iworkbench workbench, istructuredselection selection) { // todo auto-generated method stub } @override public void addpages() { super.addpages(); _pageone = new wizardnewprojectcreationpage("from scratch project wizard"); _pageone.settitle("from scratch project"); _pageone.setdescription("create scratch."); addpage(one); addpage(_pageone); } @override public boolean performfinish() { string name = _pageone.getprojectname(); uri location = null; if (!_pageone.usedefaults()) { location = _pageone.getlocationuri(); system.err.println("location: " + location.tostring()); //$non-nls-1$ } // else location == null rudraxsupport.createproject(name, location); // add basicnewprojectresourcewizard.updateperspective(_configurationelement); return true; } @override public void setinitializationdata(iconfigurationelement config, string propertyname, object data) throws coreexception { _configurationelement = config; // todo auto-generated method stub } }
ask other code required. appreciated. thank you.
instead of using wizardnewprojectcreationpage
directly create new class extending wizardnewprojectcreationpage
, override createcontrol
method create new controls:
class mynewprojectcreationpage extends wizardnewprojectcreationpage { @override public void createcontrol(composite parent) { super.createcontrol(parent); composite body = (composite)getcontrol(); ... create new controls here } }
Comments
Post a Comment