public boolean updateLevel() { if (levelBox.getValue() != null && levelBox.getValue() != structure.getLevel()) { structure.setLevel(levelBox.getValue()); tile.setLevel(structure.getLevel()); return true; } return false; }
public void show(Tile tile) { if (tile.getStructure() != null && tile.getStructure() instanceof HasLevel) { this.tile = tile; this.structure = (HasLevel) tile.getStructure(); this.setPopupPosition(tile.getAbsoluteLeft(), tile.getAbsoluteTop()); levelBox.setValue(structure.getLevel()); this.show(); levelBox.setFocus(true); levelBox.selectAll(); } }