package nongnu.cashews.eclipse.composer.wizards; import nongnu.cashews.eclipse.composer.model.Node; 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.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Text; class NamePerformancePage extends WizardPage { Text perfomanceName; public NamePerformancePage() { super("Name Performance"); setTitle("Please give a name"); setDescription("Please name the performance"); setPageComplete(false); } /* * (non-Javadoc) * * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite) */ public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NULL); GridLayout gridLayout = new GridLayout(2, false); composite.setLayout(gridLayout); new Label (composite, SWT.LEFT).setText("Please Name the Performance"); perfomanceName = new Text(composite, SWT.SINGLE | SWT.BORDER); perfomanceName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); perfomanceName.setSize(500, 20); perfomanceName.addListener(SWT.Modify, new Listener() { public void handleEvent(Event event) { String text = perfomanceName.getText().trim(); ((ProcessWizard)getWizard()).data.performanceName = text; String a = perfomanceName.getText(); System.out.println("Node name" + a); if (perfomanceName.getText()!=null){ setPageComplete(true); } else{setPageComplete(false);} } }); setControl(composite); } }