pt.moredata.dataentry.core
Class GenericSwingDataEntryController

java.lang.Object
  extended bypt.moredata.dataentry.core.GenericSwingDataEntryController
All Implemented Interfaces:
SwingDataEntryController

public class GenericSwingDataEntryController
extends java.lang.Object
implements SwingDataEntryController

Esta classe implementa a interface SwingDataEntryController e permite controlar várias entradas de dados. Toda a parte visual devera ser construida numa outra classe, atraves de um editor de forms, por exemplo. A funcao desta classe e apenas de controlar as entradas de dados. FIXME : E necessario pecorrer todos os DataEntry's e verificar se algum precisa de ser gravado. Actualmente, apenas o que esta selecionado e que esta a ser verificado. Company MoreData

Version:
$Revision: 1.25 $
Author:
pcarmo

Constructor Summary
GenericSwingDataEntryController()
          Creates new GenericSwingDataEntryController Form.
GenericSwingDataEntryController(DataSource dataSource, Splash splash, int progressBarSize)
          Creates new GenericSwingDataEntryController Form.
 
Method Summary
 void addDataEntry(DataEntry dataEntry, javax.swing.JComponent component)
          Adiciona um DataEntry a ser controlado por esta classe.
 void cleanUp()
          Clean up the GenericSwingDataEntryController, removing all listeners added to other objects.
 DataEntry getCurrentDataEntry()
          Getter for property currentDataEntry.
 DataSource getDataSource()
          Getter for property _dataSource.
 boolean realyWhantToExit()
          Util method to open a dialog to the user confirm if we whants realy exist from the application.
 boolean saveCurrentRecord()
          Util method to open a dialog to the user confirm if we whants to save ths current record.
 void setCurrentDataEntry(DataEntry currentDataEntry)
          Setter for property currentDataEntry.
 void setDataSource(DataSource dataSource)
          Afecta o DataSource do DataEntryController.
 void setProgressBarSize(int progressBarSize)
          Altera o valor que pode ser incrementado pelo DataEntryController na barra de progresso.
 void setShowSplash(boolean showSplash)
          Setter for property showSplash.
 void setSplash(Splash splash)
          Adiciona uma janela de splash onde devera aparecer o progresso da inicializacao do DataEntryController.
 void setStatusBar(StatusBar statusBar)
          Setter for property statusBar.
 void setTabbedPane(javax.swing.JTabbedPane tabbedPane)
          Afecta o TabbedPane usado pelo DataEntryController.
 void setToolBar(NavigationToolBar toolBar)
          Afecta a toolbar usada pelo DataEntryController.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericSwingDataEntryController

public GenericSwingDataEntryController()
Creates new GenericSwingDataEntryController Form.


GenericSwingDataEntryController

public GenericSwingDataEntryController(DataSource dataSource,
                                       Splash splash,
                                       int progressBarSize)
Creates new GenericSwingDataEntryController Form.

Parameters:
dataSource - DataSource a usar.
splash - A janela de splash para mostrar informacao de inicializacao. Pode ser null.
progressBarSize - Valor total que pode ser incrementado na barra de progresso
Method Detail

realyWhantToExit

public boolean realyWhantToExit()
Util method to open a dialog to the user confirm if we whants realy exist from the application.

Specified by:
realyWhantToExit in interface SwingDataEntryController
Returns:
true if the user whants to exit the application, false otherwise.

saveCurrentRecord

public boolean saveCurrentRecord()
Util method to open a dialog to the user confirm if we whants to save ths current record.

Specified by:
saveCurrentRecord in interface SwingDataEntryController
Returns:
true if the record was sucessufuly saved, if the record was not modified or if the user didn't want to save the record, false otherwise.

getDataSource

public DataSource getDataSource()
Getter for property _dataSource.

Specified by:
getDataSource in interface SwingDataEntryController
Returns:
Value of property _dataSource.

setDataSource

public void setDataSource(DataSource dataSource)
Afecta o DataSource do DataEntryController. O DataSource do DAOManager tambem e afectado.

Specified by:
setDataSource in interface SwingDataEntryController
Parameters:
dataSource - New value of property _dataSource.

addDataEntry

public void addDataEntry(DataEntry dataEntry,
                         javax.swing.JComponent component)
Adiciona um DataEntry a ser controlado por esta classe. A entrada de dados adicionada e a que fica selecionada.

Specified by:
addDataEntry in interface SwingDataEntryController
Parameters:
dataEntry - O DataEntry
component - Container onde devera ser apresentada a entrada de dados.

setSplash

public void setSplash(Splash splash)
Adiciona uma janela de splash onde devera aparecer o progresso da inicializacao do DataEntryController. Se o parametro passado for diferente de null, a janela de splash fica automaticamente activada.

Specified by:
setSplash in interface SwingDataEntryController
Parameters:
splash - A janela de splash.

setShowSplash

public void setShowSplash(boolean showSplash)
Setter for property showSplash.

Specified by:
setShowSplash in interface SwingDataEntryController
Parameters:
showSplash - New value of property showSplash.

setTabbedPane

public void setTabbedPane(javax.swing.JTabbedPane tabbedPane)
Afecta o TabbedPane usado pelo DataEntryController. O TabbedPane e inicializado atraves do metodo initTabbedPane().

Specified by:
setTabbedPane in interface SwingDataEntryController
Parameters:
tabbedPane - New value of property tabbedPane.

setToolBar

public void setToolBar(NavigationToolBar toolBar)
Afecta a toolbar usada pelo DataEntryController. A toolbar será inicializada atraves do metodo initToolBar().

Specified by:
setToolBar in interface SwingDataEntryController
Parameters:
toolBar - New value of property toolBar.

setStatusBar

public void setStatusBar(StatusBar statusBar)
Setter for property statusBar.

Specified by:
setStatusBar in interface SwingDataEntryController
Parameters:
statusBar - New value of property statusBar.

setProgressBarSize

public void setProgressBarSize(int progressBarSize)
Altera o valor que pode ser incrementado pelo DataEntryController na barra de progresso.

Specified by:
setProgressBarSize in interface SwingDataEntryController
Parameters:
progressBarSize - Valor que pode ser incrementado.

cleanUp

public void cleanUp()
Clean up the GenericSwingDataEntryController, removing all listeners added to other objects. This operation is necessary for making this object free of references so the GC can collect it.

Specified by:
cleanUp in interface SwingDataEntryController

getCurrentDataEntry

public DataEntry getCurrentDataEntry()
Getter for property currentDataEntry.

Specified by:
getCurrentDataEntry in interface SwingDataEntryController
Returns:
Value of property currentDataEntry.

setCurrentDataEntry

public void setCurrentDataEntry(DataEntry currentDataEntry)
Setter for property currentDataEntry.

Specified by:
setCurrentDataEntry in interface SwingDataEntryController
Parameters:
currentDataEntry - New value of property currentDataEntry.