blob: e75f6c1a90a1294d46b684b094053f4a43457f92 [file] [log] [blame]
package org.eclipse.jst.servlet.ui.internal.wizard;
import org.eclipse.jst.j2ee.internal.wizard.StringArrayTableWizardSection.StringArrayDialogCallback;
import org.eclipse.swt.widgets.Text;
/**
* Implementation of the <code>StringArrayDialogCallback</code> interface for
* both "Initialization Parameters" and "URL Mappings" table views.
*/
public class StringArrayTableWizardSectionCallback implements
StringArrayDialogCallback {
/**
* The first text field should not be empty.
*/
public boolean validate(Text[] texts) {
if (texts.length > 0) {
return texts[0].getText().trim().length() > 0;
}
return true;
}
/**
* Trims the text values.
*/
public String[] retrieveResultStrings(Text[] texts) {
int n = texts.length;
String[] result = new String[n];
for (int i = 0; i < n; i++) {
result[i] = texts[i].getText().trim();
}
return result;
}
}