public enum RangeIndexingMode extends Enum<RangeIndexingMode>
CellRange
.
Following code creates horizontal, vertical and rectangular cell ranges and demonstrates how indexing works different in different context.
CellBorder.setBorders
method is used to mark outside borders of the rectangular range.
CellRange cr = excelFile.getWorksheet(0).getRow(1).getCells();
cr.get(0).setValue(cr.getIndexingMode());
cr.get(3).setValue("D2");
cr.get("B").setValue("B2");
cr = excelFile.getWorksheet(0).getColumn(4).getCells();
cr.get(0).setValue(cr.getIndexingMode());
cr.get(2).setValue("E3");
cr.get("5").setValue("E5");
cr = excelFile.getWorksheet(0).getCells().getSubrange("F2", "J8");
cr.getStyle().getBorders().setBorders(MultipleBorders.outside(), SpreadsheetColor.fromName(ColorName.BLUE), LineStyle.DASHED);
cr.get("I7").setValue(cr.getIndexingMode());
cr.get(0, 0).setValue("F2");
cr.get("G3").setValue("G3");
cr.get(5).setValue("F3"); // Cell range width is 5 (F G H I J).
cr = excelFile.getWorksheet(0).getCells().getSubrange("F10:J16"); // Using A1 notation.
cr.getStyle().getBorders().setBorders(MultipleBorders.outside(), SpreadsheetColor.fromName(ColorName.BLUE), LineStyle.DASHED);
cr.get("I15").setValue(cr.getIndexingMode());
cr.get(0).setValue("F10");
cr.get("F11").setValue("F11");
CellRange.getIndexingMode()
Enum Constant and Description |
---|
HORIZONTAL
Horizontal indexing mode.
|
RECTANGULAR
Rectangular indexing mode.
|
VERTICAL
Vertical indexing mode.
|
Modifier and Type | Method and Description |
---|---|
static RangeIndexingMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RangeIndexingMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RangeIndexingMode HORIZONTAL
CellRange height
equal to 1.public static final RangeIndexingMode RECTANGULAR
public static final RangeIndexingMode VERTICAL
CellRange. width
equal to 1.public static RangeIndexingMode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static RangeIndexingMode[] values()
for (RangeIndexingMode c : RangeIndexingMode.values()) System.out.println(c);
© GemBox d.o.o. — All rights reserved.