1 package org.simantics.spreadsheet.solver;
3 import java.util.Collections;
6 import org.simantics.databoard.binding.mutable.Variant;
8 @SuppressWarnings("rawtypes")
9 public class SpreadsheetCellEditable implements SheetNode {
11 private static final long serialVersionUID = -5078387091775971986L;
13 public final SpreadsheetCell cell;
15 public SpreadsheetCellEditable(SpreadsheetCell spreadsheetCell) {
16 this.cell = spreadsheetCell;
20 public String getName() {
25 public Map getChildren() {
26 return Collections.emptyMap();
30 public Map getProperties() {
31 return Collections.emptyMap();
35 public int hashCode() {
38 result = prime * result + ((cell == null) ? 0 : cell.hashCode());
43 public boolean equals(Object obj) {
48 if (getClass() != obj.getClass())
50 SpreadsheetCellEditable other = (SpreadsheetCellEditable) obj;
52 if (other.cell != null)
54 } else if (!cell.equals(other.cell))
59 public boolean editable() {
60 if (cell.getContent() == null || cell.getContent() instanceof SpreadsheetFormula || cell.getContent() instanceof SpreadsheetSCLConstant)
62 if (cell.getContent() instanceof String) {
63 String content = (String) cell.getContent();
64 if (content.isEmpty())
67 if (cell.getContent() instanceof Variant) {
68 Variant content = (Variant) cell.getContent();
69 if (content.getValue() == null)
71 if (content.getValue() instanceof String) {
72 String actualContent = (String) content.getValue();
73 if (actualContent.isEmpty())
77 // System.out.println("content is " + cell.content);