/*
- * $Id: NewElementWizardPage.java,v 1.2 2005-05-06 00:57:33 stefanbjarni Exp $
+ * $Id: NewElementWizardPage.java,v 1.3 2006-10-21 23:18:43 pombredanne Exp $
* Copyright Narushima Hironori. All rights reserved.
*/
package net.sourceforge.phpeclipse.wizards.html;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
/**
*
*/
public class NewElementWizardPage extends EditElementWizardPage {
Text elementName;
+
EditElementWizardPage nextPage = null;
public NewElementWizardPage() {
setTitle("Create HTML Element");
setDescription("Specify new HTML tag (dl,ul,ol or table) and configure that tag.");
}
-
+
protected void createChildControl(Composite base) {
// create foundation component
base.setLayout(new GridLayout(1, false));
-
+
// element input components
new Label(base, SWT.NONE).setText("&Element Name:");
-
+
elementName = new Text(base, SWT.BORDER | SWT.SINGLE);
- elementName.setLayoutData( new GridData(GridData.FILL_HORIZONTAL));
- elementName.addModifyListener( new ModifyListener() {
+ elementName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ elementName.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String eName = elementName.getText();
- if( eName.indexOf(' ') != -1 ){
+ if (eName.indexOf(' ') != -1) {
setErrorMessage("Don't contain blink in speicfied element name.");
- } else if (eName.length() == 0){
+ } else if (eName.length() == 0) {
setErrorMessage("Need to specify element name.");
} else {
setErrorMessage(null);
- nextPage = ((EditElementWizard)getWizard()).createElementEditPage(eName);
+ nextPage = ((EditElementWizard) getWizard())
+ .createElementEditPage(eName);
nextPage.setElementName(eName);
- if( nextPage instanceof UnknownElementWizardPage){
- setMessage("This editor does not known element name.", WARNING);
- }else{
+ if (nextPage instanceof UnknownElementWizardPage) {
+ setMessage("This editor does not known element name.",
+ WARNING);
+ } else {
setMessage(null, NONE);
}
}
}
});
}
-
- public String getPreviewText(){
- if(nextPage instanceof EditElementWizardPage){
- return ((EditElementWizardPage)nextPage).getPreviewText();
+
+ public String getPreviewText() {
+ if (nextPage instanceof EditElementWizardPage) {
+ return ((EditElementWizardPage) nextPage).getPreviewText();
}
return null;
}
-
+
public void setErrorMessage(String newMessage) {
super.setErrorMessage(newMessage);
- if( newMessage != null){
+ if (newMessage != null) {
nextPage = null;
}
}