1 package org.simantics.spreadsheet.graph;
3 import java.util.Collections;
6 import org.simantics.databoard.binding.mutable.Variant;
8 public class SpreadsheetCellEditable implements SheetNode {
10 public final SpreadsheetCell cell;
12 public SpreadsheetCellEditable(SpreadsheetCell spreadsheetCell) {
13 this.cell = spreadsheetCell;
17 public String getName() {
22 public Map getChildren() {
23 return Collections.emptyMap();
27 public Map getProperties() {
28 return Collections.emptyMap();
32 public int hashCode() {
35 result = prime * result + ((cell == null) ? 0 : cell.hashCode());
40 public boolean equals(Object obj) {
45 if (getClass() != obj.getClass())
47 SpreadsheetCellEditable other = (SpreadsheetCellEditable) obj;
49 if (other.cell != null)
51 } else if (!cell.equals(other.cell))
56 public boolean editable() {
57 if (cell.content == null || cell.content instanceof SpreadsheetFormula || cell.content instanceof SpreadsheetSCLConstant)
59 if (cell.content instanceof String) {
60 String content = (String) cell.content;
61 if (content.isEmpty())
64 if (cell.content instanceof Variant) {
65 Variant content = (Variant) cell.content;
66 if (content.getValue() == null)
68 if (content.getValue() instanceof String) {
69 String actualContent = (String) content.getValue();
70 if (actualContent.isEmpty())
74 // System.out.println("content is " + cell.content);