private void stateDefinitionsComboSelected() { StateDefinition selectedStateDefinition = stateDefinitionsCombo.getSelectedElement(); boolean isSelectAll = selectedStateDefinition.equals(ALL_STATE_DEFINITION); if (isSelectAll) { getQuery().setJbpmNodeName(null); getQuery().setFieldEnabled(IssueQuery.FieldName.jbpmNodeName, false); } else { getQuery().setJbpmNodeName(selectedStateDefinition.getJbpmNodeName()); getQuery().setFieldEnabled(IssueQuery.FieldName.jbpmNodeName, true); } }
@Override public String getText(Object element) { if (element instanceof StateDefinition) { StateDefinition stateDefinition = (StateDefinition) element; return (stateDefinition.getProcessDefinitionID() == null ? "" : stateDefinition.getProcessDefinitionID() + ":") + stateDefinition.getName().getText(); // $NON-NLS-1$ //$NON-NLS-2$ } return super.getText(element); }
@Override protected void updateUI(QueryEvent event, List<FieldChangeCarrier> changedFields) { for (FieldChangeCarrier changedField : event.getChangedFields()) { if (IssueQuery.FieldName.processDefinitionID.equals(changedField.getPropertyName())) { ProcessDefinitionID newProcessDefinitionID = (ProcessDefinitionID) changedField.getNewValue(); if (newProcessDefinitionID == null) { processDefinitionsCombo.setSelection(ALL_PROCESS_DEFINITION); } else { for (ProcessDefinition processDefinition : processDefinitionsCombo.getElements()) { if (processDefinition != ALL_PROCESS_DEFINITION) if (JDOHelper.getObjectId(processDefinition).equals(newProcessDefinitionID)) { processDefinitionsCombo.setSelection(processDefinition); this.selectedProcessDefinition = processDefinition; break; } } } } else if (getEnableFieldName(IssueQuery.FieldName.processDefinitionID) .equals(changedField.getPropertyName())) { boolean isActive = (Boolean) changedField.getNewValue(); setSearchSectionActive(isActive); if (!isActive) { getQuery().setProcessDefinitionID(null); } } else if (IssueQuery.FieldName.jbpmNodeName.equals(changedField.getPropertyName())) { String newJbpmNodeName = (String) changedField.getNewValue(); if (newJbpmNodeName == null) { stateDefinitionsCombo.setSelection(ALL_STATE_DEFINITION); } else { for (StateDefinition stateDefinition : stateDefinitionsCombo.getElements()) { if (stateDefinition.getJbpmNodeName() != null && stateDefinition.getJbpmNodeName().equals(newJbpmNodeName)) { stateDefinitionsCombo.setSelection(stateDefinition); this.selectedStateDefinition = stateDefinition; break; } } } } else if (getEnableFieldName(IssueQuery.FieldName.jbpmNodeName) .equals(changedField.getPropertyName())) { boolean isActive = (Boolean) changedField.getNewValue(); setSearchSectionActive(isActive); if (!isActive) { getQuery().setJbpmNodeName(null); } } } // for (FieldChangeCarrier changedField : event.getChangedFields()) }