2 * $Id: FormElementWizardPage.java,v 1.2 2005-05-06 00:57:33 stefanbjarni Exp $
3 * Copyright Narushima Hironori. All rights reserved.
5 package net.sourceforge.phpeclipse.wizards.html;
7 import org.eclipse.core.runtime.CoreException;
8 import org.eclipse.swt.SWT;
9 import org.eclipse.swt.widgets.Button;
10 import org.eclipse.swt.widgets.Combo;
11 import org.eclipse.swt.widgets.Composite;
12 import org.eclipse.swt.widgets.Text;
17 public class FormElementWizardPage extends EditElementWizardPage {
20 Button postRadio, getRadio, multipartCheck;
23 public FormElementWizardPage() {
24 super("FormElementWizardPage");
27 protected void createChildControl(Composite parent) throws CoreException {
28 postRadio = new Button(parent, SWT.RADIO);
32 public String getPreviewText() {
33 boolean controlCreated = actionText != null;
35 StringBuffer buff = new StringBuffer("<form action=\"");
37 buff.append(actionText.getText());
39 buff.append("\" method=\"");
40 if( controlCreated && postRadio.getSelection() ){
41 buff.append("POST\"");
42 if(multipartCheck.getSelection()){
43 buff.append(" enctype=\"multipart/form-data\"");
51 String charset = charsetCombo.getText();
53 buff.append(" accept-charset=\"" + charset + "\"");
58 buff.append( getSelectionText() );
59 buff.append("\n</form>\n");
61 return buff.toString();