ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Martin <jmar...@silacom.com>
Subject RE: Prompt task
Date Thu, 30 Nov 2000 16:27:16 GMT
I've already written a Prompt taks which I've been using for a while. It
allows you to use both command line and swing prompts. It's probably not the
way things should go but it solved the problem I had.

There are three types of prompt plain, file or list. Plain is just plain
text entry, File allows you to select from a file dialog (Only when using
gui) and list allows you to select from a list of options. The value
captured is then placed in the property specified in the property attribute.

e.g.
    <prompt property="target" type="list" mode="gui">
      <value label="Item 1" value="item1" />
      <value label="Item 2" value="item2" />
    </prompt>

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org]
Sent: Thursday, November 30, 2000 11:54 AM
To: ant-dev@jakarta.apache.org
Subject: Prompt task


Hi,

I've been thinking about a prompt or ask like task, something like

<prompt alternatives="y,n" expect="y" default="y" property="abort">
JUnit not found. If you continue, you'll be unable to run tests.
Abort?</prompt>

<snip/>

My first idea would be to have a "DialogEngine" at the project
level. By default there was an engine that writes to System.out and
reads from System.in (logging system would not be appropriate as you
wouldn't want the prompt to end up in the log file instead the
console).

Each front end could provide an engine of its own, from my first
impression an interface like

public String askUser(String prompt, String[] alternatives, String default);

should suffice. 

Thoughts?

Stefan

Mime
View raw message