Wizard and WizardPage [message #463690] |
Fri, 11 November 2005 19:29 |
Eclipse User |
|
|
|
Originally posted by: daniechristie.yahoo.fr
Hello,
I have an action that calls a wizard and have add one wizardPage to this
Wizard. But my action shows an empty wizard without components of the
wizardPage.
I would like to have only one WizardPage in the wizard with component like
label and text.
Thanks.
Dan
|
|
|
|
Re: Wizard and WizardPage [message #463707 is a reply to message #463705] |
Sun, 13 November 2005 10:47 |
Eclipse User |
|
|
|
Originally posted by: daniechristie.yahoo.fr
Hi ,
I think that I already doing all what you explaint in your answer.
I send my code and you can look what happen.
Thanks.
//run method of the class that calls myWizard.
public void run() {
myWizard wizard =new myWizard();
wizard.init( PlatformUI.getWorkbench(), null);
wizard.setWindowTitle(" New Wizard ");
WizardDialog dlg=new WizardDialog(window.getShell(),wizard);
dlg.create();
dlg.open();
}
/**************
//myWizard class
public class myWizard extends Wizard {
IWorkbench workbench;
IStructuredSelection selection;
myWizardPage mainPage;
public myWizard() {
super();
mainPage = new myWizardPage("My Wizard ");
}
public boolean performFinish() {
// TODO Auto-generated method stub
return true;
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
// TODO Auto-generated method stub
this.workbench = workbench;
this.selection = selection;
}
public void addPages() {
addPage(mainPage);
}
}
/***************
//myWizardPage class
public class myWizardPage extends WizardPage implements Listener,
IStructuredSelection{
Button sectionCheckbox;
Button subsectionCheckbox;
Button openFileCheckbox;
public static final String ID = "wizardPage.view";
public myWizardPage(String pageName) {
super(pageName);
// TODO Auto-generated constructor stub
}
public void createControl(Composite parent) {
// inherit default container and name specification widgets
Composite composite = new Composite(parent,SWT.NONE);
new Label(composite,SWT.WRAP ).setText("device name:");
Text nametext= new Text(composite,SWT.NONE);
nametext.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL |
GridData.HORIZONTAL_ALIGN_FILL));
//...
setControl(composite);
}
|
|
|
|
Re: Wizard and WizardPage [message #463710 is a reply to message #463708] |
Sun, 13 November 2005 12:40 |
Eclipse User |
|
|
|
Originally posted by: daniechristie.yahoo.fr
Thanks for the information.
"Stefan Langer" <eclipse@bettsockentraeger.de> schrieb im Newsbeitrag
news:dl78d5$g8b$1@news.eclipse.org...
> Try setting a GridLayout on your created Composite in myWizardPage class.
>
> Regards
> Stefan
>
>
> Christelle M. wrote:
>> Hi ,
>> I think that I already doing all what you explaint in your answer.
>> I send my code and you can look what happen.
>> Thanks.
>>
>>
>> //run method of the class that calls myWizard.
>> public void run() {
>> myWizard wizard =new myWizard();
>> wizard.init( PlatformUI.getWorkbench(), null);
>> wizard.setWindowTitle(" New Wizard ");
>>
>> WizardDialog dlg=new WizardDialog(window.getShell(),wizard);
>> dlg.create();
>> dlg.open();
>> }
>> /**************
>> //myWizard class
>> public class myWizard extends Wizard {
>> IWorkbench workbench;
>> IStructuredSelection selection;
>> myWizardPage mainPage;
>>
>>
>>
>> public myWizard() {
>> super();
>> mainPage = new myWizardPage("My Wizard ");
>>
>> }
>>
>> public boolean performFinish() {
>> // TODO Auto-generated method stub
>> return true;
>> }
>>
>> public void init(IWorkbench workbench, IStructuredSelection selection) {
>> // TODO Auto-generated method stub
>> this.workbench = workbench;
>> this.selection = selection;
>>
>> }
>>
>> public void addPages() {
>> addPage(mainPage);
>>
>> }
>>
>> }
>>
>> /***************
>> //myWizardPage class
>>
>> public class myWizardPage extends WizardPage implements Listener,
>> IStructuredSelection{
>> Button sectionCheckbox;
>> Button subsectionCheckbox;
>> Button openFileCheckbox;
>> public static final String ID = "wizardPage.view";
>> public myWizardPage(String pageName) {
>> super(pageName);
>> // TODO Auto-generated constructor stub
>> }
>>
>> public void createControl(Composite parent) {
>>
>> // inherit default container and name specification widgets
>> Composite composite = new Composite(parent,SWT.NONE);
>> new Label(composite,SWT.WRAP ).setText("device name:");
>>
>> Text nametext= new Text(composite,SWT.NONE);
>> nametext.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL |
>> GridData.HORIZONTAL_ALIGN_FILL));
>>
>> //...
>> setControl(composite);
>>
>>
>> }
|
|
|
Powered by
FUDForum. Page generated in 0.02994 seconds