2 * $Id: FormElementWizardPage.java,v 1.1 2004-10-05 20:51:57 jsurfer 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.*;
14 public class FormElementWizardPage extends EditElementWizardPage {
17 Button postRadio, getRadio, multipartCheck;
20 public FormElementWizardPage() {
21 super("FormElementWizardPage");
24 protected void createChildControl(Composite parent) throws CoreException {
25 postRadio = new Button(parent, SWT.RADIO);
29 public String getPreviewText() {
30 boolean controlCreated = actionText != null;
32 StringBuffer buff = new StringBuffer("<form action=\"");
34 buff.append(actionText.getText());
36 buff.append("\" method=\"");
37 if( controlCreated && postRadio.getSelection() ){
38 buff.append("POST\"");
39 if(multipartCheck.getSelection()){
40 buff.append(" enctype=\"multipart/form-data\"");
48 String charset = charsetCombo.getText();
50 buff.append(" accept-charset=\"" + charset + "\"");
55 buff.append( getSelectionText() );
56 buff.append("\n</form>\n");
58 return buff.toString();