use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence in project ovirt-engine by oVirt.
the class GlusterVolumeSnapshotCreatePopupView method updateVisibilities.
@Override
public void updateVisibilities(GlusterVolumeSnapshotModel object) {
GlusterVolumeSnapshotScheduleRecurrence recurrenceOption = object.getRecurrence().getSelectedItem();
intervalEditor.setVisible(recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.INTERVAL);
endByOptionsEditor.setVisible(recurrenceOption != GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN);
timeZoneEditor.setVisible(recurrenceOption != GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN);
daysOfWeekEditor.setVisible(recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.WEEKLY);
daysOfMonthEditor.setVisible(recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.MONTHLY);
startAtEditor.setVisible(recurrenceOption != GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN);
executionTimeEditor.setVisible(recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.DAILY || recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.WEEKLY || recurrenceOption == GlusterVolumeSnapshotScheduleRecurrence.MONTHLY);
disableCliScheduleMessageLabel.setVisible(object.getDisableCliSchedule().getEntity() && recurrenceOption != GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN);
setEndDateVisibility(object);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence in project ovirt-engine by oVirt.
the class GlusterVolumeSnapshotModel method init.
private void init() {
setDataCenter(new EntityModel<String>());
setClusterName(new EntityModel<String>());
setVolumeName(new EntityModel<String>());
setSnapshotName(new EntityModel<String>());
setDescription(new EntityModel<String>());
setRecurrence(new ListModel<GlusterVolumeSnapshotScheduleRecurrence>());
setInterval(new ListModel<String>());
setEndByOptions(new ListModel<EndDateOptions>());
setTimeZones(new ListModel<Map.Entry<String, String>>());
setDaysOfMonth(new ListModel<String>());
setStartAt(new EntityModel<>(new Date()));
setEndDate(new EntityModel<>(new Date()));
setExecutionTime(new EntityModel<>(new Date()));
setDisableCliSchedule(new EntityModel<>(false));
initIntervals();
initTimeZones();
recurrence.setItems(Arrays.asList(GlusterVolumeSnapshotScheduleRecurrence.values()), GlusterVolumeSnapshotScheduleRecurrence.UNKNOWN);
endByOptions.setItems(Arrays.asList(EndDateOptions.values()));
List<String> values = new ArrayList<>();
for (DayOfWeek day : DayOfWeek.values()) {
values.add(day.toString().substring(0, 3));
}
daysOfWeek = new ListModel<>();
List<DayOfWeek> daysList = Arrays.asList(DayOfWeek.values());
List<List<DayOfWeek>> list = new ArrayList<>();
list.add(daysList);
daysOfWeek.setItems(list, new ArrayList<DayOfWeek>());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence in project ovirt-engine by oVirt.
the class GlusterVolumeSnapshotCreatePopupView method initEditors.
private void initEditors() {
snapshotNameEditor = new StringEntityModelTextBoxEditor();
snapshotNameEditor.hideLabel();
EnableableFormLabel label = new EnableableFormLabel();
label.setText(constants.volumeSnapshotNamePrefixLabel());
snapshotNameEditorWithInfo = new EntityModelWidgetWithInfo(label, snapshotNameEditor);
snapshotNameEditorWithInfo.setExplanation(templates.italicText(constants.snapshotNameInfo()));
startAtEditor = new EntityModelDateTimeBoxEditor();
startAtEditor.getContentWidget().setDateTimeFormat(GwtBootstrapDateTimePicker.DEFAULT_DATE_TIME_FORMAT);
startAtEditor.getContentWidget().showDateAndTime();
daysOfWeekEditor = new ListModelCheckBoxGroupEditor<>(new AbstractRenderer<DayOfWeek>() {
@Override
public String render(DayOfWeek object) {
return object.toString().substring(0, 3);
}
});
endDate = new EntityModelDateTimeBoxEditor();
endDate.getContentWidget().setDateTimeFormat(GwtBootstrapDateTimePicker.DEFAULT_DATE_TIME_FORMAT);
endDate.getContentWidget().showDateAndTime();
executionTimeEditor = new EntityModelDateTimeBoxEditor();
// $NON-NLS-1$
executionTimeEditor.getContentWidget().setDateTimeFormat("hh:ii");
executionTimeEditor.getContentWidget().showTimeOnly();
recurrenceEditor = new ListModelListBoxEditor<>(new AbstractRenderer<GlusterVolumeSnapshotScheduleRecurrence>() {
@Override
public String render(GlusterVolumeSnapshotScheduleRecurrence object) {
return EnumTranslator.getInstance().translate(object);
}
});
}
Aggregations