Skip to content

Commit

Permalink
reset on entity change.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsilaghi committed Sep 25, 2024
1 parent be89b6a commit 2c33c37
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public ConfigurableCheckbox(CheckBoxConfig checkBoxConfig, String initialValue)
presenter = new ConfigurableCheckBoxPresenter(new ConfigurableCheckBoxViewImpl());
presenter.start(container);


this.checkBoxConfig = checkBoxConfig;

presenter.setEnabled(checkBoxConfig.isEnabled());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,40 +207,45 @@ public void setTableCellChangedHandler(TableCellChangedHandler handler) {
@Override
public void setTableData(WhoficEntityPostCoordinationSpecification whoficSpecification) {

tableRows = new ArrayList<>();
initializeTableContent();

for (PostCoordinationTableRow row : this.tableRows) {
for (PostCoordinationTableCell cell : row.getCellList()) {

PostCoordinationSpecification specification = whoficSpecification.getPostCoordinationSpecifications().stream()
.filter(spec -> spec.getLinearizationView()
.equalsIgnoreCase(cell.getLinearizationDefinition().getWhoficEntityIri()))
.findFirst()
.orElse(null);

if (specification != null) {
if (specification.getAllowedAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("ALLOWED");
}

if (specification.getRequiredAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("REQUIRED");
}

if (specification.getNotAllowedAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("NOT_ALLOWED");
if (whoficSpecification.getPostCoordinationSpecifications().isEmpty()) {
tableRows = new ArrayList<>();
initializeTableContent();
} else {
for (PostCoordinationTableRow row : this.tableRows) {
for (PostCoordinationTableCell cell : row.getCellList()) {

PostCoordinationSpecification specification = whoficSpecification.getPostCoordinationSpecifications().stream()
.filter(spec -> spec.getLinearizationView()
.equalsIgnoreCase(cell.getLinearizationDefinition().getWhoficEntityIri()))
.findFirst()
.orElse(null);

if (specification != null) {
if (specification.getAllowedAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("ALLOWED");
}

if (specification.getRequiredAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("REQUIRED");
}

if (specification.getNotAllowedAxes().contains(cell.getAxisLabel().getPostCoordinationAxis())) {
cell.setValue("NOT_ALLOWED");
}
}
}
}
}
for (PostCoordinationTableRow row : this.tableRows) {
for (PostCoordinationTableCell cell : row.getCellList()) {
if(cell.getLinearizationDefinition().getCoreLinId() == null) {
row.updateDerivedCell(cell);
for (PostCoordinationTableRow row : this.tableRows) {
for (PostCoordinationTableCell cell : row.getCellList()) {
if(cell.getLinearizationDefinition().getCoreLinId() == null) {
row.updateDerivedCell(cell);
}
}
}
}


}

private static final String SVG = "<div style='width: 12px; height: 12px; margin-right:2px;' >" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
public class PostCoordinationTableCell {
private ConfigurableCheckbox configurableCheckbox;
private LinearizationDefinition linearizationDefinition;

private PostCoordinationCheckboxConfig checkboxConfig;
private PostCoordinationTableAxisLabel axisLabel;

Expand Down

0 comments on commit 2c33c37

Please sign in to comment.