mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
22.56.2016 83f86f11c27378d650c3bfc7e55397687062edbc
opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/TaskToSchedulePanel.java
@@ -14,7 +14,6 @@
 * Copyright 2009-2010 Sun Microsystems, Inc.
 * Portions Copyright 2014-2016 ForgeRock AS.
 */
package org.opends.guitools.controlpanel.ui;
import static org.opends.messages.AdminToolMessages.*;
@@ -42,16 +41,14 @@
import javax.swing.JTextField;
import javax.swing.text.PlainDocument;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.guitools.controlpanel.datamodel.CategorizedComboBoxElement;
import org.opends.guitools.controlpanel.datamodel.ScheduleType;
import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent;
import org.opends.guitools.controlpanel.ui.components.
 NumericLimitedSizeDocumentFilter;
import org.opends.guitools.controlpanel.ui.components.NumericLimitedSizeDocumentFilter;
import org.opends.guitools.controlpanel.ui.components.TimeDocumentFilter;
import org.opends.guitools.controlpanel.ui.renderer.
 NoLeftInsetCategoryComboBoxRenderer;
import org.opends.guitools.controlpanel.ui.renderer.NoLeftInsetCategoryComboBoxRenderer;
import org.opends.guitools.controlpanel.util.Utilities;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.backends.task.RecurringTask;
/** The panel that allows the user to specify when a task will be launched. */
@@ -59,14 +56,14 @@
{
  private static final long serialVersionUID = 6855081932432566784L;
  private String taskName;
  private final String taskName;
  private JComboBox scheduleType;
  private JTextField time;
  private JTextField day;
  private JComboBox month;
  private JComboBox year;
  private JComboBox<String> month;
  private JComboBox<String> year;
  private JLabel lTime;
  private JLabel lDay;
@@ -79,8 +76,7 @@
  private JLabel lWeeklyTime;
  private JLabel lWeeklyDays;
  private JTextField weeklyTime;
  private JCheckBox sunday, monday, tuesday, wednesday, thursday, friday,
  saturday;
  private final JCheckBox sunday, monday, tuesday, wednesday, thursday, friday, saturday;
  {
    sunday =
      Utilities.createCheckBox(INFO_CTRL_PANEL_TASK_TO_SCHEDULE_SUNDAY.get());
@@ -99,7 +95,7 @@
      Utilities.createCheckBox(INFO_CTRL_PANEL_TASK_TO_SCHEDULE_SATURDAY.get());
  }
  JCheckBox[] weekDays =
  private final JCheckBox[] weekDays =
  {
      sunday, monday, tuesday, wednesday, thursday, friday, saturday
  };
@@ -107,7 +103,7 @@
  private JLabel lMonthlyTime;
  private JLabel lMonthlyDays;
  private JTextField monthlyTime;
  private JCheckBox[] monthDays = new JCheckBox[31];
  private final JCheckBox[] monthDays = new JCheckBox[31];
  private JLabel lCronMinute;
  private JLabel lCronHour;
@@ -127,13 +123,13 @@
  private Component monthlyPanel;
  private Component cronPanel;
  private LocalizableMessage LAUNCH_NOW = INFO_CTRL_PANEL_LAUNCH_NOW.get();
  private LocalizableMessage LAUNCH_LATER = INFO_CTRL_PANEL_LAUNCH_LATER.get();
  private LocalizableMessage LAUNCH_DAILY = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_DAILY.get();
  private LocalizableMessage LAUNCH_WEEKLY = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_WEEKLY.get();
  private LocalizableMessage LAUNCH_MONTHLY =
  private final LocalizableMessage LAUNCH_NOW = INFO_CTRL_PANEL_LAUNCH_NOW.get();
  private final LocalizableMessage LAUNCH_LATER = INFO_CTRL_PANEL_LAUNCH_LATER.get();
  private final LocalizableMessage LAUNCH_DAILY = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_DAILY.get();
  private final LocalizableMessage LAUNCH_WEEKLY = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_WEEKLY.get();
  private final LocalizableMessage LAUNCH_MONTHLY =
    INFO_CTRL_PANEL_TASK_TO_SCHEDULE_MONTHLY.get();
  private LocalizableMessage CRON = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_CRON.get();
  private final LocalizableMessage CRON = INFO_CTRL_PANEL_TASK_TO_SCHEDULE_CRON.get();
  private ScheduleType schedule;
@@ -714,6 +710,7 @@
  @Override
  public void configurationChanged(ConfigurationChangeEvent ev)
  {
    // no-op
  }
  @Override
@@ -770,10 +767,7 @@
        {currentYear, currentYear + 5}
    };
    JComboBox[] numericBoxes =
    {
        year
    };
    JComboBox[] numericBoxes = { year };
    int[] currentValues =
    {
@@ -785,7 +779,7 @@
      int min = maxMin[i][0];
      int max = maxMin[i][1];
      DefaultComboBoxModel model = new DefaultComboBoxModel();
      DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
      int selectedIndex = 0;
@@ -818,7 +812,7 @@
      }
    }
    DefaultComboBoxModel model = new DefaultComboBoxModel();
    DefaultComboBoxModel<String> model = new DefaultComboBoxModel<>();
    month.setModel(model);
    LocalizableMessage[] monthMessages =