Package edu.hawaii.ics.csdl.jupiter.file

Examples of edu.hawaii.ics.csdl.jupiter.file.FieldItem


    String typeKey = (reviewResource != null) ? reviewResource.getDefaultField(typeName) : "";
    typeCombo.setText(ReviewI18n.getString(typeKey));
    typeCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String nameId = PropertyConstraints.ATTRIBUTE_VALUE_TYPE;
        FieldItem fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(nameId);
        fieldItem.setDefaultKey(ReviewI18n.getKey(typeCombo.getText()));
      }
    });

    FormData typeLabelData = new FormData();
    typeLabelData.width = (int) (clientWidth * RATIO);
    typeLabelData.top = new FormAttachment(typeCombo, 0, SWT.CENTER);
    typeLabel.setLayoutData(typeLabelData);
    FormData typeComboData = new FormData();
    typeComboData.left = new FormAttachment(typeLabel, 0);
    typeComboData.right = new FormAttachment(100, 0);
    typeCombo.setLayoutData(typeComboData);

    // create severity label and its combo.
    Label severityLabel = new Label(composite, SWT.NONE);
    severityLabel.setText(ReviewI18n.getString("ReviewIdEditDialog.label.severity"));
    this.severityCombo = new Combo(composite, SWT.READ_ONLY);
    severityCombo.setData(severityCombo);
    severityCombo.setItems(SeverityKeyManager.getInstance(project, reviewId).getElements());
    String severityName = PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY;
    String severityKey = (reviewResource != null) ? reviewResource
        .getDefaultField(severityName) : "";
    severityCombo.setText(ReviewI18n.getString(severityKey));
    severityCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String nameId = PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY;
        FieldItem fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(nameId);
        fieldItem.setDefaultKey(ReviewI18n.getKey(severityCombo.getText()));
      }
    });

    FormData severityLabelData = new FormData();
    severityLabelData.width = (int) (clientWidth * RATIO);
    severityLabelData.top = new FormAttachment(severityCombo, 0, SWT.CENTER);
    severityLabel.setLayoutData(severityLabelData);
    FormData severityComboData = new FormData();
    severityComboData.top = new FormAttachment(typeCombo, 5);
    severityComboData.left = new FormAttachment(severityLabel, 0);
    severityComboData.right = new FormAttachment(100, 0);
    severityCombo.setLayoutData(severityComboData);

    // create resolution label and its combo.
    Label resolutionLabel = new Label(composite, SWT.NONE);
    resolutionLabel.setText(ReviewI18n.getString("ReviewIdEditDialog.label.resolution"));
    this.resolutionCombo = new Combo(composite, SWT.READ_ONLY);
    resolutionCombo.setData(resolutionCombo);
    resolutionCombo
        .setItems(ResolutionKeyManager.getInstance(project, reviewId).getElements());
    String resolutionName = PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION;
    String resolutionKey = (reviewResource != null) ? reviewResource
        .getDefaultField(resolutionName) : "";
    resolutionCombo.setText(ReviewI18n.getString(resolutionKey));
    resolutionCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String nameId = PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION;
        FieldItem fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(nameId);
        fieldItem.setDefaultKey(ReviewI18n.getKey(resolutionCombo.getText()));
      }
    });

    FormData resolutionLabelData = new FormData();
    resolutionLabelData.width = (int) (clientWidth * RATIO);
    resolutionLabelData.top = new FormAttachment(resolutionCombo, 0, SWT.CENTER);
    resolutionLabel.setLayoutData(resolutionLabelData);
    FormData resolutionComboData = new FormData();
    resolutionComboData.top = new FormAttachment(severityCombo, 5);
    resolutionComboData.left = new FormAttachment(resolutionLabel, 0);
    resolutionComboData.right = new FormAttachment(100, 0);
    resolutionCombo.setLayoutData(resolutionComboData);

    // create status label and its combo.
    Label statusLabel = new Label(composite, SWT.NONE);
    statusLabel.setText(ReviewI18n.getString("ReviewIdEditDialog.label.status"));
    this.statusCombo = new Combo(composite, SWT.READ_ONLY);
    statusCombo.setData(statusCombo);
    statusCombo.setItems(StatusKeyManager.getInstance(project, reviewId).getElements());
    String statusName = PropertyConstraints.ATTRIBUTE_VALUE_STATUS;
    String statusKey = (reviewResource != null) ? reviewResource.getDefaultField(statusName)
        : "";
    statusCombo.setText(ReviewI18n.getString(statusKey));
    statusCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String nameId = PropertyConstraints.ATTRIBUTE_VALUE_STATUS;
        FieldItem fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(nameId);
        fieldItem.setDefaultKey(ReviewI18n.getKey(statusCombo.getText()));
      }
    });

    FormData statusLabelData = new FormData();
    statusLabelData.width = (int) (clientWidth * RATIO);
 
View Full Code Here


      return;
    }
    String itemName = dialog.getValue();
    TableItem item = new TableItem(this.itemListTable, SWT.NONE);
    String fieldItemId = this.itemCombo.getText();
    FieldItem fieldItem = this.fieldItemIdFieldItemMap.get(fieldItemId);
    if (fieldItem != null) {
      List<String> itemList = fieldItem.getEntryNameList();
      itemList.add(itemName);
      fillItemTable(fieldItemId);
      updateDefaultItems(fieldItemId);
      IWizardPage page = getWizard().getPage(ReviewIdNewWizard.PAGE_FILTERS);
      ReviewIdNewFilterPage filterPage = (ReviewIdNewFilterPage) page;
View Full Code Here

      return;
    }
    String newName = dialog.getValue();
    item.setText(newName);
    String fieldItemId = this.itemCombo.getText();
    FieldItem fieldItem = this.fieldItemIdFieldItemMap.get(fieldItemId);
    if (fieldItem != null) {
      List<String> itemList = fieldItem.getEntryNameList();
      int index = itemList.indexOf(oldName);
      itemList.remove(index);
      itemList.add(index, newName);
      fillItemTable(fieldItemId);
      updateDefaultItems(fieldItemId);
View Full Code Here

  /**
   * Removes item entries form the table.
   */
  protected void removeItemEntries() {
    String fieldItemId = this.itemCombo.getText();
    FieldItem fieldItem = this.fieldItemIdFieldItemMap.get(fieldItemId);
    if (fieldItem != null) {
      List<String> itemList = fieldItem.getEntryNameList();
      TableItem[] items = this.itemListTable.getSelection();
      for (int i = 0; i < items.length; i++) {
        String itemName = items[i].getText();
        itemList.remove(itemName);
      }
View Full Code Here

   * @param isUpward <code>true</code> if moving the selected item entry by one upward.
   * <code>false</code> if moving the selected item entry by one downward.
   */
  protected void moveItemEntry(boolean isUpward) {
    String fieldItemId = this.itemCombo.getText();
    FieldItem fieldItem = this.fieldItemIdFieldItemMap.get(fieldItemId);
    TableItem[] selectedItems = this.itemListTable.getSelection();
    if (selectedItems.length > 0 && fieldItem != null) {
      TableItem selectedItem = selectedItems[0];
      String itemName = selectedItem.getText();
      List<String> itemList = fieldItem.getEntryNameList();
      int index = itemList.indexOf(itemName);
      if ((isUpward) ? index > 0 : index < itemList.size() - 1) {
        int nextIndex = (isUpward) ? index - 1 : index + 1;
        itemList.remove(index);
        itemList.add(nextIndex, itemName);
View Full Code Here

    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String defaultReviewID = PropertyConstraints.DEFAULT_REVIEW_ID;
    ReviewResource reviewResource = propertyResource.getReviewResource(defaultReviewID, true);
    if (reviewResource != null) {
      String fieldItemId = this.itemCombo.getText();
      FieldItem fieldItem = reviewResource.getFieldItem(fieldItemId);
      this.fieldItemIdFieldItemMap.put(fieldItemId, fieldItem);
      fillItemTable(fieldItemId);
      updateDefaultItems(fieldItemId);
      IWizardPage page = getWizard().getPage(ReviewIdNewWizard.PAGE_FILTERS);
      ReviewIdNewFilterPage filterPage = (ReviewIdNewFilterPage) page;
View Full Code Here

   * @param longMessageKey the long message key.
   * @return the input dialog the <code>InputDialog</code>.
   */
  private InputDialog openDialog(String existingItemName, String shortMessageKey,
                      String longMessageKey) {
    FieldItem fieldItem = (FieldItem) this.fieldItemIdFieldItemMap.get(this.itemCombo.getText());
    if (fieldItem != null) {
      final List<String> itemList = fieldItem.getEntryNameList();
      IInputValidator validator = new IInputValidator() {
        public String isValid(String newText) {
          if (!itemList.contains(ReviewI18n.getKey(newText))) {
            return null;
          }
View Full Code Here

   * Fills item data in the item table.
   * @param fieldItemId the field item id.
   */
  private void fillItemTable(String fieldItemId) {
    removeItems();
    FieldItem fieldItem = this.fieldItemIdFieldItemMap.get(fieldItemId);
    if (fieldItem != null) {
      for (Iterator<String> i = fieldItem.getEntryNameList().iterator(); i.hasNext();) {
        String itemEntry = ReviewI18n.getString(i.next());
        TableItem item = new TableItem(this.itemListTable, SWT.NONE);
        item.setText(itemEntry);
      }
    }
View Full Code Here

   * @param fieldItemId the field item id.
   */
  private void updateDefaultItems(String fieldItemId) {
    String pageName = ReviewIdNewWizard.PAGE_DEFAULT_ITEMS;
    ReviewIdNewDefaultItemsPage page = (ReviewIdNewDefaultItemsPage) getWizard().getPage(pageName);
    FieldItem fieldItem = (FieldItem) this.fieldItemIdFieldItemMap.get(fieldItemId);
    if (fieldItem != null) {
      List<String> itemNameList = fieldItem.getEntryNameList();
      if (fieldItemId.equals(PropertyConstraints.ATTRIBUTE_VALUE_TYPE)) {
        page.setItemType(itemNameList.toArray(new String[] {}));
      }
      else if (fieldItemId.equals(PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY)) {
        page.setItemSeverity(itemNameList.toArray(new String[] {}));
View Full Code Here

    typeFilterCombo.setEnabled(typeCheckButton.getSelection());
    String typeNameId = PropertyConstraints.ATTRIBUTE_VALUE_TYPE;
    IWizardPage page = getWizard().getPage(ReviewIdNewWizard.PAGE_ITEM_ENTRIES);
    ReviewIdNewItemEntriesPage itemEntryPage = (ReviewIdNewItemEntriesPage) page;
    Map<String, FieldItem> fieldItemIdFieldItemMap = itemEntryPage.getFieldItemIdFieldItemMap();
    FieldItem fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(typeNameId);
    if (fieldItem != null) {
      typeFilterCombo.setItems((String[]) fieldItem.getEntryNameList().toArray(new String[] {}));
    }
    typeFilterCombo.setText(ReviewI18n.getString(entry.getValueKey()));
    typeCheckButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean isEnabled = typeCheckButton.getSelection();
        handleFilterEnabledCheck(isEnabled, typeFilterCombo);
        updateFilterEnabled(PropertyConstraints.ATTRIBUTE_VALUE_TYPE, isEnabled);
      }
    });
   
    this.severityCheckButton = new Button(composite, SWT.CHECK);
    String severityKey = "ReviewIdEditDialog.label.tab.filters.check.severity";
    severityCheckButton.setText(ReviewI18n.getString(severityKey));
    FormData severityCheckButtonData = new FormData();
    severityCheckButtonData.top = new FormAttachment(typeCheckButton, 10);
    severityCheckButton.setLayoutData(severityCheckButtonData);
    entry = filterPhase.getFilterEntry(PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY);
    severityCheckButton.setSelection(entry.isEnabled());
    this.severityFilterCombo = new Combo(composite, SWT.READ_ONLY);
    severityFilterCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String value = severityFilterCombo.getText();
        String key = SeverityKeyManager.getInstance(project, reviewId).getKey(value);
        updateFilterValue(PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY, key);
      }
    });
    FormData severityFilterComboData = new FormData();
    severityFilterComboData.top = new FormAttachment(severityCheckButton, 0, SWT.CENTER);
    severityFilterComboData.left = new FormAttachment(severityCheckButton, x + 20, SWT.LEFT);
    severityFilterComboData.right = new FormAttachment(100, 0);
    severityFilterCombo.setLayoutData(severityFilterComboData);
    severityFilterCombo.setEnabled(severityCheckButton.getSelection());
    String severityNameId = PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY;
    fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(severityNameId);
    if (fieldItem != null) {
      List<String> itemNameList = fieldItem.getEntryNameList();
      severityFilterCombo.setItems(itemNameList.toArray(new String[] {}));
    }
    severityFilterCombo.setText(ReviewI18n.getString(entry.getValueKey()));
    severityCheckButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean isEnabled = severityCheckButton.getSelection();
        handleFilterEnabledCheck(isEnabled, severityFilterCombo);
        updateFilterEnabled(PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY, isEnabled);
      }
    });
   
    this.assignedToCheckButton = new Button(composite, SWT.CHECK);
    String assignedToKey = "ReviewIdEditDialog.label.tab.filters.check.assignedTo";
    assignedToCheckButton.setText(ReviewI18n.getString(assignedToKey));
    FormData assignedToCheckButtonData = new FormData();
    assignedToCheckButtonData.top = new FormAttachment(severityCheckButton, 10);
    assignedToCheckButton.setLayoutData(assignedToCheckButtonData);
    entry = filterPhase.getFilterEntry(PropertyConstraints.ATTRIBUTE_VALUE_ASSIGNED_TO);
    assignedToCheckButton.setSelection(entry.isEnabled());
    this.assignedToFilterCombo = new Combo(composite, SWT.READ_ONLY);
    assignedToFilterCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String value = assignedToFilterCombo.getText();
        if (value.equals(ReviewI18n.getString(ReviewerId.AUTOMATIC_KEY))) {
          value = ReviewerId.AUTOMATIC_KEY;
        }
        updateFilterValue(PropertyConstraints.ATTRIBUTE_VALUE_ASSIGNED_TO, value);
      }
    });
    FormData assignedToFilterComboData = new FormData();
    assignedToFilterComboData.top = new FormAttachment(assignedToCheckButton, 0, SWT.CENTER);
    assignedToFilterComboData.left = new FormAttachment(assignedToCheckButton, x + 20, SWT.LEFT);
    assignedToFilterComboData.right = new FormAttachment(100, 0);
    assignedToFilterCombo.setLayoutData(assignedToFilterComboData);
    assignedToFilterCombo.setEnabled(assignedToCheckButton.getSelection());
    reviewers = reviewResource.getReviewers();
    assignedToFilterCombo.setItems((String[]) reviewers.keySet().toArray(new String[] {}));
    assignedToFilterCombo.add(ReviewI18n.getString(ReviewerId.AUTOMATIC_KEY), 0);
    assignedToFilterCombo.setText(ReviewI18n.getString(entry.getValueKey()));
    assignedToCheckButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean isEnabled = assignedToCheckButton.getSelection();
        handleFilterEnabledCheck(isEnabled, assignedToFilterCombo);
        updateFilterEnabled(PropertyConstraints.ATTRIBUTE_VALUE_ASSIGNED_TO, isEnabled);
      }
    });
   
    this.resolutionCheckButton = new Button(composite, SWT.CHECK);
    String resolutionKey = "ReviewIdEditDialog.label.tab.filters.check.resolution";
    resolutionCheckButton.setText(ReviewI18n.getString(resolutionKey));
    FormData resolutionCheckButtonData = new FormData();
    resolutionCheckButtonData.top = new FormAttachment(assignedToCheckButton, 10);
    resolutionCheckButton.setLayoutData(resolutionCheckButtonData);
    entry = filterPhase.getFilterEntry(PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION);
    resolutionCheckButton.setSelection(entry.isEnabled());
    this.resolutionFilterCombo = new Combo(composite, SWT.READ_ONLY);
    resolutionFilterCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String value = resolutionFilterCombo.getText();
        String key = ResolutionKeyManager.getInstance(project, reviewId).getKey(value);
        updateFilterValue(PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION, key);
      }
    });
    FormData resolutionFilterComboData = new FormData();
    resolutionFilterComboData.top = new FormAttachment(resolutionCheckButton, 0, SWT.CENTER);
    resolutionFilterComboData.left = new FormAttachment(resolutionCheckButton, x + 20, SWT.LEFT);
    resolutionFilterComboData.right = new FormAttachment(100, 0);
    resolutionFilterCombo.setLayoutData(resolutionFilterComboData);
    resolutionFilterCombo.setEnabled(resolutionCheckButton.getSelection());
    String resolutionNameId = PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION;
    fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(resolutionNameId);
    if (fieldItem != null) {
      List<String> itemNameList = fieldItem.getEntryNameList();
      resolutionFilterCombo.setItems(itemNameList.toArray(new String[] {}));
    }
    resolutionFilterCombo.setText(ReviewI18n.getString(entry.getValueKey()));
    resolutionCheckButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        boolean isEnabled = resolutionCheckButton.getSelection();
        handleFilterEnabledCheck(isEnabled, resolutionFilterCombo);
        updateFilterEnabled(PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION, isEnabled);
      }
    });
   
    this.statusCheckButton = new Button(composite, SWT.CHECK);
    String statusKey = "ReviewIdEditDialog.label.tab.filters.check.status";
    statusCheckButton.setText(ReviewI18n.getString(statusKey));
    FormData statusCheckButtonData = new FormData();
    statusCheckButtonData.top = new FormAttachment(resolutionCheckButton, 10);
    statusCheckButton.setLayoutData(statusCheckButtonData);
    entry = filterPhase.getFilterEntry(PropertyConstraints.ATTRIBUTE_VALUE_STATUS);
    statusCheckButton.setSelection(entry.isEnabled());
    this.statusFilterCombo = new Combo(composite, SWT.READ_ONLY);
    statusFilterCombo.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
        String value = statusFilterCombo.getText();
        String key = StatusKeyManager.getInstance(project, reviewId).getKey(value);
        updateFilterValue(PropertyConstraints.ATTRIBUTE_VALUE_STATUS, key);
      }
    });
    FormData statusFilterComboData = new FormData();
    statusFilterComboData.top = new FormAttachment(statusCheckButton, 0, SWT.CENTER);
    statusFilterComboData.left = new FormAttachment(statusCheckButton, x + 20, SWT.LEFT);
    statusFilterComboData.right = new FormAttachment(100, 0);
    statusFilterCombo.setLayoutData(statusFilterComboData);
    statusFilterCombo.setEnabled(statusCheckButton.getSelection());
    String statusNameId = PropertyConstraints.ATTRIBUTE_VALUE_STATUS;
    fieldItem = (FieldItem) fieldItemIdFieldItemMap.get(statusNameId);
    if (fieldItem != null) {
      List<String> itemNameList = fieldItem.getEntryNameList();
      statusFilterCombo.setItems(itemNameList.toArray(new String[] {}));
    }
    statusFilterCombo.setText(ReviewI18n.getString(entry.getValueKey()));
    statusCheckButton.addListener(SWT.Selection, new Listener() {
      public void handleEvent(Event event) {
View Full Code Here

TOP

Related Classes of edu.hawaii.ics.csdl.jupiter.file.FieldItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.