|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.architect.swingui.ArchitectSwingSessionContextImpl
public class ArchitectSwingSessionContextImpl
Instances of this class provide the basic global (non-project-specific) settings and facilities to an invocation of the Architect's Swing user interface. You need an instance of one of these in order to start the Architect's Swing UI.
It may one day be desirable for this to be an interface, but there didn't seem to be a need for it when we first created this class.
| Field Summary |
|---|
| Fields inherited from interface ca.sqlpower.architect.swingui.ArchitectSwingSessionContext |
|---|
ICON_SIZE |
| Fields inherited from interface ca.sqlpower.architect.ArchitectSessionContext |
|---|
DRIVERS_URL |
| Method Summary | |
|---|---|
void |
closeAll()
Attempts to close all sessions that were created by this context. |
ArchitectSwingSession |
createSession()
Creates a new session within this parent context. |
ArchitectSwingSession |
createSession(ArchitectSwingSession openingSession)
Creates a new session that will have its GUI components positioned relative to the GUI components of the given ArchitectSwingSession. |
ArchitectSwingSession |
createSession(boolean showGUI)
Creates a new session within this parent context. |
ArchitectSwingSession |
createSession(java.io.InputStream in)
Creates a new session by loading the Architect XML project description from the given input stream. |
ArchitectSwingSession |
createSession(java.io.InputStream in,
boolean showGUI)
Loads the XML project description from the input stream, optionally creating the GUI for you. |
java.util.List<ca.sqlpower.sql.SPDataSource> |
getConnections()
|
boolean |
getExitAfterAllSessionsClosed()
Returns the current session for exiting after all sessions are closed. |
ca.sqlpower.sql.DataSourceCollection |
getPlDotIni()
Tries to read the plDotIni if it hasn't been done already. |
java.lang.String |
getPlDotIniPath()
|
java.util.prefs.Preferences |
getPrefs()
Returns the user preferences node associated with this context. |
java.util.Collection<ArchitectSession> |
getSessions()
Returns a collection containing all the sessions from this context. |
CoreUserSettings |
getUserSettings()
Gets the user settings for this session |
boolean |
isMacOSX()
Returns true iff this context is running on a Mac OS X machine. |
void |
setExitAfterAllSessionsClosed(boolean allowExit)
Optional setting which will have the context call System.exit() after there are no open sessions remaining. |
void |
setPlDotIniPath(java.lang.String plDotIniPath)
Sets the plDotIniPath property, and nulls out the current plDotIni if the given value differs from the existing one. |
void |
showConnectionManager(java.awt.Window owner)
Shows the connection manager dialog for this context's data source collection. |
void |
showPreferenceDialog(java.awt.Window owner)
Shows the user preferences dialog for this application context. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public ArchitectSwingSession createSession(java.io.InputStream in,
boolean showGUI)
throws ArchitectException,
java.io.IOException
Important Note: If you set showGUI to true, this method
must be called on the Swing Event Dispatch Thread. If this is
not possible or practical, call this method with showGUI false,
then call ArchitectSwingSession.initGUI() on the returned
session using the event dispatch thread some time later on.
createSession in interface ArchitectSwingSessionContextin - The input stream to read the XML data fromshowGUI - True if you want this session to have its own (visible)\
ArchitectFrame instance; false for an invisible session.
java.io.IOException - If the file is not found or can't be read.
ArchitectException - if there is some problem with the file
java.lang.IllegalStateException - if showGUI==true and this method was
not called on the Event Dispatch Thread.
public ArchitectSwingSession createSession()
throws ArchitectException
ArchitectSessionContext
createSession in interface ArchitectSessionContextcreateSession in interface ArchitectSwingSessionContextArchitectException
public ArchitectSwingSession createSession(boolean showGUI)
throws ArchitectException
ArchitectSwingSessionContextImportant note: If showGUI is true, this method must be called on the Swing Event Dispatch Thread. See SwingUtilities.invokeLater() for a way of ensuring this method is called on the proper thread.
createSession in interface ArchitectSwingSessionContextshowGUI - True if you want this session to have its own (visible)\
ArchitectFrame instance; false for an invisible session.
ArchitectException
public ArchitectSwingSession createSession(java.io.InputStream in)
throws ArchitectException,
java.io.IOException
ArchitectSessionContext
createSession in interface ArchitectSessionContextin - The input stream to read the XML data from
ArchitectException
java.io.IOException
public ArchitectSwingSession createSession(ArchitectSwingSession openingSession)
throws ArchitectException
ArchitectSwingSessionContextArchitectSwingUserSettings.
createSession in interface ArchitectSwingSessionContextArchitectExceptionpublic boolean isMacOSX()
ArchitectSwingSessionContext
isMacOSX in interface ArchitectSwingSessionContextpublic java.util.prefs.Preferences getPrefs()
ArchitectSessionContext
getPrefs in interface ArchitectSessionContextpublic CoreUserSettings getUserSettings()
ArchitectSwingSessionContext
getUserSettings in interface ArchitectSwingSessionContextpublic java.util.Collection<ArchitectSession> getSessions()
ArchitectSessionContext
getSessions in interface ArchitectSessionContextpublic void showConnectionManager(java.awt.Window owner)
ArchitectSwingSessionContext
showConnectionManager in interface ArchitectSwingSessionContextowner - The owner of the dialog.public void showPreferenceDialog(java.awt.Window owner)
ArchitectSwingSessionContext
showPreferenceDialog in interface ArchitectSwingSessionContextowner - The owner of the dialogpublic void closeAll()
closeAll in interface ArchitectSwingSessionContextpublic boolean getExitAfterAllSessionsClosed()
ArchitectSwingSessionContextArchitectSwingSessionContext.setExitAfterAllSessionsClosed(boolean) for details.
getExitAfterAllSessionsClosed in interface ArchitectSwingSessionContextpublic void setExitAfterAllSessionsClosed(boolean allowExit)
ArchitectSwingSessionContextThe default behaviour for all context implementations must be not to terminate the VM.
setExitAfterAllSessionsClosed in interface ArchitectSwingSessionContextallowExit - True will allow the context to terminate the VM; false
means the context will never call System.exit().public java.util.List<ca.sqlpower.sql.SPDataSource> getConnections()
getConnections in interface ArchitectSessionContextpublic ca.sqlpower.sql.DataSourceCollection getPlDotIni()
ArchitectSessionContext#plDotIni.
getPlDotIni in interface ArchitectSessionContextpublic java.lang.String getPlDotIniPath()
getPlDotIniPath in interface ArchitectSessionContextpublic void setPlDotIniPath(java.lang.String plDotIniPath)
ArchitectSessionContext#plDotIniPath.
setPlDotIniPath in interface ArchitectSessionContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||