I'm currently running in trouble. I've got a WizardPage with several Controls on the Page (Text, Combo, Radio).
But when I use the "expost control" from the context menu I receive always the same name of the first control I've got on the page. In the example below it's the getNewOwner(). If I try to expose another control
I'll receive an dialog with the error-message that the method getNewOwner exists (what's really true). But if I even change the method name I'll receive a method wich returns the control of the first control on the site (here: newOwner).
I'm using:
SWT-Designer:
Version: 4.2.0
Build id: 2005.11.04
and Eclipse 3.1.1:
Version: 3.1.1
Build id: M20050929-0840
Example-Code:
- Code: Select all
package de.isi.client.objekte.wizards.pages;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
public abstract class AbstractOwnerPage extends WizardPage {
private Button newOwner;
private Button chooseOwner;
private Text ownerCity;
private Text ownerZip;
private Text ownerAddress2;
private Text ownerAddress1;
private Text ownerName;
private Combo existingOwner;
private boolean controlsInitialized = false;
/**
* Create the wizard
*/
public AbstractOwnerPage() {
super("wizardPage");
setTitle("Wizard Page title");
setDescription("Wizard Page description");
}
/**
* Create contents of the wizard
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
final GridLayout gridLayout = new GridLayout();
gridLayout.numColumns = 3;
container.setLayout(gridLayout);
//
setControl(container);
chooseOwner = new Button(container, SWT.RADIO);
chooseOwner.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
chooseOwner.setText("Bestehenden Eigentümer auswählen:");
existingOwner = new Combo(container, SWT.NONE);
existingOwner.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 3, 1));
newOwner = new Button(container, SWT.RADIO);
newOwner.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, false, false, 3, 1));
newOwner.setText("Neuen Eigentümer anlegen:");
final Label nameLabel = new Label(container, SWT.NONE);
nameLabel.setText("Name:");
ownerName = new Text(container, SWT.BORDER);
ownerName.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
final Label adresseLabel = new Label(container, SWT.NONE);
adresseLabel.setText("Adresse");
ownerAddress1 = new Text(container, SWT.BORDER);
ownerAddress1.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
new Label(container, SWT.NONE);
ownerAddress2 = new Text(container, SWT.BORDER);
ownerAddress2.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1));
final Label plzortLabel = new Label(container, SWT.NONE);
plzortLabel.setLayoutData(new GridData(57, SWT.DEFAULT));
plzortLabel.setText("PLZ/Ort:");
ownerZip = new Text(container, SWT.BORDER);
final GridData gridData = new GridData(65, SWT.DEFAULT);
ownerZip.setLayoutData(gridData);
ownerCity = new Text(container, SWT.BORDER);
ownerCity.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true, false));
controlsInitialized = true;
}
protected abstract void initializeContents();
public boolean isControlsInitialized() {
return controlsInitialized;
}
public void setControlsInitialized(boolean controlsInitialized) {
this.controlsInitialized = controlsInitialized;
}
protected Button getNewOwner() {
return newOwner;
}
}