Skip to main content

Метод Cell.isEmpty

Метод позволяет определить содержит ли ячейка данные или настройки форматирования.

Вызов​


public bool isEmpty()

Возвращает​

  • true, если ячейка не содержит данные или настройки форматирования, в ином случае – false.

Пример​


Table sheet = document.getBlocks().getTable(0);
Cell cell1 = sheet.getCell("A1");
Cell cell2 = sheet.getCell("A2");
Cell cell3 = sheet.getCell("A3");
cell1.setText("123");
cell2.setTextProperties(new TextProperties() { bold = true });

cell1.isEmpty(); // false
cell1.isContentEmpty(); // false

cell2.isEmpty(); // false
cell2.isContentEmpty(); // true

cell3.isEmpty(); // true
cell3.isContentEmpty(); // true