ca.sqlpower.architect
Interface UserPrompterFactory

All Known Subinterfaces:
ArchitectSession, ArchitectSwingSession
All Known Implementing Classes:
AlwaysOKUserPrompterFactory, ArchitectSessionImpl, ArchitectSwingSessionImpl

public interface UserPrompterFactory


Method Summary
 UserPrompter createUserPrompter(java.lang.String question, java.lang.String okText, java.lang.String notOkText, java.lang.String cancelText)
          Creates a new user prompter instance with the given settings.
 

Method Detail

createUserPrompter

UserPrompter createUserPrompter(java.lang.String question,
                                java.lang.String okText,
                                java.lang.String notOkText,
                                java.lang.String cancelText)
Creates a new user prompter instance with the given settings. User prompter instances can be stateful (for example, an "always accept" button will cause that prompter to continue returning "OK" forever), so it is important to obtain a new user prompter from this factory for every overall operation.

Parameters:
question - The question the new prompter will pose when solociting a response from the user. This question string is not exactly plain text: it is formatted according to to rules laid out in the MessageFormat class. The most important implications are that the single quote (') character and the open curly brace ({) characters are special and have to be escaped in order to appear in the message. The other important thing (the benefit, that is) is that constructions of the form {0} are placeholders that will be substituted every time the question is asked via the UserPrompter.promptUser(Object[]) method is called. See MessageFormat for details.

Also, UserPrompter implementations will ensure that newline characters (\n) show up as new lines when the question is presented to the user.

okText - The text to associate with the OK response. Try to use a word or phrase from the question instead of a generic word like "OK" or "Yes".
notOkText - The text to associate with the "not OK" response. Try to use a word or phrase from the question instead of a generic word like "No".
cancelText - The text to associate with response that cancels the whole operation.


Copyright © 2003-2007 SQL Power Group Inc. www.sqlpower.ca