ca.sqlpower.architect.swingui
Class CompareDMPanel.SourceOrTargetStuff.CatalogPopulator

java.lang.Object
  extended by ca.sqlpower.swingui.SPSwingWorker
      extended by ca.sqlpower.swingui.MonitorableWorker
          extended by ca.sqlpower.architect.swingui.CompareDMPanel.SourceOrTargetStuff.CatalogPopulator
All Implemented Interfaces:
ca.sqlpower.util.Monitorable, java.awt.event.ActionListener, java.lang.Runnable, java.util.EventListener
Enclosing class:
CompareDMPanel.SourceOrTargetStuff

public class CompareDMPanel.SourceOrTargetStuff.CatalogPopulator
extends ca.sqlpower.swingui.MonitorableWorker
implements java.awt.event.ActionListener

Finds all the children of a database and puts them in the GUI.


Constructor Summary
CompareDMPanel.SourceOrTargetStuff.CatalogPopulator(ArchitectSwingSession session)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Checks the datasource selected in the databaseDropdown, and starts a worker thread to read its contents if it exists.
 void cleanup()
          Does GUI cleanup work on the Swing EDT once the worker is done.
 void doStuff()
          Populates the database db which got set up in actionPerformed().
 boolean isFinished()
           
 void setDefaultCatalog(java.lang.String def)
          If select is a valid catalog of the database this sets a string that will be used as a default item to select for the catalog next time the list will be redrawn, (this will happen only once).
 void setDefaultSchema(java.lang.String def)
          If select is a valid schema of the database and there is no catalogs for this database this sets a string that will be used as a default item to select for the schema next time the list will be redrawn, (this will happen only once).
 
Methods inherited from class ca.sqlpower.swingui.SPSwingWorker
addTaskTerminationListener, getCleanupExceptionMessage, getDoStuffException, getNextProcess, isCanceled, isCancelled, kill, removeTaskTerminationListener, run, setCancelled, setCleanupExceptionMessage, setDoStuffException, setNextProcess
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ca.sqlpower.util.Monitorable
isCancelled, setCancelled
 

Constructor Detail

CompareDMPanel.SourceOrTargetStuff.CatalogPopulator

public CompareDMPanel.SourceOrTargetStuff.CatalogPopulator(ArchitectSwingSession session)
Method Detail

setDefaultCatalog

public void setDefaultCatalog(java.lang.String def)
If select is a valid catalog of the database this sets a string that will be used as a default item to select for the catalog next time the list will be redrawn, (this will happen only once). Else does nothing

Parameters:
select - The name of the item to select

setDefaultSchema

public void setDefaultSchema(java.lang.String def)
If select is a valid schema of the database and there is no catalogs for this database this sets a string that will be used as a default item to select for the schema next time the list will be redrawn, (this will happen only once). Else does nothing

Parameters:
select - The name of the item to select

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Checks the datasource selected in the databaseDropdown, and starts a worker thread to read its contents if it exists.

Otherwise, clears out the catalog and schema dropdowns and does not start a worker thread.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

doStuff

public void doStuff()
             throws java.lang.Exception
Populates the database db which got set up in actionPerformed().

Specified by:
doStuff in class ca.sqlpower.swingui.SPSwingWorker
Throws:
java.lang.Exception

cleanup

public void cleanup()
             throws ArchitectException
Does GUI cleanup work on the Swing EDT once the worker is done.

This work involves:

Specified by:
cleanup in class ca.sqlpower.swingui.SPSwingWorker
Throws:
ArchitectException

isFinished

public boolean isFinished()
Specified by:
isFinished in interface ca.sqlpower.util.Monitorable


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