Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Wizard and WizardPage
Wizard and WizardPage [message #463690] Fri, 11 November 2005 19:29 Go to next message
Eclipse UserFriend
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 #463705 is a reply to message #463690] Sun, 13 November 2005 08:51 Go to previous messageGo to next message
Neeraj is currently offline NeerajFriend
Messages: 18
Registered: July 2009
Junior Member
Check if your class extends "Wizard" and the page to be displayed in the
wizard should extend "WizardPage".
Then in the constructor of your class that extends Wizard should create an
instance of the class that extends Wizard Page. Then it should call
"addpage" function.
Then in the createControl of Wizard page, try this
Composite container = new Composite(parent, SWT.NULL);
then set the layout and add the components
then call setControl(container);
If you still don't see anything write back.
Re: Wizard and WizardPage [message #463707 is a reply to message #463705] Sun, 13 November 2005 10:47 Go to previous messageGo to next message
Eclipse UserFriend
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 #463708 is a reply to message #463707] Sun, 13 November 2005 11:36 Go to previous messageGo to next message
Stefan Langer is currently offline Stefan LangerFriend
Messages: 236
Registered: July 2009
Senior Member
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);
>
>
> }
>
>
Re: Wizard and WizardPage [message #463710 is a reply to message #463708] Sun, 13 November 2005 12:40 Go to previous message
Eclipse UserFriend
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);
>>
>>
>> }
Previous Topic:data input verifying
Next Topic:SWT advanced graphics with Cairo
Goto Forum:
  


Current Time: Tue Apr 23 15:58:46 GMT 2024

Powered by FUDForum. Page generated in 0.02994 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top