com.f1j.ss.datarange
Interface DataRangeModel


public interface DataRangeModel
extends Lockable

This interface defines the common DataRange API.


Method Summary
 DataRange applyDataRangeDef(DataRangeDef definition)
          Creates a new DataRange using the supplied definition, or modifies the currently selected DataRange.
 DataRange createDataRange(int sheet, int row1, int col1, int row2, int col2, DataQuery query)
          Creates a DataRange at the specified location using the specified query.
 DataRange getActiveDataRange()
          Returns the currently selected DataRange.
 DataRangeDef getDataRangeDef()
          Returns the definition for the currently selected DataRange.
 Range getSelectedRange()
          Returns a Range object that represents the the current selection.
 Range getSelectedRange(Range dst)
          Returns a Range object that represents the the current selection.
 void startSectionEdit(boolean rowSection)
          Begins edit mode for the selected section.
 boolean stopSectionEditing(boolean applyCurrent)
          Stops any current editing of a section.
 
Methods inherited from interface com.f1j.util.Lockable
getLock, releaseLock
 

Method Detail

applyDataRangeDef

public DataRange applyDataRangeDef(DataRangeDef definition)
                            throws F1Exception
Creates a new DataRange using the supplied definition, or modifies the currently selected DataRange.
Parameters:
definition - The definition that should be applied to the current DataRange. If a DataRange is not currently selected, then a new one is created.
Returns:
The DataRange that was created or modified.
Throws:
F1Exception -

If DataRange with this name exists.

If name is invalid.

If definition is invalid.

Since:
12.0
See Also:
DataRange, DataRangeDef

createDataRange

public DataRange createDataRange(int sheet,
                                 int row1,
                                 int col1,
                                 int row2,
                                 int col2,
                                 DataQuery query)
                          throws F1Exception
Creates a DataRange at the specified location using the specified query.
Parameters:
sheet - The sheet where the DataRange should be created.
row1 - The row where the DataRange should start.
col1 - The column where the DataRange should start.
row2 - The row where the DataRange should end.
col2 - The column where the DataRange should end.
query - The query to use as the default data source for the DataRange.
Returns:
The DataRange that was created.
Throws:
F1Exception - if data is invalid.
Since:
12.0
See Also:
DataRange

getActiveDataRange

public DataRange getActiveDataRange()
Returns the currently selected DataRange.
Returns:
The currently selected DataRange
Since:
12.0
See Also:
DataRange

getDataRangeDef

public DataRangeDef getDataRangeDef()
Returns the definition for the currently selected DataRange. If a DataRange is not currently selected, then a default definition is returned so a new DataRange may be created.
Returns:
The definition for the currently selected DataRange or a default definition for a new DataRange.
Since:
12.0
See Also:
DataRange, DataRangeDef

getSelectedRange

public Range getSelectedRange()
Returns a Range object that represents the the current selection.
Returns:
a Range object.
Since:
12.0
See Also:
Range

getSelectedRange

public Range getSelectedRange(Range dst)
Returns a Range object that represents the the current selection.
Parameters:
dst - A Range object in which to place the selection.
Returns:
A reference to dst. If dst is null, a reference to a newly allocated Range object.
Since:
12.0
See Also:
Range

startSectionEdit

public void startSectionEdit(boolean rowSection)
                      throws SelectionException
Begins edit mode for the selected section.
Parameters:
rowSection - If true, edits the row section script; if false, edits the column section script.
Throws:
SelectionException - if section editing is not possible for the current selection.
Since:
12.0

stopSectionEditing

public boolean stopSectionEditing(boolean applyCurrent)
Stops any current editing of a section.
Parameters:
applyCurrent - True if the current contents of the edit should be applied.
Returns:
true if stopping the edit was successful.
Since:
12.0