Database Reference
In-Depth Information
There is much more information that can be obtained from the gridview. For exam-
ple, instead of using the IEssGridView.getValue method, if you use the IEssGridView.
getCellType method, the output looks like this:
text
member
member
member
text
text
member
member
member
member
member
Data
Data
Data
Data
In other words, in addition to providing just the member names and data values in
the cells, the Java API also can tell you if a given cell contains a member, data, or if it is
text. technically, the IEssGridView.getCellType method returns an IEssCell.EEssCellType
object that has both cell type names, as shown above, and an integer value. The integer
value is useful in Java for conditionally executing code using a switch statement, which,
in Java versions prior to version 7, requires an integer for condition evaluation. If you
change the IEssGridView.getValue method to instead call the IEssGridView.getCellType.
intVa lu e method, the output changes once again to show the integer representations of
the cell types.
2
0
0
0
2
2
0
0
0
0
0
1
1
1
1
Integer values like these are normally supported by constants whose names are indic-
ative of the type. The values of the cell types are shown in table 8.2.
If you are using the integer values in your code, you should not. Instead, always use
the named constants both to clarify the meaning of your code and to assure that any
future changes to the values will be automatically detected by your code.
Another interesting piece of information you can get from the grid is the cell con-
tent type. he IEssGridView.getCellContentType method returns an integer which cor-
responds to the following constant values (table 8.3).
If you change the code to print the value of IEssGridView.getCellContentType instead
of the value of IEssGridView.getValue , the output changes once again.
4
10
10
10
4
4
10
10
10
10
10
3
3
3
3
up to this point in our look at the Java API, you could easily see how the API related
to what you are able to see in the classic Excel and Smart view add-ins. This is the
first place where you can see a real difference between the level of information available
Table 8.2 Cell Type Named Constants
IEssCell.EEssCellType Constant
Va l u e
mEmBEr_Int_vALuE
0
DAtA_Int_vALuE
1
tExt_Int_vALuE
2
mEmBErwkEy_Int_vALuE
3
 
Search WWH ::




Custom Search