Skip to content

Commit

Permalink
Added support for replacing corner nodes in ResourcesView.
Browse files Browse the repository at this point in the history
  • Loading branch information
dlemmermann committed Sep 20, 2022
1 parent 39770e3 commit 753d3fe
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,44 @@ public void setWeekViewFactory(Callback<T, WeekView> weekViewFactory) {
this.weekViewFactory.set(weekViewFactory);
}

private final ObjectProperty<Node> upperLeftCorner = new SimpleObjectProperty<>(this, "upperLeftCorner", new Region());

public final Node getUpperLeftCorner() {
return upperLeftCorner.get();
}

/**
* Specifies a node that will be placed in the upper left corner of the view.
*
* @return the upper left corner node
*/
public final ObjectProperty<Node> upperLeftCornerProperty() {
return upperLeftCorner;
}

public final void setUpperLeftCorner(Node upperLeftCorner) {
this.upperLeftCorner.set(upperLeftCorner);
}

private final ObjectProperty<Node> upperRightCorner = new SimpleObjectProperty<>(this, "upperRightCorner", new Region());

public final Node getUpperRightCorner() {
return upperRightCorner.get();
}

/**
* Specifies a node that will be placed in the upper right corner of the view.
*
* @return the upper right corner node
*/
public final ObjectProperty<Node> upperRightCornerProperty() {
return upperRightCorner;
}

public final void setUpperRightCorner(Node upperRightCorner) {
this.upperRightCorner.set(upperRightCorner);
}

private final ObjectProperty<Callback<T, Region>> separatorFactory = new SimpleObjectProperty<>(this, "separatorFactory", it-> {
Region region = new Region();
region.getStyleClass().add("resource-separator");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ private void updateView() {
gridPane.add(timeScaleScrollPane, 0, 1);
}

Region upperLeftCorner = new Region();
Node upperLeftCorner = view.getUpperLeftCorner();
upperLeftCorner.getStyleClass().add("upper-left-corner");
gridPane.add(upperLeftCorner, 0, 0);

if (view.isShowScrollBar()) {
Region upperRightCorner = new Region();
Node upperRightCorner = view.getUpperRightCorner();
upperRightCorner.getStyleClass().add("upper-right-corner");
gridPane.add(upperRightCorner, 2, 0);
}
Expand Down

0 comments on commit 753d3fe

Please sign in to comment.