ca.sqlpower.wabit.swingui
Class WorkspacePanel

java.lang.Object
  extended by ca.sqlpower.wabit.swingui.WorkspacePanel
All Implemented Interfaces:
ca.sqlpower.swingui.DataEntryPanel, WabitPanel

public class WorkspacePanel
extends java.lang.Object
implements WabitPanel

This panel will display information about the workspace. It will also allow the user to add and remove data sources.


Nested Class Summary
static class WorkspacePanel.FurryPanel
          This is the panel which paints the hair on the back of the wabit welcome screen and the hair on the back of the WorkspacePanel.
static class WorkspacePanel.LogoLayout
          This layout generates the Wabit logo panel with the version number in it.
 
Constructor Summary
WorkspacePanel(WabitSwingSession session)
           
 
Method Summary
static void addJDBCDataSource(ca.sqlpower.sql.JDBCDataSource ds, WabitSwingSession session)
          This method is used in the DB connection manager to add the selected db to the workspace.
static void addOlap4jDataSource(ca.sqlpower.sql.Olap4jDataSource ds, WabitSwingSession session)
          This method is used in the DB connection manager to add the selected olap connection to the workspace.
 boolean applyChanges()
           
static ca.sqlpower.swingui.db.DatabaseConnectionManager createDBConnectionManager(WabitSwingSession session, java.awt.Window owner)
          This will create the DBConnectionManager for the WorkspacePanel and other panels that need to allow users to add a data source to the workspace.
 void discardChanges()
           
 javax.swing.JComponent getPanel()
           
 javax.swing.JComponent getSourceComponent()
          Returns the component (often a JTree or JList, but can be anything) that contains all the workspace items that can be dragged into this editor.
 java.lang.String getTitle()
          Returns a suitable string that can be used in the title of a containing window or frame.
 javax.swing.JToolBar getToolbar()
          Returns the toolbar.
 boolean hasUnsavedChanges()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkspacePanel

public WorkspacePanel(WabitSwingSession session)
Method Detail

createDBConnectionManager

public static ca.sqlpower.swingui.db.DatabaseConnectionManager createDBConnectionManager(WabitSwingSession session,
                                                                                         java.awt.Window owner)
This will create the DBConnectionManager for the WorkspacePanel and other panels that need to allow users to add a data source to the workspace. One other place this gets used is the NewWorkspaceScreen where the user adds the first data source to a workspace.

Parameters:
session -
Returns:

addJDBCDataSource

public static void addJDBCDataSource(ca.sqlpower.sql.JDBCDataSource ds,
                                     WabitSwingSession session)
This method is used in the DB connection manager to add the selected db to the workspace.


addOlap4jDataSource

public static void addOlap4jDataSource(ca.sqlpower.sql.Olap4jDataSource ds,
                                       WabitSwingSession session)
This method is used in the DB connection manager to add the selected olap connection to the workspace.


applyChanges

public boolean applyChanges()
Specified by:
applyChanges in interface ca.sqlpower.swingui.DataEntryPanel

discardChanges

public void discardChanges()
Specified by:
discardChanges in interface ca.sqlpower.swingui.DataEntryPanel

getPanel

public javax.swing.JComponent getPanel()
Specified by:
getPanel in interface ca.sqlpower.swingui.DataEntryPanel

hasUnsavedChanges

public boolean hasUnsavedChanges()
Specified by:
hasUnsavedChanges in interface ca.sqlpower.swingui.DataEntryPanel

getTitle

public java.lang.String getTitle()
Description copied from interface: WabitPanel
Returns a suitable string that can be used in the title of a containing window or frame. Usually describes what the panel contains. (ex. "Query Editor" or "Report Editor")

Specified by:
getTitle in interface WabitPanel

getSourceComponent

public javax.swing.JComponent getSourceComponent()
Description copied from interface: WabitPanel
Returns the component (often a JTree or JList, but can be anything) that contains all the workspace items that can be dragged into this editor. The component will not be wrapped in a scroll pane; you get to do this yourself if your component needs one.

Specified by:
getSourceComponent in interface WabitPanel
Returns:
The component as described above, or null if nothing can be dropped on this panel.

getToolbar

public javax.swing.JToolBar getToolbar()
Description copied from interface: WabitPanel
Returns the toolbar. A null value means not to render the toolbar.

Specified by:
getToolbar in interface WabitPanel


Copyright © 2009. All Rights Reserved.