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

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


   */
  public boolean performFinish() {
    Map<String, List<String>> categoryMap = new TreeMap<String, List<String>>();
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String defaultReviewID =  PropertyConstraints.DEFAULT_REVIEW_ID;
    ReviewResource reviewResource = propertyResource.getReviewResource(defaultReviewID, true);
    if (reviewResource != null) {
      Map<String, ReviewerId> reviewers = reviewerPage.getReviewers();
      String reviewIdString = reviewIdPage.getReviewId();
      String description = reviewIdPage.getDescription();
      String author = authorPage.getAuthor();
      String directory = storagePage.getDirectory();
      try {
        Date date = new Date();
        ReviewId reviewId = new ReviewId(reviewIdString, description, author,
                                         directory, reviewers, categoryMap, date);
        reviewResource.setReviewId(reviewId);
        reviewResource.setTargetFiles(filePage.getFiles());
        String typeKey = PropertyConstraints.ATTRIBUTE_VALUE_TYPE;
        reviewResource.setDefaultField(typeKey, defaultItemsPage.getDefaultTypeKey());
        String severityKey = PropertyConstraints.ATTRIBUTE_VALUE_SEVERITY;
        reviewResource.setDefaultField(severityKey, defaultItemsPage.getDefaultSeverityKey());
        String resolutionKey = PropertyConstraints.ATTRIBUTE_VALUE_RESOLUTION;
        reviewResource.setDefaultField(resolutionKey, defaultItemsPage.getDefaultResolutionKey());
        String statusKey = PropertyConstraints.ATTRIBUTE_VALUE_STATUS;
        reviewResource.setDefaultField(statusKey, defaultItemsPage.getDefaultStatusKey());
        reviewResource.setFieldItemMap(this.itemEntriesPage.getFieldItemIdFieldItemMap());
        reviewResource.setPhaseNameFilterPhaseMap(this.filterPage.getPhaseNameFilterPhaseMap());
        return propertyResource.addReviewResource(reviewResource);
      }
      catch (Exception e) {
        log.error(e);
        e.printStackTrace();
View Full Code Here


    storageLabel.setText(ReviewI18n.getString("ReviewIdEditDialog.label.storage"));
    this.storageText = new Text(composite, SWT.BORDER);
    IProject project = FileResource.getProject(this.project);
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String defaultReviewId = PropertyConstraints.DEFAULT_REVIEW_ID;
    ReviewResource reviewResource = propertyResource.getReviewResource(defaultReviewId, true);
    if (reviewResource != null) {
      storageText.setText(reviewResource.getReviewId().getDirectory());
    }
   
    FormData storageLabelData = new FormData();
    storageLabelData.width = (int) (clientWidth * RATIO);
    storageLabelData.top = new FormAttachment(storageText, 0, SWT.CENTER);
View Full Code Here

   * @return the control.
   */
  private Control createDefaultItems(Composite composite) {
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String reviewIdString = PropertyConstraints.DEFAULT_REVIEW_ID;
    ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
    ReviewId reviewId = null;
    if (reviewResource != null) {
      reviewId = reviewResource.getReviewId();
    }
    IWizardPage page = getWizard().getPage(ReviewIdNewWizard.PAGE_ITEM_ENTRIES);
    ReviewIdNewItemEntriesPage itemEntryPage = (ReviewIdNewItemEntriesPage) page;
    final Map<String, FieldItem> fieldItemIdFieldItemMap = itemEntryPage
        .getFieldItemIdFieldItemMap();

    // create type label and its combo.
    Label typeLabel = new Label(composite, SWT.NONE);
    typeLabel.setText(ReviewI18n.getString("ReviewIdEditDialog.label.type"));
    this.typeCombo = new Combo(composite, SWT.READ_ONLY);
    typeCombo.setData(typeCombo);
    TypeKeyManager manager = TypeKeyManager.getInstance(project, reviewId);
    String[] elements = (reviewId != null) ? manager.getElements() : new String[] { "" };
    typeCombo.setItems(elements);
    String typeName = PropertyConstraints.ATTRIBUTE_VALUE_TYPE;
    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;
View Full Code Here

      tableView = ReviewTableView.bringViewToTop();
    }
    tableView.createColumns(columnDataModel);
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String reviewIdString = reviewId.getReviewId();
    ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
    IPreferenceStore store = ReviewPlugin.getInstance().getPreferenceStore();
    String prefFilterKey = FilterPreferencePage.ENABLE_FILTER_STORE_KEY;
    boolean isPrefFilterEnabled = store.getBoolean(prefFilterKey);
    if (isPrefFilterEnabled) {
      tableView.setFilterStatus(isPrefFilterEnabled);
    }
    else {
      if (reviewResource != null) {
        FilterPhase filterPhase = reviewResource.getFilterPhase(reviewPhaseNameKey);
        tableView.setFilterStatus(filterPhase.isEnabled());
      }
    }
   
    // Opens editor view.
View Full Code Here

      view = ReviewTableView.bringViewToTop();
    }
    view.createColumns(columnDataModel);
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String reviewIdString = reviewId.getReviewId();
    ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
    IPreferenceStore store = ReviewPlugin.getInstance().getPreferenceStore();
    String prefFilterKey = FilterPreferencePage.ENABLE_FILTER_STORE_KEY;
    boolean isPrefFilterEnabled = store.getBoolean(prefFilterKey);
    if (isPrefFilterEnabled) {
      view.setFilterStatus(isPrefFilterEnabled);
    }
    else {
      if (reviewResource != null) {
        FilterPhase filterPhase = reviewResource.getFilterPhase(reviewPhaseNameKey);
        view.setFilterStatus(filterPhase.isEnabled());
      }
    }
   
    // Opens editor view.
View Full Code Here

  public static ViewerFilter createFilterFromProperty(IProject project, ReviewId reviewId,
                                                     String phaseNameKey) {
    ReviewFilter filter = new ReviewFilter();
    PropertyResource propertyResource = PropertyResource.getInstance(project, true);
    String reviewIdString = reviewId.getReviewId();
    ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
    FilterPhase filterPhase = reviewResource.getFilterPhase(phaseNameKey);
    if (reviewResource != null && filterPhase.isEnabled()) {
      String intervalName = PropertyConstraints.ATTRIBUTE_VALUE_INTERVAL;
      FilterEntry entry = filterPhase.getFilterEntry(intervalName);
      if (entry != null && entry.isEnabled()) {
        int interval = 0;
View Full Code Here

        view = ReviewTableView.bringViewToTop();
      }
      view.createColumns(columnDataModel);
      PropertyResource propertyResource = PropertyResource.getInstance(project, true);
      String reviewIdString = reviewId.getReviewId();
      ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
      if (reviewResource != null) {
        FilterPhase filterPhase = reviewResource.getFilterPhase(reviewPhaseNameKey);
        view.setFilterStatus(filterPhase.isEnabled());
      }
    }
    else {
      reviewIssueModelManager.getCurrentModel();
View Full Code Here

   * @return the control.
   */
  private Control createItemEntriesContent(Composite composite) {
    PropertyResource propertyResource = PropertyResource.getInstance(this.project, true);
    String reviewIdString = PropertyConstraints.DEFAULT_REVIEW_ID;
    ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
    if (reviewResource != null) {
      this.fieldItemIdFieldItemMap = reviewResource.getFieldItemMap();
      this.fieldItemIdList = reviewResource.getFieldItemIdList();
    }
    this.itemCombo = new Combo(composite, SWT.READ_ONLY);
    itemCombo.setData(itemCombo);
    itemCombo.setItems(fieldItemIdList.toArray(new String[] {}));
    itemCombo.setText(fieldItemIdList.get(0));
View Full Code Here

   */
  protected void restoreItemEntries() {
    // read from .jupiter.
    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

    final IProject project = reviewModel.getProjectManager().getProject();
    ReviewId reviewId = reviewModel.getReviewIdManager().getReviewId();
    if (project != null && reviewId != null) {
      PropertyResource propertyResource = PropertyResource.getInstance(project, false);
      String reviewIdString = reviewId.getReviewId();
      ReviewResource reviewResource = propertyResource.getReviewResource(reviewIdString, true);
     
      // Get current editor file to highlight it if it is in the list of
      // our review files
      IFile activeFile = FileResource.getActiveFile();
      String activeFileName = null;
      if (activeFile != null) {
        activeFileName = activeFile.getProjectRelativePath().toString();       
      }

      if (reviewResource != null) {
        Set<String> targetFileSet = reviewResource.getFileSet();
        int index = 0;
        if (targetFileSet.size() > 0) {
          for (Iterator<String> i = targetFileSet.iterator(); i.hasNext(); index++) {
            MenuItem menuItem = new MenuItem(menu, SWT.NONE);
            String targetFile = (String) i.next();
View Full Code Here

TOP

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

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.