Skip to content

Commit

Permalink
Added property sheet support for new properties on DateControl and Da…
Browse files Browse the repository at this point in the history
…yViewBase.
  • Loading branch information
dlemmermann committed Sep 16, 2022
1 parent df7ce5f commit b058247
Show file tree
Hide file tree
Showing 2 changed files with 352 additions and 0 deletions.
228 changes: 228 additions & 0 deletions CalendarFXView/src/main/java/com/calendarfx/view/DateControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -3340,6 +3340,234 @@ public String getCategory() {
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(showNoonMarkerProperty());
}

@Override
public void setValue(Object value) {
setShowNoonMarker((boolean) value);
}

@Override
public Object getValue() {
return isShowNoonMarker();
}

@Override
public Class<?> getType() {
return boolean.class;
}

@Override
public String getName() {
return "Show Noon Marker";
}

@Override
public String getDescription() {
return "Show / hide markers for noon.";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(editAvailabilityProperty());
}

@Override
public void setValue(Object value) {
setEditAvailability((boolean) value);
}

@Override
public Object getValue() {
return isEditAvailability();
}

@Override
public Class<?> getType() {
return boolean.class;
}

@Override
public String getName() {
return "Edit Availability";
}

@Override
public String getDescription() {
return "Allow editing of the availability calendar";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(enableTimeZoneSupportProperty());
}

@Override
public void setValue(Object value) {
setEnableTimeZoneSupport((boolean) value);
}

@Override
public Object getValue() {
return isEnableTimeZoneSupport();
}

@Override
public Class<?> getType() {
return boolean.class;
}

@Override
public String getName() {
return "Enable Timezone Support";
}

@Override
public String getDescription() {
return "Provide UI controls to work with timezones.";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(showDetailsUponCreationProperty());
}

@Override
public void setValue(Object value) {
setShowDetailsUponCreation((boolean) value);
}

@Override
public Object getValue() {
return isShowDetailsUponCreation();
}

@Override
public Class<?> getType() {
return boolean.class;
}

@Override
public String getName() {
return "Show Details upon Creation";
}

@Override
public String getDescription() {
return "Show the details dialog immediately after creating a new entry";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(createEntryClickCountProperty());
}

@Override
public void setValue(Object value) {
setCreateEntryClickCount((Integer) value);
}

@Override
public Object getValue() {
return getCreateEntryClickCount();
}

@Override
public Class<?> getType() {
return Integer.class;
}

@Override
public String getName() {
return "Create Entry Click Count";
}

@Override
public String getDescription() {
return "Set the number of clicks needed to create a new entry.";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(availabilityFillProperty());
}

@Override
public void setValue(Object value) {
setAvailabilityFill((Paint) value);
}

@Override
public Object getValue() {
return getAvailabilityFill();
}

@Override
public Class<?> getType() {
return Paint.class;
}

@Override
public String getName() {
return "Availability Fill Color";
}

@Override
public String getDescription() {
return "Availability Fill Color";
}

@Override
public String getCategory() {
return DATE_CONTROL_CATEGORY;
}
});

return items;
}
}
124 changes: 124 additions & 0 deletions CalendarFXView/src/main/java/com/calendarfx/view/DayViewBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -1121,6 +1121,44 @@ public String getCategory() {
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(enableCurrentTimeCircleProperty());
}

@Override
public void setValue(Object value) {
setEnableCurrentTimeCircle((boolean) value);
}

@Override
public Object getValue() {
return isEnableCurrentCircleMarker();
}

@Override
public Class<?> getType() {
return boolean.class;
}

@Override
public String getName() {
return "Current time circle";
}

@Override
public String getDescription() {
return "Show current time circle.";
}

@Override
public String getCategory() {
return DAY_VIEW_BASE_CATEGORY;
}
});

items.add(new Item() {

@Override
Expand Down Expand Up @@ -1476,6 +1514,92 @@ public boolean isEditable() {
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(entryViewAvailabilityEditingBehaviourProperty());
}

@Override
public void setValue(Object value) {
setEntryViewAvailabilityEditingBehaviour((AvailabilityEditingEntryBehaviour) value);
}

@Override
public Object getValue() {
return getEntryViewAvailabilityEditingBehaviour();
}

@Override
public Class<?> getType() {
return AvailabilityEditingEntryBehaviour.class;
}

@Override
public String getName() {
return "Availability Editing Entry Behaviour";
}

@Override
public String getDescription() {
return "Determines how an entry view will be shown during availability editing.";
}

@Override
public String getCategory() {
return DAY_VIEW_BASE_CATEGORY;
}

@Override
public boolean isEditable() {
return true;
}
});

items.add(new Item() {

@Override
public Optional<ObservableValue<?>> getObservableValue() {
return Optional.of(entryViewAvailabilityEditingOpacityProperty());
}

@Override
public void setValue(Object value) {
setEntryViewAvailabilityEditingOpacity((double) value);
}

@Override
public Object getValue() {
return getEntryViewAvailabilityEditingOpacity();
}

@Override
public Class<?> getType() {
return Double.class;
}

@Override
public String getName() {
return "Availability Editing Entry Opacity";
}

@Override
public String getDescription() {
return "Determines how opaque an entry view will be shown during availability editing.";
}

@Override
public String getCategory() {
return DAY_VIEW_BASE_CATEGORY;
}

@Override
public boolean isEditable() {
return true;
}
});

return items;
}
}

0 comments on commit b058247

Please sign in to comment.