org.apache.poi.hssf.usermodel.HSSFWorkbook.getActiveSheetIndex()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(123)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFWorkbook.getActiveSheetIndex()方法的一些代码示例,展示了HSSFWorkbook.getActiveSheetIndex()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFWorkbook.getActiveSheetIndex()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFWorkbook
类名称:HSSFWorkbook
方法名:getActiveSheetIndex

HSSFWorkbook.getActiveSheetIndex介绍

[英]gets the tab whose data is actually seen when the sheet is opened. This may be different from the "selected sheet" since excel seems to allow you to show the data of one sheet when another is seen "selected" in the tabs (at the bottom).
[中]

代码示例

代码示例来源:origin: org.apache.poi/poi

  1. private void updateActiveSheetAfterSheetReorder(int oldIndex, int newIndex) {
  2. // adjust active sheet if necessary
  3. int active = getActiveSheetIndex();
  4. if(active == oldIndex) {
  5. // moved sheet was the active one
  6. setActiveSheet(newIndex);
  7. } else if ((active < oldIndex && active < newIndex) ||
  8. (active > oldIndex && active > newIndex)) {
  9. // not affected
  10. } else if (newIndex > oldIndex) {
  11. // moved sheet was below before and is above now => active is one less
  12. setActiveSheet(active-1);
  13. } else {
  14. // remaining case: moved sheet was higher than active before and is lower now => active is one more
  15. setActiveSheet(active+1);
  16. }
  17. }

代码示例来源:origin: org.apache.poi/poi

  1. int active = getActiveSheetIndex();
  2. if(active == index) {

代码示例来源:origin: com.haulmont.thirdparty/poi

  1. /**
  2. * deprecated May 2008
  3. * @deprecated - Misleading name - use getActiveSheetIndex()
  4. */
  5. public short getSelectedTab() {
  6. return (short) getActiveSheetIndex();
  7. }

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

  1. /**
  2. * deprecated May 2008
  3. * @deprecated - Misleading name - use getActiveSheetIndex()
  4. */
  5. public short getSelectedTab() {
  6. return (short) getActiveSheetIndex();
  7. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. private void updateActiveSheetAfterSheetReorder(int oldIndex, int newIndex) {
  2. // adjust active sheet if necessary
  3. int active = getActiveSheetIndex();
  4. if(active == oldIndex) {
  5. // moved sheet was the active one
  6. setActiveSheet(newIndex);
  7. } else if ((active < oldIndex && active < newIndex) ||
  8. (active > oldIndex && active > newIndex)) {
  9. // not affected
  10. } else if (newIndex > oldIndex) {
  11. // moved sheet was below before and is above now => active is one less
  12. setActiveSheet(active-1);
  13. } else {
  14. // remaining case: moved sheet was higher than active before and is lower now => active is one more
  15. setActiveSheet(active+1);
  16. }
  17. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. int active = getActiveSheetIndex();
  2. if(active == index) {

相关文章

HSSFWorkbook类方法