ca.sqlpower.architect.swingui
Interface ArchitectSwingSessionContext

All Superinterfaces:
ArchitectSessionContext
All Known Implementing Classes:
ArchitectSwingSessionContextImpl

public interface ArchitectSwingSessionContext
extends ArchitectSessionContext

The ArchitectSwingSessionContext interface specifies a set of properties and methods for creating new Architect Swing Sessions. Additionally, the session context is the gateway to information that is specific to the current user's environment (as opposed to information that is attached to specific projects, which is stored in the session).


Field Summary
static int ICON_SIZE
          The size, in pixels, of the icons in the toolbar.
 
Fields inherited from interface ca.sqlpower.architect.ArchitectSessionContext
DRIVERS_URL
 
Method Summary
 void closeAll()
          Closes all sessions and terminates the VM.
 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, boolean showGUI)
          Creates a new session by loading the Architect XML project description from the given input stream.
 boolean getExitAfterAllSessionsClosed()
          Returns the current session for exiting after all sessions are closed.
 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 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 interface ca.sqlpower.architect.ArchitectSessionContext
createSession, getConnections, getPlDotIni, getPlDotIniPath, getPrefs, getSessions, setPlDotIniPath
 

Field Detail

ICON_SIZE

static final int ICON_SIZE
The size, in pixels, of the icons in the toolbar. This used to be managed as a user preference, but we no longer maintain two sets of icons at different pixel sizes.

See Also:
Constant Field Values
Method Detail

createSession

ArchitectSwingSession createSession()
                                    throws ArchitectException
Creates a new session within this parent context. This will cause an Architect Frame to appear on the user's desktop with a new empty project in it.

Important note: 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.

Specified by:
createSession in interface ArchitectSessionContext
Throws:
ArchitectException

createSession

ArchitectSwingSession createSession(boolean showGUI)
                                    throws ArchitectException
Creates a new session within this parent context. This will cause an Architect Frame to appear on the user's desktop with a new empty project in it.

Important 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.

Parameters:
showGUI - True if you want this session to have its own (visible)\ ArchitectFrame instance; false for an invisible session.
Returns:
The new session
Throws:
ArchitectException

createSession

ArchitectSwingSession createSession(java.io.InputStream in,
                                    boolean showGUI)
                                    throws ArchitectException,
                                           java.io.IOException
Creates a new session by loading the Architect XML project description from the given input stream.

Parameters:
in - The input stream to read the XML data from
showGUI - True if you want this session to have its own (visible)\ ArchitectFrame instance; false for an invisible session.
Returns:
The new session
Throws:
ArchitectException
java.io.IOException

createSession

ArchitectSwingSession createSession(ArchitectSwingSession openingSession)
                                    throws ArchitectException
Creates a new session that will have its GUI components positioned relative to the GUI components of the given ArchitectSwingSession. Typically, the given ArchitectSwingSession is the session from where the call to create a new session was made. (ex. the given session's 'Open Project' button was pressed). If the given session is null, then it will default to using the most recently saved GUI component positions in the user preferences in ArchitectSwingUserSettings.

Parameters:
openingSession -
Returns:
Throws:
ArchitectException

isMacOSX

boolean isMacOSX()
Returns true iff this context is running on a Mac OS X machine. Some UI features are different under that platform to increase the illusion that the Architect is a native application.


closeAll

void closeAll()
Closes all sessions and terminates the VM. This is the typical "exit" action for a project.


setExitAfterAllSessionsClosed

void setExitAfterAllSessionsClosed(boolean allowExit)
Optional setting which will have the context call System.exit() after there are no open sessions remaining. This option is useful for a full single-user Architect application, but not a good idea for embedded use of the Architect, since it will quit your app when you're finished with the Architect API.

The default behaviour for all context implementations must be not to terminate the VM.

Parameters:
allowExit - True will allow the context to terminate the VM; false means the context will never call System.exit().

getExitAfterAllSessionsClosed

boolean getExitAfterAllSessionsClosed()
Returns the current session for exiting after all sessions are closed. See setExitAfterAllSessionsClosed(boolean) for details.


showConnectionManager

void showConnectionManager(java.awt.Window owner)
Shows the connection manager dialog for this context's data source collection.

Parameters:
owner - The owner of the dialog.

showPreferenceDialog

void showPreferenceDialog(java.awt.Window owner)
Shows the user preferences dialog for this application context.

Parameters:
owner - The owner of the dialog

getUserSettings

CoreUserSettings getUserSettings()
Gets the user settings for this session



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