@Override
        public void widgetSelected(SelectionEvent e) {

          final StringBuilder sb = new StringBuilder();

          if (attribute.getSelectionIndex() != -1) {
            sb.append(attribute.getText());
            attribute.deselectAll();
          }

          if (operation.getSelectionIndex() != -1) {
            if (sb.length() > 0) {
              sb.append(" "); // $NON-NLS-1$
            }
            sb.append(operation.getText());
            operation.deselectAll();
          }

          if (value.getSelectionIndex() != -1) {
            if (sb.length() > 0) {
              sb.append(" "); // $NON-NLS-1$
            }
            sb.append(value.getText());
            value.deselectAll();
          }

          if (sb.length() > 0) {
            changed();
            text.insert(sb.toString());
            text.setFocus();
          }
        }
示例#2
0
 /**
  * ************************************************************************* Reset the selection
  * in option buttons ************************************************************************
  */
 private void resetOptions() {
   for (Button opt : m_optionsRadio) {
     opt.setSelection(false);
   }
   if (m_optionsCombo != null) {
     m_optionsCombo.deselectAll();
   }
   m_selectedOption = -1;
 }
示例#3
0
 public void resetUI(Control... controls) {
   for (int i = 0; i < controls.length; i++) {
     if (controls[i] instanceof Text) {
       Text text = (Text) controls[i];
       text.setText("");
     } else if (controls[i] instanceof Combo) {
       Combo combo = (Combo) controls[i];
       combo.deselectAll();
     }
   }
 }
  private void fillFields() {
    if (connection != null) {
      removeListeners();
      String repositoryId = connection.getRepositoryId();
      if (repositoryId == null || "".equals(repositoryId)) {
        if (getRepository() != null) {
          connection.setRepositoryId(getRepository().getId());
        } else {
          connection.setRepositoryId(RepositoryConstants.REPOSITORY_LOCAL_ID);
        }
      }
      IRepositoryFactory repositoriyById =
          RepositoryFactoryProvider.getRepositoriyById(repositoryId);
      repositoryCombo.setSelection(new StructuredSelection(new Object[] {repositoriyById}));

      if (getRepository() != null) {
        Map<String, LabelText> map = dynamicControls.get(getRepository());

        for (String fieldKey : map.keySet()) {
          LabelText current = map.get(fieldKey);
          String string = connection.getDynamicFields().get(fieldKey);
          current.setText(string == null ? "" : string); // $NON-NLS-1$
        }

        Map<String, LabelledCombo> map2 = dynamicChoices.get(getRepository());
        for (String fieldKey : map2.keySet()) {
          Combo combo = map2.get(fieldKey).getCombo();
          String value = connection.getDynamicFields().get(fieldKey);
          combo.deselectAll();
          for (DynamicChoiceBean dynamicChoiceBean : getRepository().getChoices()) {
            if (dynamicChoiceBean.getId().equals(fieldKey)) {
              combo.select(dynamicChoiceBean.getChoiceIndex(value));
            }
          }
        }
      }
      nameText.setText((connection.getName() == null ? "" : connection.getName())); // $NON-NLS-1$
      descriptionText.setText(
          (connection.getDescription() == null ? "" : connection.getDescription())); // $NON-NLS-1$
      userText.setText((connection.getUser() == null ? "" : connection.getUser())); // $NON-NLS-1$
      passwordText.setText(
          (connection.getPassword() == null ? "" : connection.getPassword())); // $NON-NLS-1$
      workSpaceText.setText(
          ("".equals(connection.getWorkSpace()) || connection.getWorkSpace() == null)
              ? getRecentWorkSpace()
              : connection.getWorkSpace()); // $NON-NLS-1$
      addListeners();
    }
  }
 @Override
 public void handleEvent(Event event) {
   if (event.widget == comboMM) {
     setElementCombos(comboMM.getSelectionIndex());
   }
   if (event.widget == comboInput) {
     setInputPortType(comboInput.getSelectionIndex());
     if (isFilter) {
       if (comboInput.getSelectionIndex() == -1) {
         comboOutput.deselectAll();
       } else {
         comboOutput.select(comboInput.getSelectionIndex());
       }
       outputPortType = inputPortType;
     }
   }
   if (event.widget == comboOutput) {
     setOutputPortType(comboOutput.getSelectionIndex());
   }
   updatePageComplete();
 }
  private void setProject(GradleProject project) {
    // TODO: when restoring from persistent conf, can get non-existent projects...
    //  how to handle that case?
    if (this.project == project) // Don't do anything if project is unchanged
    return;

    //		if (this.project!=null) {
    //			this.project.removeModelListener(modelListener);
    //		}
    this.project = project;
    setChecked(Arrays.asList(new String[0]));
    //		if (this.project!=null) {
    //			this.project.addModelListener(modelListener);
    //		}
    setTreeInput(project);
    if (projectCombo != null) {
      if (project != null) {
        projectCombo.setText(project.getName());
      } else {
        projectCombo.deselectAll();
      }
    }
    updateLaunchConfigurationDialog();
  }
 /** deselect All Item of the combo. */
 public void deselectAll() {
   checkbox.setSelection(false);
   combo.setEnabled(false);
   combo.deselectAll();
 }
 @Override
 protected void doSetValue(Object source, Object value) {
   int intValue = value == null ? new Integer(-1) : ((Integer) value).intValue();
   if (intValue == -1) ((Combo) source).deselectAll();
   else ((Combo) source).select(intValue);
 }