logbook.storage.utils
Class LogBookController

java.lang.Object
  extended by logbook.storage.utils.LogBookController

public class LogBookController
extends java.lang.Object

Probably the most important object in the whole app. Definitely the most important controller object. This is the MASTER Controller!! Through this class, you can get to pretty much any other class in the application that you want to


Method Summary
 void addLogBookRec(LogBookRecord pRec)
          Adds a logbook record to the database and updates the application views
 void configureItemsRequiringRowSelection()
          look at each table in the display
 void deleteLogBookRec(int pLogBkRecIndex)
          NOTE: THIS WILL BREAK ONCE YOU START SORTING THE TABLE VIEW ON DIFFERENCT COLUMNS!! TODO: PASS IN THE RECORD AS A PARAM LIKE editLogBookRec() is doing!! so you can get the primary key!!
 void editLogBookRec(LogBookRecord pRec)
          Edits a logbook record in the database and updates the applications views
static LogBookController getInstance()
          Singleton global access point
 LogBook getLogBook()
          Gets the users current/active logbook
 LgBkRecordsTable getTableDisplay()
          Deprecated.  
 boolean hasUnsavedChanges()
          Returns true if the current, active logbook has unsaved changes
static void setHasUnsavedChanges(boolean pHasUnsavedChanges)
          Sets true or false if the current active logbook has unsaved changes NOTE: to keep stuff simple -- you should only set a file dirty whenever RECORDS RECORDS RECORDS!!!! are added, updated or deleted --> So don't set a file dirty when creating, closing or importing a logbook The file should only be set clean whenever the logbook is saved and whenever a logbook is created, edited, closed or imported (all covered by the setLogbook() method
 void setLogBook(LogBook pLogBk)
          Sets the current logbook and updates application views TIP: pass in null to "close" a logbook TIP: pass in "new Logbook()" to create a logbook Useful when loading(deserializing) a .lbk file or when parsing in a .csv file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LogBookController getInstance()
Singleton global access point

Returns:

getTableDisplay

public LgBkRecordsTable getTableDisplay()
Deprecated. 

Quit getting the table like this!

Returns:

configureItemsRequiringRowSelection

public void configureItemsRequiringRowSelection()
look at each table in the display


setLogBook

public void setLogBook(LogBook pLogBk)
Sets the current logbook and updates application views TIP: pass in null to "close" a logbook TIP: pass in "new Logbook()" to create a logbook Useful when loading(deserializing) a .lbk file or when parsing in a .csv file.

Parameters:
pLogBk - The LogBook to set active

getLogBook

public LogBook getLogBook()
Gets the users current/active logbook


addLogBookRec

public void addLogBookRec(LogBookRecord pRec)
                   throws java.io.IOException
Adds a logbook record to the database and updates the application views

Parameters:
pRec - The record to add TODO create a LogBook.add(LgBkRec) method and do that first then refresh views, then update the db in a worker thread
Throws:
java.io.IOException

editLogBookRec

public void editLogBookRec(LogBookRecord pRec)
Edits a logbook record in the database and updates the applications views

Parameters:
pRec - The record to edit

deleteLogBookRec

public void deleteLogBookRec(int pLogBkRecIndex)
NOTE: THIS WILL BREAK ONCE YOU START SORTING THE TABLE VIEW ON DIFFERENCT COLUMNS!! TODO: PASS IN THE RECORD AS A PARAM LIKE editLogBookRec() is doing!! so you can get the primary key!!

Parameters:
pLogBkRecIndex - The record to delete

hasUnsavedChanges

public boolean hasUnsavedChanges()
Returns true if the current, active logbook has unsaved changes

Returns:
true if the current, active logbook has unsaved changes

setHasUnsavedChanges

public static void setHasUnsavedChanges(boolean pHasUnsavedChanges)
Sets true or false if the current active logbook has unsaved changes NOTE: to keep stuff simple -- you should only set a file dirty whenever RECORDS RECORDS RECORDS!!!! are added, updated or deleted --> So don't set a file dirty when creating, closing or importing a logbook The file should only be set clean whenever the logbook is saved and whenever a logbook is created, edited, closed or imported (all covered by the setLogbook() method



Copyright © Chris Riffle - GNU Public Licence