Search in sources :

Example 1 with GlusterVolumeSnapshotScheduleRecurrence

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);
}
Also used : GlusterVolumeSnapshotScheduleRecurrence(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence)

Example 2 with GlusterVolumeSnapshotScheduleRecurrence

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>());
}
Also used : DayOfWeek(org.ovirt.engine.core.compat.DayOfWeek) ArrayList(java.util.ArrayList) Date(java.util.Date) GlusterVolumeSnapshotScheduleRecurrence(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence) ArrayList(java.util.ArrayList) List(java.util.List)

Example 3 with GlusterVolumeSnapshotScheduleRecurrence

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);
        }
    });
}
Also used : DayOfWeek(org.ovirt.engine.core.compat.DayOfWeek) EntityModelWidgetWithInfo(org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo) GlusterVolumeSnapshotScheduleRecurrence(org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence) AbstractRenderer(com.google.gwt.text.shared.AbstractRenderer) EnableableFormLabel(org.ovirt.engine.ui.common.widget.label.EnableableFormLabel) EntityModelDateTimeBoxEditor(org.ovirt.engine.ui.common.widget.editor.EntityModelDateTimeBoxEditor) StringEntityModelTextBoxEditor(org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor)

Aggregations

GlusterVolumeSnapshotScheduleRecurrence (org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotScheduleRecurrence)3 DayOfWeek (org.ovirt.engine.core.compat.DayOfWeek)2 AbstractRenderer (com.google.gwt.text.shared.AbstractRenderer)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 List (java.util.List)1 EntityModelWidgetWithInfo (org.ovirt.engine.ui.common.widget.EntityModelWidgetWithInfo)1 EntityModelDateTimeBoxEditor (org.ovirt.engine.ui.common.widget.editor.EntityModelDateTimeBoxEditor)1 StringEntityModelTextBoxEditor (org.ovirt.engine.ui.common.widget.editor.generic.StringEntityModelTextBoxEditor)1 EnableableFormLabel (org.ovirt.engine.ui.common.widget.label.EnableableFormLabel)1