Wizards and disappearing controls pt 2 [message #194505] |
Thu, 15 February 2007 17:18 |
Eclipse User |
|
|
|
Originally posted by: jamarijr.gmail.com
Ok, I have tried many different things, but when I add this certain page
that I build to my wizard pages all the other pages lose their controls
(screen blank only description available).
Basically here is the code:
package whynot.wizards;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;
//import com.ibm.jpos.utils.WizComposite;
/**
* @author Bobby Hargett
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Generation - Code and Comments
*/
public class DevSelPage extends WizardPage
{
ISelection selection;
//WizComposite wiz = null;
/**
* Constructor for SampleNewWizardPage.
*
* @param pageName
*/
public DevSelPage( ISelection selection )
{
super("wizardPage2");
setTitle("Add Devices manually");
setDescription("The devices selected here will have template code
generated for your application.");
this.selection = selection;
}
/*
* (non-Javadoc)
*
* @see
org.eclipse.jface.dialogs.IDialogPage#createControl(org.ecli pse.swt.widgets.Composite)
*/
public void createControl(Composite parent)
{
createSShell(parent);
}
public void setStartDevices( String[] devs )
{
//wiz.setInitDevices( devs );
}
/**
* This method initializes sShell
*/
private void createSShell(Composite parent)
{
Composite devicePanel = new Composite(parent, SWT.NULL);
GridLayout gl = new GridLayout(1,true);
gl.makeColumnsEqualWidth = false;
devicePanel.setLayout( gl );
GridData gld = new GridData(GridData.FILL, GridData.FILL, true,
true);
devicePanel.setLayoutData(gld);
//wiz = new WizComposite(devicePanel,SWT.NULL);
setControl(parent);
}
}
Help?
|
|
|
Re: Wizards and disappearing controls pt 2 [message #194511 is a reply to message #194505] |
Thu, 15 February 2007 17:45 |
Eclipse User |
|
|
|
Originally posted by: dmsubs.NOSPAM.consertum.com
I think it is your setControl(parent) that is the problem. It should be
setControl(devicePanel). I fell for that one too!
--
Derek
Arinté wrote:
> Ok, I have tried many different things, but when I add this certain page
> that I build to my wizard pages all the other pages lose their controls
> (screen blank only description available).
>
> Basically here is the code:
> package whynot.wizards;
>
> import org.eclipse.jface.viewers.ISelection;
> import org.eclipse.jface.wizard.WizardPage;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.layout.*;
> import org.eclipse.swt.widgets.*;
> //import com.ibm.jpos.utils.WizComposite;
>
> /**
> * @author Bobby Hargett
> *
> * TODO To change the template for this generated type comment go to
> * Window - Preferences - Java - Code Generation - Code and Comments
> */
> public class DevSelPage extends WizardPage
> {
> ISelection selection;
> //WizComposite wiz = null;
>
> /**
> * Constructor for SampleNewWizardPage.
> *
> * @param pageName
> */
> public DevSelPage( ISelection selection )
> {
> super("wizardPage2");
> setTitle("Add Devices manually");
> setDescription("The devices selected here will have template code
> generated for your application.");
> this.selection = selection;
> }
>
> /*
> * (non-Javadoc)
> *
> * @see
> org.eclipse.jface.dialogs.IDialogPage#createControl(org.ecli pse.swt.widgets.Composite)
> */
> public void createControl(Composite parent)
> {
> createSShell(parent);
> }
>
> public void setStartDevices( String[] devs )
> {
> //wiz.setInitDevices( devs );
> }
>
> /**
> * This method initializes sShell
> */
> private void createSShell(Composite parent)
> {
> Composite devicePanel = new Composite(parent, SWT.NULL);
> GridLayout gl = new GridLayout(1,true);
> gl.makeColumnsEqualWidth = false;
> devicePanel.setLayout( gl );
> GridData gld = new GridData(GridData.FILL, GridData.FILL, true,
> true);
> devicePanel.setLayoutData(gld);
>
> //wiz = new WizComposite(devicePanel,SWT.NULL);
> setControl(parent);
> }
> }
>
> Help?
>
>
|
|
|
|
Re: Wizards and disappearing controls pt 2 [message #194519 is a reply to message #194517] |
Thu, 15 February 2007 17:52 |
Eclipse User |
|
|
|
Originally posted by: jamarijr.gmail.com
"zakir" <zakir.hussain@in.bosch.com> wrote in message
news:165aba3be16ca1f9ce22208f005c6893$1@www.eclipse.org...
> Hi,
>
> Inside the createControl... method of the wizard page...
>
> You need to create a new composite... xyz
>
> and then you need to pass the newly created composite xyz to your
> createShell method..
>
> and finally at the end of createControl method
> add a line setControl(composite xyz);
>
> --------------------------------------------------------
>
> The main reason for your problem is .. ... you should not
>
> add the setControl() to the composite which is coming from
> createControl() method
I know you feel like you are repeating yourself. But I thought I looked at
that part "Devils in the detail".
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.07980 seconds