private Collection<IAtsTeamDefinition> getSelectedTeamDefinitions() { return teamCombo.getSelectedTeamDefintions(); }
public void setSelectedTeamDefinitions(Collection<IAtsTeamDefinition> selectedTeamDefs) { if (teamCombo != null) { teamCombo.setSelectedTeamDefs(selectedTeamDefs); teamCombo.notifyXModifiedListeners(); } }
@Override public void widgetCreated( XWidget widget, FormToolkit toolkit, Artifact art, SwtXWidgetRenderer dynamicXWidgetLayout, XModifiedListener modListener, boolean isEditable) { if (widget.getLabel().equals("Group(s)")) { groupWidget = (XHyperlabelGroupSelection) widget; } if (widget.getLabel().equals("Assignee")) { assigneeCombo = (XMembersCombo) widget; } if (widget.getLabel().equals("Include Completed")) { includeCompletedCheckbox = (XCheckBox) widget; } if (widget.getLabel().equals("Include Cancelled")) { includeCancelledCheckbox = (XCheckBox) widget; } if (widget.getLabel().equals("Version")) { versionCombo = (XCombo) widget; versionCombo.getComboBox().setVisibleItemCount(25); widget.setToolTip("Select Team to populate Version list"); } if (widget.getLabel().equals("State")) { stateCombo = (XStateSearchCombo) widget; stateCombo.getComboViewer().getCombo().setVisibleItemCount(25); widget.setToolTip("Select State of Task"); } if (widget.getLabel().equals("Team Definitions(s)")) { teamCombo = (XHyperlabelTeamDefinitionSelection) widget; teamCombo.addXModifiedListener( new XModifiedListener() { @Override public void widgetModified(XWidget widget) { if (versionCombo != null) { try { Collection<IAtsTeamDefinition> teamDefArts = getSelectedTeamDefinitions(); if (teamDefArts.isEmpty()) { versionCombo.setDataStrings(new String[] {}); return; } IAtsTeamDefinition teamDefHoldingVersions = teamDefArts.iterator().next().getTeamDefinitionHoldingVersions(); if (teamDefHoldingVersions == null) { versionCombo.setDataStrings(new String[] {}); return; } Collection<String> names = Versions.getNames( teamDefHoldingVersions.getVersions( VersionReleaseType.Both, VersionLockedType.Both)); if (names.isEmpty()) { versionCombo.setDataStrings(new String[] {}); return; } List<String> namesList = new ArrayList<String>(names); java.util.Collections.sort(namesList); versionCombo.setDataStrings(namesList.toArray(new String[namesList.size()])); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } }); } }