[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Wizards

hello NG!

i tried to write a wizard, which executes another program etc...

my problem is that all code below execution of external code (static class which executes an cmd with parameters) is not executed.
note: the static class is working fine in all of my other programs...


(sorry for the poor description, i will give an example to show what i mean)

my default createControl of a wizardpage looks like this:

[code]
package networkwizardvista.wizards;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

public class ForYourInformationPage extends WizardPage {

	
	private Text dieserWizarText;
	/**
	 * Create the wizard
	 */
	public ForYourInformationPage() {
		super("wizardPage");
		setTitle("titel");
		setDescription("beschreibung");
	}

/**
* Create contents of the wizard
* @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
setControl(container);
dieserWizarText = new Text(container, SWT.WRAP | SWT.READ_ONLY | SWT.MULTI);
dieserWizarText.setText("text hier");
dieserWizarText.setEditable(false);
dieserWizarText.setBounds(10, 10, 454, 143);
}


}
[/code]
this was my first page as sample,
the next one is change a bit:

[code]
package networkwizardvista.wizards;

import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

import tt.at.lumo.net.IPAddress; // <-- gets informations about your network

public class FirstStepPage extends WizardPage {

	private Text text;

	public final Text getText() {
		return text;
	}

	/**
	 * Create the wizard
	 */
	public FirstStepPage() {
		super("wizardPage");
		setTitle("titel2");
		setDescription("Schritt 1");
	}

/**
* Create contents of the wizard
* * @param parent
*/
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.NULL);
//
text = new Text(container, SWT.BORDER);
text.setBounds(10, 85, 454, 68);


		final Button button = new Button(container, SWT.NONE);
		button.addSelectionListener(new SelectionAdapter() {
			public void widgetSelected(final SelectionEvent e) {
				System.err.println("blubb");
				text.setText(testConnection());
				// external functions not workin'!??!
				// testConnection();

			}
		});
		// testConnection();
		button.setText("button");
		button.setBounds(79, 39, 48, 25);
		setControl(container);
	}

	private String testConnection() {
		String newText = "Ping at http://10.0.0.100 returned: ";
		newText += IPAddress.getPing("http://10.0.0.100";);
		return newText;
	}
}
[/code]

what this code is supposed to do:
it should print blubb when you klick the button, then execute an ping to 10.0.0.100 and write the result into the text field.


what will be executed is, that it prints blubb to the sys err, ping will not be executed and code below the sys err line is not reached!
what can i do to fix this (beside writing my own wizard)


thanks in advance
lumo
PS: if you need more code to help me solving this, shout out!