ca.sqlpower.wabit.swingui
Interface WabitSwingSession

All Superinterfaces:
ca.sqlpower.util.SPSession, ca.sqlpower.swingui.SwingWorkerRegistry, WabitSession
All Known Implementing Classes:
WabitSwingSessionImpl

public interface WabitSwingSession
extends ca.sqlpower.swingui.SwingWorkerRegistry, WabitSession

This defines UI components that are needed for each session. These UI pieces can be used to display or modify information in the session and its workspace.


Method Summary
 WabitSwingSessionContext getContext()
          Returns the context this session belongs to.
 java.net.URI getCurrentURI()
          Returns the URI that this session was most recently loaded from or saved to.
 java.io.File getCurrentURIAsFile()
          Returns the current URI as a File object, if the current URI is not null and it actually represents a file on a locally-accessible filesystem.
 ca.sqlpower.swingui.db.DatabaseConnectionManager getDbConnectionManager()
          Returns a connection manager that will allow users to alter the connections in this session.
 javax.swing.JTree getTree()
          Returns the JTree that describes the given session.
 WorkspaceTreeModel getWorkspaceTreeModel()
          Returns the tree model that is used to define the JTree in getTree().
 boolean hasUnsavedChanges()
          Reports whether or not any changes have been detected in this workspace since it was opened or last saved.
 void runInBackground(java.lang.Runnable runner)
          Starts this runner on a worker thread that is registered with this swing session.
 void runInForeground(java.lang.Runnable runner)
          The runner will be executed on the event dispatch thread.
 void setCurrentURI(java.net.URI uri)
          Sets the URI that this session was most recently loaded from or saved to, and resets the unsaved changes flag for this session.
 
Methods inherited from interface ca.sqlpower.swingui.SwingWorkerRegistry
registerSwingWorker, removeSwingWorker
 
Methods inherited from interface ca.sqlpower.wabit.WabitSession
addPropertyChangeListener, addSessionLifecycleListener, close, getDataSources, getSystemWorkspace, getWorkspace, isEnterpriseServerSession, removePropertyChangeListener, removeSessionLifecycleListener
 
Methods inherited from interface ca.sqlpower.util.SPSession
isForegroundThread
 

Method Detail

getTree

javax.swing.JTree getTree()
Returns the JTree that describes the given session.


getWorkspaceTreeModel

WorkspaceTreeModel getWorkspaceTreeModel()
Returns the tree model that is used to define the JTree in getTree().


getDbConnectionManager

ca.sqlpower.swingui.db.DatabaseConnectionManager getDbConnectionManager()
Returns a connection manager that will allow users to alter the connections in this session.


setCurrentURI

void setCurrentURI(java.net.URI uri)
Sets the URI that this session was most recently loaded from or saved to, and resets the unsaved changes flag for this session.


getCurrentURI

java.net.URI getCurrentURI()
Returns the URI that this session was most recently loaded from or saved to.


getCurrentURIAsFile

java.io.File getCurrentURIAsFile()
Returns the current URI as a File object, if the current URI is not null and it actually represents a file on a locally-accessible filesystem. Otherwise, returns null (for example, if the current URI is an HTTP URI or represents a Java system resource).

See Also:
getCurrentURI()

hasUnsavedChanges

boolean hasUnsavedChanges()
Reports whether or not any changes have been detected in this workspace since it was opened or last saved.

See Also:
setCurrentURI(URI)

getContext

WabitSwingSessionContext getContext()
Description copied from interface: WabitSession
Returns the context this session belongs to.

Specified by:
getContext in interface WabitSession

runInForeground

void runInForeground(java.lang.Runnable runner)
The runner will be executed on the event dispatch thread. This will block the UI from responding as long as the runner is running. If a process is running in the background and we need to fire events or do other work on the event dispatch thread it can be wrapped in a runnable and passed to here. The background thread will not block and wait for the runner to complete.

Specified by:
runInForeground in interface ca.sqlpower.util.SPSession

runInBackground

void runInBackground(java.lang.Runnable runner)
Starts this runner on a worker thread that is registered with this swing session. This helps enforce large running processes occur on a separate thread than the current one if the current thread is the event dispatch thread.

Specified by:
runInBackground in interface ca.sqlpower.util.SPSession


Copyright © 2009. All Rights Reserved.