コード例 #1
0
  /**
   * Constructor
   *
   * @param parent parent control
   * @param metricType metric type
   * @param metricId which metric is being added
   * @param objectId object id(task id, sprint id, ...)
   */
  public MeasureAddDialog(
      JFrame parent, MetricTableModel.MetricType metricType, int metricId, int objectId) {
    super(parent, objectId);

    _metricType = metricType;
    _metricId = metricId;
    _objectId = objectId;

    switch (_metricType) {
      case Sprint:
        setTitle(i18n.tr("Add Sprint Measurement"));
        break;
      case Task:
        setTitle(i18n.tr("Add Task Measurement"));
        break;
      case PBI:
        setTitle(i18n.tr("Add PBI Measurement"));
        break;
      case Release:
        setTitle(i18n.tr("Add Release Measurement"));
        break;
    }

    _dateInput.setText(Util.today());
    _resultInput.setSelectedItem("0");
  }
コード例 #2
0
 @Override
 public void operationFailed(DataOperation type, ImpedimentOperation identifier, String message) {
   if ((type == DataOperation.Remove) && (identifier == ImpedimentOperation.ImpedimentStatus)) {
     Util.showError(
         this, i18n.tr("Could not remove impediment status: " + message), i18n.tr("Error"));
   }
 }
コード例 #3
0
 @Override
 public void operationFailed(DataOperation type, MetricOperation identifier, String message) {
   if ((type == DataOperation.Custom) && (identifier == MetricOperation.Graph)) {
     Util.showError(
         this,
         i18n.tr("Error occurred while calculating sprint burndown information: ") + message,
         i18n.tr("Error"));
   }
 }
コード例 #4
0
 @Override
 public void operationFailed(DataOperation type, MetricOperation identifier, String message) {
   if ((type == DataOperation.Custom)
       && ((identifier == MetricOperation.WorkEffectivenessCalculated)
           || (identifier == MetricOperation.EarnedValueCalculated))) {
     _resultInput.setSelectedItem(_previous.toEngineeringString());
     OK.requestFocus();
   } else if ((type == DataOperation.Insert)
       && ((identifier == MetricOperation.ReleaseMeasure)
           || (identifier == MetricOperation.SprintMeasure)
           || (identifier == MetricOperation.TaskMeasure)
           || (identifier == MetricOperation.PBIMeasure))) {
     Util.showError(this, i18n.tr("Error while adding new measure: ") + message, i18n.tr("Error"));
   }
 }
コード例 #5
0
  /**
   * Constructor
   *
   * @param owner parent frame
   */
  public TaskTypeRemoveDialog(Frame owner) {
    super(owner, ModalityType.APPLICATION_MODAL);

    setTitle(i18n.tr("Remove task type"));

    _tasktypeModel = Scrummer.getModels().getTaskTypeModel();
    _tasktypeComboBoxModel = _tasktypeModel.getTaskTypeComboBoxModel();

    _tasktypeModel.addTaskTypeListener(this);

    int k = 10;

    Panel.setBorder(
        Util.createSpacedTitleBorder(k, k, k, k, i18n.tr("Select task type"), 0, k, k, k));

    _formBuilder = new FormBuilder(Panel);
    _tasktypeInput = _formBuilder.addComboBoxInput(i18n.tr("Task type") + ":");
    _tasktypeInput.setIVModel(_tasktypeComboBoxModel);

    BottomPanel.setBorder(BorderFactory.createEmptyBorder(0, k, k, k));

    setSize(new Dimension(320, 150));
    Util.centre(this);
  }
コード例 #6
0
  public ImpedimentStatusRemove(JFrame parent) {
    super(parent);
    setTitle(i18n.tr("Remove Impediment Status"));

    Models m = Scrummer.getModels();
    _impedimentModel = m.getImpedimentModel();
    _impedimentModel.addImpedimentListener(this);

    int k = 10;
    Panel.setBorder(
        Util.createSpacedTitleBorder(k, k, k, k, i18n.tr("Impediment Status"), 0, k, k, k));

    FormBuilder fb = new FormBuilder(Panel);
    _impedimentStatusInput = fb.addComboBoxInput(i18n.tr("Status") + ":");
    _impedimentStatusInput.setIVModel(_impedimentModel.getImpedimentStatusComboBoxModel());

    BottomPanel.setBorder(BorderFactory.createEmptyBorder(0, k, k, k - 3));

    OK.setText(i18n.tr("Remove"));
    setSize(320, 150);
  }
コード例 #7
0
  @Override
  public void actionPerformed(ActionEvent e) {

    String cmd = e.getActionCommand();
    if (cmd == "StandardDialog.OK") {
      if (_tasktypeInput.isSelected()) {
        Integer id = _tasktypeInput.getSelectedId();
        _tasktypeModel.removeTaskType(id.toString());
        _tasktypeComboBoxModel.refresh();
      } else {
        Util.showError(
            this,
            i18n.tr(
                "Could not delete task type. Select one task type first, "
                    + "then click on Remove button."),
            i18n.tr("Error"));
      }
    } else {
      super.actionPerformed(e);
    }
  }
コード例 #8
0
 @Override
 public void operationFailed(DataOperation type, TaskTypeOperation identifier, String message) {
   Util.showError(this, i18n.tr("Could not remove task type: " + message), i18n.tr("Error"));
 }