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) {