ca.sqlpower.architect
Class AlwaysOKUserPrompterFactory

java.lang.Object
  extended by ca.sqlpower.architect.AlwaysOKUserPrompterFactory
All Implemented Interfaces:
UserPrompterFactory

public class AlwaysOKUserPrompterFactory
extends java.lang.Object
implements UserPrompterFactory

Factory that creates user prompters that always respond with OK, and never actually prompt the user. This is appropriate for headless environments and embedded use, and it is the default factory for the core ArchitectSessionImpl.


Constructor Summary
AlwaysOKUserPrompterFactory()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlwaysOKUserPrompterFactory

public AlwaysOKUserPrompterFactory()
Method Detail

createUserPrompter

public UserPrompter createUserPrompter(java.lang.String question,
                                       java.lang.String okText,
                                       java.lang.String notOkText,
                                       java.lang.String cancelText)
Description copied from interface: UserPrompterFactory
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.

Specified by:
createUserPrompter in interface UserPrompterFactory
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