|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
com.sas.swing.models.OLAPTableModelAdapter
@SASScope(value="ALL") @SubjectToChange public class OLAPTableModelAdapter
The TableModelAdapter is an adapter to allow a com.sas.table.ResultSetInterface object to be used in a javax.swing.JTable object. Any object that implements the com.sas.table.ResultSetInterface can be set as the model for this adapter. The adapter extends from AbstractTableModel and can be set as the model for a JTable. The default model delegate used by this adapter is a com.sas.table.SimpleTable object. If the model implements the com.sas.collection.ContentsChangedSource interface, the adapter will add itself as a listener to the model for changes that occur on it. The adapter does not allow editing by default. This is because a remote SAS object connected to a shared dataset will throw exceptions if cells are locked by one user and another user attempts to edit the cells.
| Field Summary | |
|---|---|
protected int |
currentRowCount
|
protected boolean |
defaultModelAttached
|
protected OLAPDataSetInterface |
model
|
protected com.sas.beans.PropertyChangeSupport |
propertyChangeSupport
|
| Constructor Summary | |
|---|---|
OLAPTableModelAdapter()
Default constructor. |
|
OLAPTableModelAdapter(OLAPDataSetInterface table)
Constructor that sets the model of the adapter. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a PropertyChangeListener to the adapter. |
void |
contentsChanged(com.sas.collection.ContentsChangedEvent event)
ContentsChangedListener method to listen for events sent by the model and to refresh the row and column axis. |
protected void |
firePropertyChange(java.beans.PropertyChangeEvent evt)
Send a PropertyChangeEvent to any listeners added to the adapter. |
protected void |
firePropertyChange(java.lang.String propName,
java.lang.Object oldValue,
java.lang.Object newValue)
Send a PropertyChangeEvent to any listeners added to the adapter. |
void |
fireTableStructureChanged()
Overridden to recalculate the rowCount. |
AxisInterface |
getColumnAxis()
|
int |
getColumnCount()
Get the number of columns in the model. |
java.lang.String |
getColumnName(int columnIndex)
Get the column name for the specified column index. |
static com.sas.beans.ExtendedBeanInfo |
getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to
augment the automatically introspected information about this OLAPTableModelAdapter. |
OLAPDataSetInterface |
getModel()
Get the model used by the adapter. |
OLAPDataSetInterface |
getOLAPDataSetInterface()
Get the model used by the adapter. |
AxisInterface |
getRowAxis()
|
int |
getRowCount()
Get the known rowCount. |
java.lang.Object |
getRowLabel(int row)
|
java.lang.Object[] |
getRowLabels(int startIndex,
int count)
|
AxisInterface |
getSlicerAxis()
|
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Get the value at the specified row and column index. |
protected void |
initTable()
Initialize the tables internal fields. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Determine if the cell at the specified row and column is editable. |
boolean |
isDefaultModelAttached()
returns true is the component is using a default internal model. |
boolean |
isRowLabelsSupported()
|
boolean |
isRowsLabelSupported()
|
protected OLAPDataSetInterface |
newDefaultModel()
Create a new default model. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
|
protected void |
recalculateRowCount()
Recalculates the known rowCount. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a PropertyChangeListener from the adapter. |
protected void |
setDefaultModelAttached(boolean defaultModelUsed)
|
void |
setModel(OLAPDataSetInterface table)
Set the model used by the adapter to delegate all table calls. |
void |
setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
Set the value of the model at the specified row and column indices. |
| Field Detail |
|---|
protected boolean defaultModelAttached
protected com.sas.beans.PropertyChangeSupport propertyChangeSupport
protected OLAPDataSetInterface model
protected int currentRowCount
| Constructor Detail |
|---|
public OLAPTableModelAdapter()
public OLAPTableModelAdapter(OLAPDataSetInterface table)
table - the model used as a delegate for the adapter| Method Detail |
|---|
public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
com.sas.beans.Introspector to
augment the automatically introspected information about this OLAPTableModelAdapter.
protected void initTable()
protected OLAPDataSetInterface newDefaultModel()
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface com.sas.beans.PropertyChangeSourcelistener - the PropertyChangeListener to be notified when a PropertyChangeEvent occurspublic void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface com.sas.beans.PropertyChangeSourcelistener - the PropertyChangeListener to stop being notified when a PropertyChangeEvent occursprotected void firePropertyChange(java.beans.PropertyChangeEvent evt)
protected void firePropertyChange(java.lang.String propName,
java.lang.Object oldValue,
java.lang.Object newValue)
public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerpublic OLAPDataSetInterface getOLAPDataSetInterface()
getOLAPDataSetInterface in interface com.sas.swing.models.OLAPDataSetInterfaceProviderpublic OLAPDataSetInterface getModel()
public boolean isDefaultModelAttached()
ViewDefaultModel
isDefaultModelAttached in interface ViewDefaultModelprotected void setDefaultModelAttached(boolean defaultModelUsed)
public void setModel(OLAPDataSetInterface table)
public void contentsChanged(com.sas.collection.ContentsChangedEvent event)
contentsChanged in interface com.sas.collection.ContentsChangedListenerpublic int getColumnCount()
getColumnCount in interface javax.swing.table.TableModelpublic java.lang.String getColumnName(int columnIndex)
getColumnName in interface javax.swing.table.TableModelgetColumnName in class javax.swing.table.AbstractTableModelcolumnIndex - the index of the column to find the name for
public void fireTableStructureChanged()
fireTableStructureChanged in class javax.swing.table.AbstractTableModelpublic int getRowCount()
getRowCount in interface javax.swing.table.TableModelprotected void recalculateRowCount()
public java.lang.Object getValueAt(int rowIndex,
int columnIndex)
getValueAt in interface javax.swing.table.TableModel
public boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface javax.swing.table.TableModelisCellEditable in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object aValue,
int rowIndex,
int columnIndex)
setValueAt in interface javax.swing.table.TableModelsetValueAt in class javax.swing.table.AbstractTableModelpublic java.lang.Object getRowLabel(int row)
getRowLabel in interface com.sas.table.StaticRowLabelInterface
public java.lang.Object[] getRowLabels(int startIndex,
int count)
getRowLabels in interface com.sas.table.StaticRowLabelInterfacepublic boolean isRowLabelsSupported()
isRowLabelsSupported in interface com.sas.table.StaticRowLabelInterfacepublic boolean isRowsLabelSupported()
isRowsLabelSupported in interface com.sas.table.StaticRowLabelInterfacepublic AxisInterface getColumnAxis()
public AxisInterface getRowAxis()
public AxisInterface getSlicerAxis()
|
| Components |
|
| |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||