Dialogs

Contents

Overview

When XMF is executing as an Eclipse plugin you can use a variety of operations defined on the xmf object in order to display dialogs. The operations and examples of their use are shown in this document.

To top.

Choice

The choice dialog allows you to select a collection of elements from a supplied sequence:
xmf.choose("Class","Choose some classes",Root.allContentsOf(Class)->asSeq->sortNamedElements);
produces the following dialog:

Choice Dialog

Selecting cancel returns null.

To top.

String Input

The string dialog allows you to capture string input:
xmf.getString("Name","Type your name","Fred Smith");
Get String Dialog

Selecting cancel produces null.

To top.

Displaying Information

General information is displayed as follows:
xmf.info("Did you know?","Mammals are the only animals with flaps around the ears.");
Information Dialog

Multi-line information can be shown as follows:
xmf.textArea("info","Class Documentation",Class.documentation.doc);
Multiline Info

To top.

Files

Navigate to a file:
xmf.openFile("c:/tmp/test","*.java","");
Open File

The path to the selected file is returned. The empty string is returned if cancel is selected.

To top.

Asking Questions

You can ask a question as follows:
xmf.question("Are mammals the only animals with flaps around the ears?");
Question Dialog

The result is either true or false.

To top.

Reporting Errors and Warnings

xmf.warning("Stop!","You have exceeded your authority!");
Warning

To top.

HTML Browser

Although not strictly a dialog, you can create abrowser for HTML via XMF using xmf.browser(title,html) when running as an Eclipse plugin. This feature can be useful in order to generate reports.

To top.