Dialogs
Contents
- Overview
- Choice
- String Input
- Displaying Information
- Files
- Asking Questions
- Reporting Errors and Warnings
- HTML Browser
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);

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");

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.");

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

To top.
Files
Navigate to a file:xmf.openFile("c:/tmp/test","*.java","");

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?");

The result is either true or false.
To top.
Reporting Errors and Warnings
xmf.warning("Stop!","You have exceeded your authority!");

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.