Skip to content
Snippets Groups Projects
Commit 1b1673dd authored by Alexander Diewald's avatar Alexander Diewald
Browse files

JavaFX: Check null in the DynamicTreeViewer already.

* The UI provider operates on the items passed by the updateItem method
  in the DynamicTreeViewer.
* Avoid the required null-checks in the UI providers by moving this
  check to the Viewer. This reduces the boilerplate code.

Issue-Ref: 3209
Issue-Url: https://af3-developer.fortiss.org/issues/3209


Signed-off-by: default avatarAlexander Diewald <diewald@fortiss.org>
parent 426c2209
No related branches found
No related tags found
1 merge request!43209 javafx
......@@ -3,6 +3,6 @@ DynamicTreeItem.java afc105cf5acf3d2506d89e0892555100c234ce5b YELLOW
DynamicTreeTableUIProviderBase.java fd9fce19a65eb1006ceacb0d869bbe90a8c578b3 YELLOW
DynamicTreeTableViewer.java 22bd5e5b13b959807596fff5b4024b3383737103 YELLOW
DynamicTreeUIProviderBase.java 56fe4df4577b35f1e5e6e4c4be189b706c852d52 YELLOW
DynamicTreeViewer.java 72945b28f34d9d268df4ce763fdabb7a8561fbc6 YELLOW
DynamicTreeViewer.java d5b9f87862d9c42327c46bce02fb34d64673d413 YELLOW
DynamicTreeViewerBase.java 47124c847de322a0ae26eb7a114f85ce4bd02d7e YELLOW
IDoubleClickHandler.java 447f7769dead9a106b3ea3139ef0da51eb0b9a89 YELLOW
......@@ -129,10 +129,13 @@ public final class DynamicTreeViewer<T> extends DynamicTreeViewerBase<T> {
menu = uiProvider.createContextMenu(item);
EventDispatcher original = this.getEventDispatcher();
this.setEventDispatcher(new DoubleClickEventDispatcher(original));
this.setText(uiProvider.getLabel(item));
this.setGraphic(uiProvider.getIconNode(item));
} else {
this.setText(null);
this.setGraphic(null);
}
this.setContextMenu(menu);
this.setText(uiProvider.getLabel(item));
this.setGraphic(uiProvider.getIconNode(item));
}
};
return cell;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment