ca.sqlpower.architect.swingui
Interface ArchitectSwingSession

All Superinterfaces:
ArchitectSession, ca.sqlpower.swingui.SwingWorkerRegistry, UserPrompterFactory
All Known Implementing Classes:
ArchitectSwingSessionImpl

public interface ArchitectSwingSession
extends ArchitectSession, ca.sqlpower.swingui.SwingWorkerRegistry

The ArchitectSwingSession interface provides methods that are applicable to a Swing UI invocation of the Architect. It extends the ArchitectSession interface, which provides information about a session with the core (non-UI specific) objects.


Field Summary
 
Fields inherited from interface ca.sqlpower.architect.ArchitectSession
PREFS_PL_INI_PATH
 
Method Summary
 void addSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<ArchitectSwingSession> listener)
          Adds the given listener to the list of interested parties who want to be notified when this session is about to close.
 void close()
          This is a common handler for all actions that must occur when switching projects, e.g., dispose dialogs, shut down running threads, etc.
 ArchitectFrame getArchitectFrame()
          Returns the ArchitectFrame created in this session.
 CompareDMSettings getCompareDMSettings()
           
 ArchitectSwingSessionContext getContext()
          Returns the context that created this session.
 KettleJob getKettleJob()
           
 OLAPEditSession getOLAPEditSession(OLAPSession olapSession)
          Returns the OLAPEditSession that is associated with editing the given OLAPSession.
 java.util.List<OLAPEditSession> getOLAPEditSessions()
          Returns a list of the OLAPEditSessions associated with this session's OLAP Schemas.
 PlayPen getPlayPen()
          Gets the value of playPen
 javax.swing.JDialog getProfileDialog()
          Returns the JDialog containing the ProfileManagerView
 SwingUIProject getProject()
          Narrows the return type for the project: Swing Sessions have SwingUI projects, which are a subclass of CoreProject.
 RecentMenu getRecentMenu()
          Gets the recent menu list
 boolean getRelationshipLinesDirect()
          Relationship line style: True means direct lines; false means only horizontal and vertical lines.
 DBTree getSourceDatabases()
          Gets the value of sourceDatabases
 UndoManager getUndoManager()
          Gets the UndoManager keeping track of changes in this session
 CoreUserSettings getUserSettings()
          See #userSettings.
 void initGUI()
          Initializes the GUI components for this session.
 void initGUI(ArchitectSwingSession openingSession)
          Like initGUI(), this method initializes the GUI components for this session, with the exception that the GUI components will get positioned relative to the GUI component of the given ArchitectSwingSession.
 boolean isNew()
          Returns true if the session contains a completely new and unmodified project.
 boolean isSavingEntireSource()
          See #savingEntireSource.
 boolean isShowAkTag()
          Returns whether the AK Tags will be shown
 boolean isShowFkTag()
          Returns whether the FK Tags will be shown
 boolean isShowForeign()
          Indicates whether FK Columns will be shown.
 boolean isShowIndexed()
          Indicates whether Indexed Columns will be shown.
 boolean isShowPkTag()
          Returns whether the PK Tags will be shown
 boolean isShowPrimary()
          Indicates whether PK Columns will be shown.
 boolean isShowTheRest()
          Indicates whether Columns that are not PK, FK, Unique or Indexed will be shown.
 boolean isShowUnique()
          Indicates whether Unique Columns will be shown.
 void removeSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<ArchitectSwingSession> listener)
          Removes the given listener from the lifecycle event list.
 boolean saveOrSaveAs(boolean showChooser, boolean separateThread)
          Saves the project associated with this session, optionally showing a file chooser, and optionally doing the work in a separate worker thread.
 void setKettleJob(KettleJob kettleJob)
           
 void setRelationshipLinesDirect(boolean direct)
          Relationship line style: True means direct lines; false means only horizontal and vertical lines.
 void setSavingEntireSource(boolean argSavingEntireSource)
          See #savingEntireSource.
 void setShowAkTag(boolean showAkTag)
          Sets whether the AK Tags will be shown
 void setShowFkTag(boolean showFkTag)
          Sets whether the FK Tags will be shown
 void setShowForeign(boolean showForeign)
          Sets whether FK Columns should be shown.
 void setShowIndexed(boolean showIndexed)
          Sets whether Indexed Columns should be shown.
 void setShowPkTag(boolean showPkTag)
          Sets whether the PK Tags will be shown
 void setShowPrimary(boolean showPrimary)
          Sets whether PK Columns should be shown.
 void setShowTheRest(boolean showTheRest)
          Sets whether Columns that are not PK, FK, Unique or Indexed should be shown.
 void setShowUnique(boolean showUnique)
          Sets whether Unique Columns should be shown.
 void showOLAPSchemaManager(java.awt.Window owner)
          Shows the schema manager dialog for this session's OLAP Schemas.
 
Methods inherited from interface ca.sqlpower.architect.ArchitectSession
createUserPrompter, getDDLGenerator, getName, getOLAPRootObject, getProfileManager, getRootObject, getTargetDatabase, setDDLGenerator, setName, setProject, setSourceDatabaseList
 
Methods inherited from interface ca.sqlpower.swingui.SwingWorkerRegistry
registerSwingWorker, removeSwingWorker
 

Method Detail

getContext

ArchitectSwingSessionContext getContext()
Returns the context that created this session.

Specified by:
getContext in interface ArchitectSession

getProject

SwingUIProject getProject()
Narrows the return type for the project: Swing Sessions have SwingUI projects, which are a subclass of CoreProject.

Specified by:
getProject in interface ArchitectSession

getRecentMenu

RecentMenu getRecentMenu()
Gets the recent menu list

Returns:
the recent menu

getArchitectFrame

ArchitectFrame getArchitectFrame()
Returns the ArchitectFrame created in this session.


getSourceDatabases

DBTree getSourceDatabases()
Gets the value of sourceDatabases

Returns:
the value of sourceDatabases

getPlayPen

PlayPen getPlayPen()
Gets the value of playPen

Returns:
the value of playPen

getUndoManager

UndoManager getUndoManager()
Gets the UndoManager keeping track of changes in this session


getCompareDMSettings

CompareDMSettings getCompareDMSettings()

getProfileDialog

javax.swing.JDialog getProfileDialog()
Returns the JDialog containing the ProfileManagerView


close

void close()
This is a common handler for all actions that must occur when switching projects, e.g., dispose dialogs, shut down running threads, etc.


getUserSettings

CoreUserSettings getUserSettings()
See #userSettings.

Returns:
the value of userSettings

saveOrSaveAs

boolean saveOrSaveAs(boolean showChooser,
                     boolean separateThread)
Saves the project associated with this session, optionally showing a file chooser, and optionally doing the work in a separate worker thread.

Parameters:
showChooser - If true, a file chooser will always be presented. If false, a file chooser will only be presented if the project save location has not yet been set.
separateThread - If true, the work will be done in a separate thread and this method will return in a shorter amount of time.
Returns:
True if the save operation was not cancelled by the user.

isSavingEntireSource

boolean isSavingEntireSource()
See #savingEntireSource.

Returns:
the value of savingEntireSource

setSavingEntireSource

void setSavingEntireSource(boolean argSavingEntireSource)
See #savingEntireSource.

Parameters:
argSavingEntireSource - Value to assign to this.savingEntireSource

getKettleJob

KettleJob getKettleJob()

setKettleJob

void setKettleJob(KettleJob kettleJob)

initGUI

void initGUI()
             throws ArchitectException
Initializes the GUI components for this session. Call this only if you need a GUI. This method must be called on the Swing Event Dispatch Thread.

Throws:
ArchitectException
java.lang.IllegalStateException - if showGUI==true and this method was not called on the Event Dispatch Thread.

initGUI

void initGUI(ArchitectSwingSession openingSession)
             throws ArchitectException
Like initGUI(), this method initializes the GUI components for this session, with the exception that the GUI components will get positioned relative to the GUI component of the given ArchitectSwingSession. As with initGUI(), call this only if you need a GUI. This method must be called on the Swing Event Dispatch Thread.

Parameters:
openingSession - The ArchitectSwingSession to which this session's GUI components will be positioned relative to
Throws:
ArchitectException
java.lang.IllegalStateException - if showGUI==true and this method was not called on the Event Dispatch Thread.

isNew

boolean isNew()
Returns true if the session contains a completely new and unmodified project. Otherwise, it returns false.

Note: that this property is different from the SwingUIProject.isModified() property in that the isNew property is persisted when the project is saved, and refers to whether the project was ever modified since it was first created, whereas, the isModified property refers to whether the project was modified ever since the project was last loaded.


getRelationshipLinesDirect

boolean getRelationshipLinesDirect()
Relationship line style: True means direct lines; false means only horizontal and vertical lines.


setRelationshipLinesDirect

void setRelationshipLinesDirect(boolean direct)
Relationship line style: True means direct lines; false means only horizontal and vertical lines. Updating this preference will cause all of the relationships in this session's play pen to have their line style updated.


isShowPkTag

boolean isShowPkTag()
Returns whether the PK Tags will be shown


setShowPkTag

void setShowPkTag(boolean showPkTag)
Sets whether the PK Tags will be shown


isShowFkTag

boolean isShowFkTag()
Returns whether the FK Tags will be shown


setShowFkTag

void setShowFkTag(boolean showFkTag)
Sets whether the FK Tags will be shown


isShowAkTag

boolean isShowAkTag()
Returns whether the AK Tags will be shown


setShowAkTag

void setShowAkTag(boolean showAkTag)
Sets whether the AK Tags will be shown


isShowPrimary

boolean isShowPrimary()
Indicates whether PK Columns will be shown.


setShowPrimary

void setShowPrimary(boolean showPrimary)
Sets whether PK Columns should be shown.


isShowForeign

boolean isShowForeign()
Indicates whether FK Columns will be shown.


setShowForeign

void setShowForeign(boolean showForeign)
Sets whether FK Columns should be shown.


isShowUnique

boolean isShowUnique()
Indicates whether Unique Columns will be shown.


setShowUnique

void setShowUnique(boolean showUnique)
Sets whether Unique Columns should be shown.


isShowIndexed

boolean isShowIndexed()
Indicates whether Indexed Columns will be shown.


setShowIndexed

void setShowIndexed(boolean showIndexed)
Sets whether Indexed Columns should be shown.


isShowTheRest

boolean isShowTheRest()
Indicates whether Columns that are not PK, FK, Unique or Indexed will be shown.


setShowTheRest

void setShowTheRest(boolean showTheRest)
Sets whether Columns that are not PK, FK, Unique or Indexed should be shown.


showOLAPSchemaManager

void showOLAPSchemaManager(java.awt.Window owner)
Shows the schema manager dialog for this session's OLAP Schemas.

Parameters:
owner - The owner of the dialog.

getOLAPEditSessions

java.util.List<OLAPEditSession> getOLAPEditSessions()
Returns a list of the OLAPEditSessions associated with this session's OLAP Schemas.

Returns:
the list of edit sessions.

getOLAPEditSession

OLAPEditSession getOLAPEditSession(OLAPSession olapSession)
Returns the OLAPEditSession that is associated with editing the given OLAPSession.

Parameters:
olapSession - the OLAPSession in question, must not be null.
Returns:
the associated OLAPEditSession, creates a new one if none found.

addSessionLifecycleListener

void addSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<ArchitectSwingSession> listener)
Adds the given listener to the list of interested parties who want to be notified when this session is about to close. Being a lifecycle listener is an excellent way to make a session shutdown hook for your subsystem.


removeSessionLifecycleListener

void removeSessionLifecycleListener(ca.sqlpower.swingui.event.SessionLifecycleListener<ArchitectSwingSession> listener)
Removes the given listener from the lifecycle event list. Once removed, the listener will not receive a sessionClosing notification when this session closes.



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