|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.TableColumn com.jidesoft.grid.AbstractCalculatedColumn com.jidesoft.grid.ExpressionCalculatedColumn
public class ExpressionCalculatedColumn
ExpressionCalculatedColumn is a special CalculatedColumn
that can accept a string as
expression. For example, if your table model has a Quality column and an UnitPrice column, you can write an
expression string like "[Quality] * [UnitPrice]" to calculate for this Sales column using
ExpressionCalculatedColumn
.
setDependingColumns(int[])
to set it. By doing this, the expression calculation method will not look at other
columns.
For details of the expression grammar, please refer to JIDE Pivot Grids Developer Guide "Expression For
ExpressionCalculatedColumn" section.
For ExpressionCalculatedColumn, we have to get some related information from the depending columns.
So please make sure the table model you passed in as a parameter has the information of the depending columns.
Field Summary | |
---|---|
List<String> |
_dependingColumnNames
|
Fields inherited from class javax.swing.table.TableColumn |
---|
CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, COLUMN_WIDTH_PROPERTY, HEADER_RENDERER_PROPERTY, HEADER_VALUE_PROPERTY, headerRenderer, headerValue, identifier, isResizable, maxWidth, minWidth, modelIndex, resizedPostingDisableCount, width |
Constructor Summary | |
---|---|
ExpressionCalculatedColumn(TableModel model,
String expressionString)
|
|
ExpressionCalculatedColumn(TableModel model,
String newColumnName,
String expressionString)
|
Method Summary | |
---|---|
int[] |
getDependingColumns()
Gets the depending columns. |
String |
getExpressionString()
Gets the expression string. |
Object |
getValueAt(int rowIndex)
Gets the value at the cell of the row index. |
void |
setDependingColumns(int[] columns)
Sets the depending columns. |
void |
setExpressionString(String expressionString)
Sets the expression string. |
Methods inherited from class com.jidesoft.grid.AbstractCalculatedColumn |
---|
getActualModel, getColumnClass, getColumnIdentifier, getColumnName, getConverterContext, getEditorContext, getGroupValue, getObjectGrouper, setColumnClass, setColumnName, setConverterContext, setEditorContext, setObjectGrouper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public List<String> _dependingColumnNames
Constructor Detail |
---|
public ExpressionCalculatedColumn(TableModel model, String expressionString) throws IllegalArgumentException
IllegalArgumentException
public ExpressionCalculatedColumn(TableModel model, String newColumnName, String expressionString) throws IllegalArgumentException
IllegalArgumentException
Method Detail |
---|
public String getExpressionString()
public void setExpressionString(String expressionString) throws IllegalArgumentException
expressionString
- the new expression string.
IllegalArgumentException
- if the expressionString is not a valid expression.public Object getValueAt(int rowIndex)
CalculatedColumn
public void setDependingColumns(int[] columns)
columns
- the column int array that this column's expression is referring to.public int[] getDependingColumns()
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |