private void handleBranchSelectEnabled(boolean isSelected) {
   setSelectable(true);
   if (ClientSessionManager.isSessionValid() != true) {
     statusLabel.setText(AUTHENTICATION_WARNING_MESSAGE);
     setSelectable(false);
     isSelected = false;
   }
   branchSelectEnabled.setSelection(isSelected);
   branchSelectComposite.setEnabled(isSelected);
   for (Control control : branchSelectComposite.getChildren()) {
     control.setEnabled(isSelected);
   }
 }
  private void createSelectableArea(Composite parent) {
    selectableComposite = new Composite(parent, SWT.NONE);
    selectableComposite.setLayout(new GridLayout());
    selectableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));

    branchSelectEnabled = new Button(selectableComposite, SWT.CHECK);
    branchSelectEnabled.setText(CHECK_BUTTON_TEXT);
    branchSelectEnabled.setToolTipText(CHECK_BUTTON_TOOL_TIP);

    branchSelectEnabled.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            handleBranchSelectEnabled(branchSelectEnabled.getSelection());
          }
        });
    this.branchSelectComposite =
        BranchSelectSimpleComposite.createWorkingBranchSelectComposite(
            selectableComposite, SWT.NONE);
  }
 public void restoreWidgetValues(boolean saveAsArtifact, String[] branchIds, String lastSelected) {
   branchSelectEnabled.setSelection(saveAsArtifact && ClientSessionManager.isSessionValid());
   branchSelectComposite.restoreWidgetValues(branchIds, lastSelected);
 }
 public String[] getBranchIds() {
   return branchSelectComposite.getBranchIds();
 }
 public Branch getSelectedBranch() {
   return branchSelectComposite.getSelectedBranch();
 }