|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tentackle.appworx.AbstractApplication
org.tentackle.appworx.Application
public abstract class Application
Abstract class to handle the application's lifecycle.
Tentackle applications should extend this class and invoke start(java.lang.String[]).
To shutdown gracefully, application should invokd stop().
At minimum, the method doCreateWindow() must be implemented.
The subclass just needs to provide a main-method, for example:
public static void main(String args[]) {
new MyApplication().start(args);
}
| Constructor Summary | |
|---|---|
Application(String name,
Icon logo)
Creates an application. |
|
| Method Summary | |
|---|---|
void |
changeLookAndFeel(String name)
Changes the look and feel. |
JMenu |
createLookAndFeelMenu()
Creates a menu to select the look and feel. |
ModificationThread |
createModificationThread()
Creates the modification thread ready for being started. |
protected void |
doConfigureApplication()
Do anything what's necessary after the connection has been established. |
protected abstract FormWindow |
doCreateWindow()
Creates the top level window. |
protected void |
doFinishStartup()
Finishes the startup. Invoked after all has been displayed. |
protected ContextDb |
doLogin()
Connects to the database backend (or application server). |
protected void |
doShowWindow()
Shows the window. |
protected void |
doStop(int exitValue)
Terminates the application gracefully. |
CommandLine |
getCommandLine()
Gets the command line. |
Icon |
getLogo()
Gets the logo. |
String |
getName()
Gets the application name. |
FormWindow |
getWindow()
Gets the application's window. |
protected void |
installLookAndFeels()
Installs the available look and feels. |
protected void |
installPreferences()
Installs the preferences backend. The default implementation installs the DbPreferencesFactory unless
"--nodbprefs" is given. |
protected void |
installSecurityManager()
installs the tentackle security manager |
void |
setLookAndFeel(String name)
Sets the look and feel. |
void |
showEditDialog(Class<? extends AppDbObject> clazz)
Brings up a non-modal edit dialog for a given class. |
AppDbObject |
showEditDialog(Component comp,
AppDbObject object,
boolean modal)
Brings up an edit dialog for a given object. |
AppDbObject |
showEditDialog(Component comp,
Class<? extends AppDbObject> clazz,
boolean modal)
Brings up an edit dialog for a given class. |
void |
showLoginStatus(String msg)
Displays a message during login. |
void |
showSearchDialog(Class<? extends AppDbObject> clazz)
Brings up a search dialog for a given class. |
void |
showSearchDialog(FormWindow w,
Class<? extends AppDbObject> clazz)
Brings up a search dialog for a given class. |
void |
start(String[] args)
Launches the application. |
void |
stop()
Gracefully terminates the application. |
String |
toString()
Gets the application's name. |
| Methods inherited from class org.tentackle.appworx.AbstractApplication |
|---|
createContextDb, createDb, createUserInfo, detectEE, detectJNLP, doInitialize, getContextDb, getDb, getProperties, getProperty, getRunningApplication, getUser, getUser, getUserInfo, isDeployedByEE, isDeployedByJNLP, register, securityRulesChanged, setContextDb, setProperties, setUserInfo, unregister, updateUserId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Application(String name,
Icon logo)
name - the application's namelogo - the application's logo icon| Method Detail |
|---|
public void start(String[] args)
args - the arguments (usually from commandline)public void stop()
public String toString()
toString in class Objectpublic CommandLine getCommandLine()
public String getName()
public Icon getLogo()
public FormWindow getWindow()
public void setLookAndFeel(String name)
name - the name of the look and feelpublic void changeLookAndFeel(String name)
name - the name of the l&fpublic JMenu createLookAndFeelMenu()
public void showLoginStatus(String msg)
msg - the status message
public AppDbObject showEditDialog(Component comp,
AppDbObject object,
boolean modal)
throws ApplicationException
comp - some component of the owner window, null if noneobject - the object to create the dialog formodal - true if modal, else non-modal
ApplicationException
public AppDbObject showEditDialog(Component comp,
Class<? extends AppDbObject> clazz,
boolean modal)
throws ApplicationException
comp - some component of the owner window, null if noneclazz - is the object's classmodal - true if modal, else non-modal
ApplicationExceptionpublic void showEditDialog(Class<? extends AppDbObject> clazz)
clazz - is the object's class
public void showSearchDialog(FormWindow w,
Class<? extends AppDbObject> clazz)
w - is the related window, null if noneclazz - is the object's classpublic void showSearchDialog(Class<? extends AppDbObject> clazz)
clazz - is the object's classpublic ModificationThread createModificationThread()
createModificationThread in class AbstractApplicationprotected void installPreferences()
DbPreferencesFactory unless
"--nodbprefs" is given.
The option "--sysprefs" forces usage of system preferences only.
"--roprefs" sets the preferences to readonly.
installPreferences in class AbstractApplicationprotected void installLookAndFeels()
protected void installSecurityManager()
installSecurityManager in class AbstractApplication
protected ContextDb doLogin()
throws ApplicationException
Notice: if the application is started via JNLP (Java WebStart) and the
commandline option "--db=" is given, it is interpreted as a URL
to the db-properties file relative to the JNLP codebase. If it starts with
"<protocol>://" it is taken as an absolute URL.
Example:
--db=http://www.tentackle.org/Invoicer/Db.properties is the same as: --db=Db.properties if the codebase is http://www.tentackle.org/Invoicer.
ApplicationException
protected void doConfigureApplication()
throws ApplicationException
doConfigureApplication in class AbstractApplicationApplicationException
protected abstract FormWindow doCreateWindow()
throws ApplicationException
ApplicationException
protected void doShowWindow()
throws ApplicationException
ApplicationException
protected void doFinishStartup()
throws ApplicationException
"--nomodthread" given.
doFinishStartup in class AbstractApplicationApplicationExceptionprotected void doStop(int exitValue)
exitValue - the doStop value for System.exit()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||