public class HttpFormEntry
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
TYPE_AREA
Multi-line input field type
|
static int |
TYPE_FILE
Just a label in the gui
|
static int |
TYPE_HIDDEN
Hidden input field type
|
static int |
TYPE_INPUT
Normal input field type
|
static int |
TYPE_LABEL
Just a label in the gui
|
| Constructor and Description |
|---|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label)
Create the entry
|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
int rows,
int cols)
Create the entry
|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value)
Create the entry
|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
boolean required)
Create the entry
|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
int rows,
int cols)
Create the entry
|
HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
int rows,
int cols,
boolean required)
Create the entry
|
HttpFormEntry(java.lang.String name,
java.lang.String label)
Create the entry
|
HttpFormEntry(java.lang.String name,
java.lang.String fileName,
byte[] bytes)
Create an entry that already holds the byte contents of a file.
|
HttpFormEntry(java.lang.String name,
java.lang.String label,
java.lang.String value) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToGui(java.util.List guiComps)
Add the label/gui component into the list of components
|
void |
browse(javax.swing.JTextField fld)
Open a file browser associated with the text field
|
static boolean |
checkEntries(java.util.List<HttpFormEntry> entries)
Check the entries to make sure they have been filled in
|
static java.lang.String[] |
doPost(java.util.List<HttpFormEntry> entries,
java.lang.String urlPath)
Post the given entries tot he given url
|
byte[] |
getBytes()
Get the bytes
|
java.lang.String |
getLabel()
Get the label
|
java.lang.String |
getName()
Get the name
|
java.lang.String |
getValue()
Get the value the user entered.
|
static HttpFormEntry |
hidden(java.lang.String name,
java.lang.String value) |
static javax.swing.JComponent |
makeUI(java.util.List<HttpFormEntry> entries)
Create the GUI from the list of entries
|
boolean |
ok()
Is this entry ok.
|
boolean |
okToPost()
Post the file
|
void |
setValue(java.lang.String newValue)
Set the text value to the given newValue
|
static boolean |
showUI(java.util.List<HttpFormEntry> entries,
javax.swing.JComponent extraTop,
javax.swing.JComponent extraBottom,
javax.swing.JDialog dialog,
boolean shouldDoBusyWait)
Show the UI in a modeful dialog.
|
static boolean |
showUI(java.util.List<HttpFormEntry> entries,
java.lang.String title,
java.awt.Window window,
javax.swing.JComponent extraTop)
Show the UI in a modeful dialog.
|
static boolean |
showUI(java.util.List<HttpFormEntry> entries,
java.lang.String title,
java.awt.Window parent,
javax.swing.JComponent extraTop,
javax.swing.JComponent extraBottom)
Show the UI in a modeful dialog.
|
public static final int TYPE_HIDDEN
public static final int TYPE_INPUT
public static final int TYPE_AREA
public static final int TYPE_LABEL
public static final int TYPE_FILE
public HttpFormEntry(java.lang.String name,
java.lang.String fileName,
byte[] bytes)
name - The name of the filefileName - filename - this is the name that is postedbytes - the bytespublic HttpFormEntry(java.lang.String name,
java.lang.String label,
java.lang.String value)
public HttpFormEntry(java.lang.String name,
java.lang.String label)
name - The namelabel - The labelpublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label)
type - The type of this entryname - The namelabel - The labelpublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value)
type - The type of this entryname - The namelabel - The labelvalue - Initial valuepublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
boolean required)
type - The type of this entryname - The namelabel - The labelvalue - Initial valuerequired - Is this entry requiredpublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
int rows,
int cols)
type - The type of this entryname - The namelabel - The labelrows - How may rows in the text areacols - How many columns in the text areapublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
int rows,
int cols)
type - The type of this entryname - The namelabel - The labelvalue - Initial valuerows - How many rowscols - How many colspublic HttpFormEntry(int type,
java.lang.String name,
java.lang.String label,
java.lang.String value,
int rows,
int cols,
boolean required)
type - The type of this entryname - The namelabel - The labelvalue - Initial valuerows - How many rowscols - How many colsrequired - Is this entry requiredpublic static HttpFormEntry hidden(java.lang.String name, java.lang.String value)
public boolean ok()
public void addToGui(java.util.List guiComps)
guiComps - A list.public void browse(javax.swing.JTextField fld)
fld - the JTextFieldpublic java.lang.String getValue()
public void setValue(java.lang.String newValue)
newValue - The new textpublic java.lang.String getName()
public java.lang.String getLabel()
public byte[] getBytes()
public static javax.swing.JComponent makeUI(java.util.List<HttpFormEntry> entries)
entries - List of entriespublic static boolean checkEntries(java.util.List<HttpFormEntry> entries)
entries - list of entriespublic static boolean showUI(java.util.List<HttpFormEntry> entries, java.lang.String title, java.awt.Window window, javax.swing.JComponent extraTop)
entries - List of entriestitle - The dialog titlewindow - The parent windowextraTop - If non-null then this is added to the top of the gui. It allows
you to provide a label, etc.public static boolean showUI(java.util.List<HttpFormEntry> entries, java.lang.String title, java.awt.Window parent, javax.swing.JComponent extraTop, javax.swing.JComponent extraBottom)
entries - List of entriestitle - The dialog titleparent - The parent windowextraTop - If non-null then this is added to the top of the gui. It allows
you to provide a label, etc.extraBottom - Like extraTop but on the bottom of the windowpublic static boolean showUI(java.util.List<HttpFormEntry> entries, javax.swing.JComponent extraTop, javax.swing.JComponent extraBottom, javax.swing.JDialog dialog, boolean shouldDoBusyWait)
entries - List of entriesextraTop - If non-null then this is added to the top of the gui.
It allows you to provide a label, etc.extraBottom - Like extraTop but on the bottom of the windowdialog - the dialogshouldDoBusyWait - true to waitpublic boolean okToPost()
public static java.lang.String[] doPost(java.util.List<HttpFormEntry> entries, java.lang.String urlPath)
entries - The entriesurlPath - The url to post to