+ /**
+ * Convenience function to add a checkbox to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param label label to display next to (right of) the checkbox
+ * @param checked initial check state
+ * @return the new checkbox
+ */
+ public final TCheckbox addCheckbox(final int x, final int y,
+ final String label, final boolean checked) {
+
+ return new TCheckbox(this, x, y, label, checked);
+ }
+
+ /**
+ * Convenience function to add a progress bar to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of progress bar
+ * @param value initial value of percent complete
+ * @return the new progress bar
+ */
+ public final TProgressBar addProgressBar(final int x, final int y,
+ final int width, final int value) {
+
+ return new TProgressBar(this, x, y, width, value);
+ }
+
+ /**
+ * Convenience function to add a radio button group to this
+ * container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param label label to display on the group box
+ * @return the new radio button group
+ */
+ public final TRadioGroup addRadioGroup(final int x, final int y,
+ final String label) {
+
+ return new TRadioGroup(this, x, y, label);
+ }
+
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed) {
+
+ return new TField(this, x, y, width, fixed);
+ }
+
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed, final String text) {
+
+ return new TField(this, x, y, width, fixed, text);
+ }
+
+ /**
+ * Convenience function to add a text field to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @param enterAction function to call when enter key is pressed
+ * @param updateAction function to call when the text is updated
+ * @return the new text field
+ */
+ public final TField addField(final int x, final int y,
+ final int width, final boolean fixed, final String text,
+ final TAction enterAction, final TAction updateAction) {
+
+ return new TField(this, x, y, width, fixed, text, enterAction,
+ updateAction);
+ }
+
+ /**
+ * Convenience function to add a scrollable text box to this
+ * container/window.
+ *
+ * @param text text on the screen
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @param colorKey ColorTheme key color to use for foreground text
+ * @return the new text box
+ */
+ public final TText addText(final String text, final int x,
+ final int y, final int width, final int height, final String colorKey) {
+
+ return new TText(this, text, x, y, width, height, colorKey);
+ }
+
+ /**
+ * Convenience function to add a scrollable text box to this
+ * container/window.
+ *
+ * @param text text on the screen
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @return the new text box
+ */
+ public final TText addText(final String text, final int x, final int y,
+ final int width, final int height) {
+
+ return new TText(this, text, x, y, width, height, "ttext");
+ }
+
+ /**
+ * Convenience function to add an editable text area box to this
+ * container/window.
+ *
+ * @param text text on the screen
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @return the new text box
+ */
+ public final TEditorWidget addEditor(final String text, final int x,
+ final int y, final int width, final int height) {
+
+ return new TEditorWidget(this, text, x, y, width, height);
+ }
+
+ /**
+ * Convenience function to spawn a message box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @return the new message box
+ */
+ public final TMessageBox messageBox(final String title,
+ final String caption) {
+
+ return getApplication().messageBox(title, caption, TMessageBox.Type.OK);
+ }
+
+ /**
+ * Convenience function to spawn a message box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @param type one of the TMessageBox.Type constants. Default is
+ * Type.OK.
+ * @return the new message box
+ */
+ public final TMessageBox messageBox(final String title,
+ final String caption, final TMessageBox.Type type) {
+
+ return getApplication().messageBox(title, caption, type);
+ }
+
+ /**
+ * Convenience function to spawn an input box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @return the new input box
+ */
+ public final TInputBox inputBox(final String title, final String caption) {
+
+ return getApplication().inputBox(title, caption);
+ }
+
+ /**
+ * Convenience function to spawn an input box.
+ *
+ * @param title window title, will be centered along the top border
+ * @param caption message to display. Use embedded newlines to get a
+ * multi-line box.
+ * @param text initial text to seed the field with
+ * @return the new input box
+ */
+ public final TInputBox inputBox(final String title, final String caption,
+ final String text) {
+
+ return getApplication().inputBox(title, caption, text);
+ }
+
+ /**
+ * Convenience function to add a password text field to this
+ * container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @return the new text field
+ */
+ public final TPasswordField addPasswordField(final int x, final int y,
+ final int width, final boolean fixed) {
+
+ return new TPasswordField(this, x, y, width, fixed);
+ }
+
+ /**
+ * Convenience function to add a password text field to this
+ * container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @return the new text field
+ */
+ public final TPasswordField addPasswordField(final int x, final int y,
+ final int width, final boolean fixed, final String text) {
+
+ return new TPasswordField(this, x, y, width, fixed, text);
+ }
+
+ /**
+ * Convenience function to add a password text field to this
+ * container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width visible text width
+ * @param fixed if true, the text cannot exceed the display width
+ * @param text initial text, default is empty string
+ * @param enterAction function to call when enter key is pressed
+ * @param updateAction function to call when the text is updated
+ * @return the new text field
+ */
+ public final TPasswordField addPasswordField(final int x, final int y,
+ final int width, final boolean fixed, final String text,
+ final TAction enterAction, final TAction updateAction) {
+
+ return new TPasswordField(this, x, y, width, fixed, text, enterAction,
+ updateAction);
+ }
+
+ /**
+ * Convenience function to add a tree view to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of tree view
+ * @param height height of tree view
+ * @return the new tree view
+ */
+ public final TTreeView addTreeView(final int x, final int y,
+ final int width, final int height) {
+
+ return new TTreeView(this, x, y, width, height);
+ }
+
+ /**
+ * Convenience function to add a tree view to this container/window.
+ *
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of tree view
+ * @param height height of tree view
+ * @param action action to perform when an item is selected
+ * @return the new tree view
+ */
+ public final TTreeView addTreeView(final int x, final int y,
+ final int width, final int height, final TAction action) {
+
+ return new TTreeView(this, x, y, width, height, action);
+ }
+
+ /**
+ * Convenience function to spawn a file open box.
+ *
+ * @param path path of selected file
+ * @return the result of the new file open box
+ * @throws IOException if a java.io operation throws
+ */
+ public final String fileOpenBox(final String path) throws IOException {
+ return getApplication().fileOpenBox(path);
+ }
+
+ /**
+ * Convenience function to spawn a file open box.
+ *
+ * @param path path of selected file
+ * @param type one of the Type constants
+ * @return the result of the new file open box
+ * @throws IOException if a java.io operation throws
+ */
+ public final String fileOpenBox(final String path,
+ final TFileOpenBox.Type type) throws IOException {
+
+ return getApplication().fileOpenBox(path, type);
+ }
+ /**
+ * Convenience function to add a directory list to this container/window.
+ *
+ * @param path directory path, must be a directory
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @return the new directory list
+ */
+ public final TDirectoryList addDirectoryList(final String path, final int x,
+ final int y, final int width, final int height) {
+
+ return new TDirectoryList(this, path, x, y, width, height, null);
+ }
+
+ /**
+ * Convenience function to add a directory list to this container/window.
+ *
+ * @param path directory path, must be a directory
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @param action action to perform when an item is selected
+ * @return the new directory list
+ */
+ public final TDirectoryList addDirectoryList(final String path, final int x,
+ final int y, final int width, final int height, final TAction action) {
+
+ return new TDirectoryList(this, path, x, y, width, height, action);
+ }
+
+ /**
+ * Convenience function to add a directory list to this container/window.
+ *
+ * @param strings list of strings to show
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @return the new directory list
+ */
+ public final TList addList(final List<String> strings, final int x,
+ final int y, final int width, final int height) {
+
+ return new TList(this, strings, x, y, width, height, null);
+ }
+
+ /**
+ * Convenience function to add a directory list to this container/window.
+ *
+ * @param strings list of strings to show
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @param enterAction action to perform when an item is selected
+ * @return the new directory list
+ */
+ public final TList addList(final List<String> strings, final int x,
+ final int y, final int width, final int height,
+ final TAction enterAction) {
+
+ return new TList(this, strings, x, y, width, height, enterAction);
+ }
+
+ /**
+ * Convenience function to add a directory list to this container/window.
+ *
+ * @param strings list of strings to show
+ * @param x column relative to parent
+ * @param y row relative to parent
+ * @param width width of text area
+ * @param height height of text area
+ * @param enterAction action to perform when an item is selected
+ * @param moveAction action to perform when the user navigates to a new
+ * item with arrow/page keys
+ * @return the new directory list
+ */
+ public final TList addList(final List<String> strings, final int x,
+ final int y, final int width, final int height,
+ final TAction enterAction, final TAction moveAction) {
+
+ return new TList(this, strings, x, y, width, height, enterAction,
+ moveAction);
+ }