How to open a filedialog within an Eclipse Wizard -
i'm writing eclipseplugin, has create new project. works far, need copy external file projectfolder. intend have 'browse' button on 1 of wizardpages, opens filedialog, user can browse file , after closing dialog can use path file various actions. problem dialog window never opens. right i'm trying way (snippet wizardpage):
public void createcontrol(composite composite) { this.container = new composite(composite, swt.none); gridlayout layout = new gridlayout(); this.container.setlayout(layout); layout.numcolumns = 2; button browsebutton = new button(this.container, swt.push); browsebutton.settext("browse"); browsebutton.addselectionlistener(new selectionlistener() { @override public void widgetdefaultselected(selectionevent arg0) { filedialog filedialog = new filedialog(datapage.this.container.getshell(), swt.open); filedialog.settext("jzos created file"); string path = filedialog.open(); datapage.this.setjzoscreatedname(path); } });
i tried several implementations, have seen in examples , tutorials nothing did work. i'm assuming problem shell give filedialog. tried open new shell within widgetdefaultselected
function didn't work either. suggestions?
you should using widgetselected
method of selectionlistener
not widgetdefaultselected
Comments
Post a Comment