java.lang.Object | +--com.ibm.lab.soln.editor.core.MiniSpreadsheet
Simple model for a "mini-spreadsheet" containing text/integer cell values.
MiniSpreadsheetRow,
IMiniSpreadsheetListener| Field Summary | |
static int |
DEFAULT_COLUMN_COUNT
|
static int |
DEFAULT_ROW_COUNT
|
static int |
MAX_COLUMN_COUNT
|
| Constructor Summary | |
MiniSpreadsheet(java.io.InputStream is)
Set the rows based on the content of the provided semi-colon delimited input stream. |
|
MiniSpreadsheet(int rowCount,
int columnCount)
Return a mini-spreadsheet having dimensions [rows,columns]. |
|
| Method Summary | |
void |
addMiniSpreadsheetListener(IMiniSpreadsheetListener listener)
Add the listener. |
void |
appendRow()
Insert a new row at the end. |
void |
clearAll()
Set all rows/columns to an empty string. |
protected void |
fireCellChanged(int row,
int column,
java.lang.String value)
|
int |
getColumnCount()
Returns the number of columns. |
int |
getInt(int row,
int column)
Get the value at [row,column] as an integer or zero if not a value integer format. |
int |
getRowCount()
Return the number of rows. |
MiniSpreadsheetRow[] |
getRows()
Return the rows. |
java.lang.String |
getString(int row,
int column)
Get the value at [row,column] as a string. |
int |
getTotal()
Return the total of all integer cells. |
void |
load(java.io.InputStream is)
Set the rows based on the content of the provided semi-colon delimited input stream. |
void |
removeMiniSpreadsheetListener(IMiniSpreadsheetListener listener)
Remove the listener. |
protected void |
removeRow(MiniSpreadsheetRow msr)
|
void |
save(org.eclipse.core.resources.IFile file)
Save the current contents in a semi-colon delimited text file. |
void |
setData(int row,
int column,
java.lang.String newValue)
Set the value at [row,column] to a string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_COLUMN_COUNT
public static final int DEFAULT_ROW_COUNT
public static final int MAX_COLUMN_COUNT
| Constructor Detail |
public MiniSpreadsheet(java.io.InputStream is)
throws org.eclipse.core.runtime.CoreException
public MiniSpreadsheet(int rowCount,
int columnCount)
| Method Detail |
public void addMiniSpreadsheetListener(IMiniSpreadsheetListener listener)
IMiniSpreadsheetListenerpublic void appendRow()
public void clearAll()
protected void fireCellChanged(int row,
int column,
java.lang.String value)
public int getColumnCount()
public int getInt(int row,
int column)
public int getRowCount()
public MiniSpreadsheetRow[] getRows()
public java.lang.String getString(int row,
int column)
public int getTotal()
public void load(java.io.InputStream is)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreExceptionpublic void removeMiniSpreadsheetListener(IMiniSpreadsheetListener listener)
IMiniSpreadsheetListenerprotected void removeRow(MiniSpreadsheetRow msr)
public void save(org.eclipse.core.resources.IFile file)
throws org.eclipse.core.runtime.CoreException
org.eclipse.core.runtime.CoreException
public void setData(int row,
int column,
java.lang.String newValue)