public class UIController extends Object implements SpreadsheetAppListener
Modifier and Type | Class and Description |
---|---|
static class |
UIController.EventDispatcher
A utility for dispatching events on the AWT event dispatching thread.
|
Constructor and Description |
---|
UIController(CleanSheets app)
Creates a new user interface controller.
|
Modifier and Type | Method and Description |
---|---|
void |
addEditListener(EditListener listener)
Registers the given listener on the user interface controller.
|
void |
addSelectionListener(SelectionListener listener)
Registers the given listener on the user interface controller.
|
Cell |
getActiveCell()
Returns the active cell of the active workbook's active spreadsheet.
|
Spreadsheet |
getActiveSpreadsheet()
Returns the active spreadsheet.
|
Workbook |
getActiveWorkbook()
Returns the active workbook.
|
TransferHandler |
getCellTransferHandler()
Returns the transfer haandler used to transfer ranges of cells.
|
UIExtension[] |
getExtensions()
Returns the user interface extensions that have been loaded.
|
Properties |
getUserProperties()
Returns the current user properties.
|
boolean |
isActiveWorkbookModified()
Returns whether the active workbook has been modified.
|
boolean |
isWorkbookModified(Workbook workbook)
Returns whether the given workbook has been modified.
|
void |
removeEditListener(EditListener listener)
Removes the given listener from the user interface controller.
|
void |
removeSelectionListener(SelectionListener listener)
Removes the given listener from the user interface controller.
|
void |
setActiveCell(Cell cell)
Sets the active cell of the application, and thereby also the active
spreadsheet and workbook.
|
void |
setActiveSpreadsheet(Spreadsheet spreadsheet)
Sets the active spreadsheet of the application, and thereby also the
active workbook.
|
void |
setActiveWorkbook(Workbook workbook)
Sets the given workbook of the application.
|
void |
setWorkbookModified(Workbook workbook)
Specifies whether the given workbook has been modified.
|
void |
workbookCreated(SpreadsheetAppEvent event)
Invoked by the spreadsheet application to indicate that a new workbook
has been created.
|
void |
workbookLoaded(SpreadsheetAppEvent event)
Invoked by the spreadsheet application to indicate that a workbook
has been loaded from the given file.
|
void |
workbookSaved(SpreadsheetAppEvent event)
Invoked by the spreadsheet application to indicate that a workbook
was saved to the given file.
|
void |
workbookUnloaded(SpreadsheetAppEvent event)
Invoked by the spreadsheet application to indicate that a workbook
has been unloaded (closed).
|
public UIController(CleanSheets app)
app
- the CleanSheets applicationpublic Workbook getActiveWorkbook()
public void setActiveWorkbook(Workbook workbook)
workbook
- the workbook to usepublic Spreadsheet getActiveSpreadsheet()
public void setActiveSpreadsheet(Spreadsheet spreadsheet)
spreadsheet
- the spreadsheet to usepublic Cell getActiveCell()
public void setActiveCell(Cell cell)
cell
- the cell to usepublic boolean isActiveWorkbookModified()
public boolean isWorkbookModified(Workbook workbook)
public void setWorkbookModified(Workbook workbook)
workbook
- the relevant workbookpublic TransferHandler getCellTransferHandler()
public Properties getUserProperties()
public UIExtension[] getExtensions()
public void workbookCreated(SpreadsheetAppEvent event)
SpreadsheetAppListener
workbookCreated
in interface SpreadsheetAppListener
event
- the spreadsheet application event that occuredpublic void workbookLoaded(SpreadsheetAppEvent event)
SpreadsheetAppListener
workbookLoaded
in interface SpreadsheetAppListener
event
- the spreadsheet application event that occuredpublic void workbookUnloaded(SpreadsheetAppEvent event)
SpreadsheetAppListener
workbookUnloaded
in interface SpreadsheetAppListener
event
- the spreadsheet application event that occuredpublic void workbookSaved(SpreadsheetAppEvent event)
SpreadsheetAppListener
workbookSaved
in interface SpreadsheetAppListener
event
- the spreadsheet application event that occuredpublic void addSelectionListener(SelectionListener listener)
listener
- the listener to be addedpublic void removeSelectionListener(SelectionListener listener)
listener
- the listener to be removedpublic void addEditListener(EditListener listener)
listener
- the listener to be addedpublic void removeEditListener(EditListener listener)
listener
- the listener to be removed