|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.jga.swing.spreadsheet.Controller
public class Controller
Provides for generally common operations on a spreadsheet when it is in an application.
Copyright © 2004-2005 David A. Hall
Field Summary | |
---|---|
static int |
CANCEL_OPTION
|
static int |
NO_OPTION
|
static int |
YES_OPTION
|
Constructor Summary | |
---|---|
Controller(Spreadsheet sheet)
Builds a Controller to control the given sheet widget. |
Method Summary | |
---|---|
int |
confirm(java.lang.String msg,
java.lang.String title)
Asks the user a Yes/No/Cancel question. |
javax.swing.Action |
getCellEditorCmd()
Returns an Action that changes the type of the current cell. |
javax.swing.Action |
getCellFormatCmd()
Returns an Action that reformats the current cell. |
javax.swing.Action |
getCellRenameCmd()
Returns an Action that renames the current cell. |
javax.swing.Action |
getCellRendererCmd()
Returns an Action that changes the type of the current cell. |
javax.swing.Action |
getCellTypeCmd()
Returns an Action that changes the type of the current cell. |
javax.swing.Action |
getCellValidatorCmd()
Returns an Action that changes the type of the current cell. |
javax.swing.Action |
getDefaultEditableCmd()
Returns an Action that changes the default cell format. |
javax.swing.Action |
getDefaultEditorCmd()
Returns an Action that changes the default cell editor. |
javax.swing.Action |
getDefaultFormatCmd()
Returns an Action that changes the default cell format. |
javax.swing.Action |
getDefaultRendererCmd()
Returns an Action that changes the default cell renderer. |
javax.swing.Action |
getDefaultTypeCmd()
Returns an Action that changes the default cell type. |
javax.swing.Action |
getDefaultValueCmd()
Returns an Action that changes the default cell type. |
javax.swing.Action |
getFileNewCmd()
Returns an Action that resets the spreadsheet to default state. |
javax.swing.Action |
getFileOpenCmd()
Returns an Action that sets the spreadsheet to the contents of a file. |
javax.swing.Action |
getFileSaveAsCmd()
Returns an Action that saves the spreadsheet to a file. |
javax.swing.Action |
getFileSaveCmd()
Returns an Action that saves the spreadsheet to the file from whence it came. |
javax.swing.Action |
getImportClassCmd()
Returns an Action that allows the user to import a class. |
javax.swing.Action |
getSheetColumnsCmd()
Returns an Action that resizes the worksheet. |
javax.swing.Action |
getSheetRowsCmd()
Returns an Action that resizes the worksheet. |
java.net.URL |
getSheetSource()
|
boolean |
isSheetDirty()
|
int |
loadSheet(Spreadsheet sheet)
Loads a spreadsheet |
void |
newWorksheet()
Creates a new, empty spreadsheet with default settings. |
void |
notify(java.lang.String msg,
java.lang.String title)
Displays an error message to the user |
int |
openFile()
Prompts the user for a file to open, and sets the spreadsheet to the file's contents. |
java.lang.String |
prompt(java.lang.String msg,
java.lang.String val)
Prompts the user for a string value. |
int |
promptAndSave()
Prompts the user using a supplied functor, and returns one of YES, NO, or CANCEL |
int |
saveFile()
|
int |
saveFileAs()
|
int |
saveSheet(Spreadsheet sheet,
boolean prompt)
Saves a spreadsheet |
void |
setCellName(int row,
int col)
Prompts the user for the name of the designated cell. |
void |
setColumnCount()
Prompts the user for the number of columns |
void |
setConfirmFunctor(BinaryFunctor<java.lang.String,java.lang.String,java.lang.Integer> fn)
Sets the functor used to ask the user a yes/no/cancel question |
void |
setDefaultType()
Prompts the user for the cell type. |
void |
setDefaultValue()
Prompts the user for the default cell value. |
void |
setErrorFunctor(BinaryFunctor<java.lang.String,java.lang.String,?> fn)
Sets the functor used to display an error message. |
void |
setLoadFunctor(UnaryFunctor<Spreadsheet,java.lang.Integer> fn)
Sets the functor used to get an output stream |
void |
setPromptFunctor(BinaryFunctor<java.lang.String,java.lang.String,java.lang.String> fn)
Sets the functor used to prompt the user for simple information. |
void |
setRowCount()
Prompts the user for the number of rows |
void |
setSaveFunctor(BinaryFunctor<Spreadsheet,java.lang.Boolean,java.lang.Integer> fn)
Sets the functor used to get an output stream |
void |
setSheetDirty(boolean flag)
|
void |
setSheetSource(java.net.URL url)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int YES_OPTION
public static final int NO_OPTION
public static final int CANCEL_OPTION
Constructor Detail |
---|
public Controller(Spreadsheet sheet)
Method Detail |
---|
public java.lang.String prompt(java.lang.String msg, java.lang.String val)
msg
- the description of the string to be shown to the userval
- the default or existing value of the stringpublic void setPromptFunctor(BinaryFunctor<java.lang.String,java.lang.String,java.lang.String> fn)
public int confirm(java.lang.String msg, java.lang.String title)
public void setConfirmFunctor(BinaryFunctor<java.lang.String,java.lang.String,java.lang.Integer> fn)
public void notify(java.lang.String msg, java.lang.String title)
public void setErrorFunctor(BinaryFunctor<java.lang.String,java.lang.String,?> fn)
public int loadSheet(Spreadsheet sheet)
public void setLoadFunctor(UnaryFunctor<Spreadsheet,java.lang.Integer> fn)
public int saveSheet(Spreadsheet sheet, boolean prompt)
public void setSaveFunctor(BinaryFunctor<Spreadsheet,java.lang.Boolean,java.lang.Integer> fn)
public javax.swing.Action getFileNewCmd()
public javax.swing.Action getFileOpenCmd()
public javax.swing.Action getFileSaveCmd()
public javax.swing.Action getFileSaveAsCmd()
public javax.swing.Action getDefaultEditableCmd()
public javax.swing.Action getDefaultTypeCmd()
public javax.swing.Action getDefaultValueCmd()
public javax.swing.Action getDefaultFormatCmd()
public javax.swing.Action getDefaultRendererCmd()
public javax.swing.Action getDefaultEditorCmd()
public javax.swing.Action getSheetColumnsCmd()
public javax.swing.Action getSheetRowsCmd()
public javax.swing.Action getImportClassCmd()
public javax.swing.Action getCellRenameCmd()
public javax.swing.Action getCellFormatCmd()
public javax.swing.Action getCellTypeCmd()
public javax.swing.Action getCellRendererCmd()
public javax.swing.Action getCellEditorCmd()
public javax.swing.Action getCellValidatorCmd()
public void setDefaultType()
public void setColumnCount()
public void setRowCount()
public void setDefaultValue()
public void setCellName(int row, int col)
public void newWorksheet()
public int openFile()
public int saveFile()
public int saveFileAs()
public int promptAndSave()
public boolean isSheetDirty()
public void setSheetDirty(boolean flag)
public java.net.URL getSheetSource()
public void setSheetSource(java.net.URL url)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |