private void showHideDynamicsControls() {
    // PTODO SML Optimize
    // 1. Hide all controls:
    for (IRepositoryFactory f : dynamicControls.keySet()) {
      for (LabelText control : dynamicControls.get(f).values()) {
        control.setVisible(false);
      }

      for (Button control : dynamicButtons.get(f).values()) {
        control.setVisible(false);
      }

      for (LabelledCombo control : dynamicChoices.get(f).values()) {
        control.setVisible(false);
      }
    }

    // 2. Show active repository controls:
    if (getRepository() != null) {
      for (LabelText control : dynamicControls.get(getRepository()).values()) {
        control.setVisible(true);
      }

      for (Button control : dynamicButtons.get(getRepository()).values()) {
        control.setVisible(true);
      }

      for (LabelledCombo control : dynamicChoices.get(getRepository()).values()) {
        control.setVisible(true);
      }
    }
  }
  private void removeListeners() {
    repositoryCombo.removePostSelectionChangedListener(repositoryListener);
    nameText.removeModifyListener(standardTextListener);
    descriptionText.removeModifyListener(standardTextListener);
    userText.removeModifyListener(standardTextListener);
    passwordText.removeModifyListener(standardTextListener);

    for (IRepositoryFactory f : dynamicControls.keySet()) {
      for (LabelText control : dynamicControls.get(f).values()) {
        control.removeModifyListener(standardTextListener);
      }
    }

    for (IRepositoryFactory f : dynamicChoices.keySet()) {
      for (LabelledCombo control : dynamicChoices.get(f).values()) {
        control.getCombo().removeModifyListener(standardTextListener);
      }
    }
  }
  private void showHideDynamicsControls() {
    // PTODO SML Optimize
    // 1. Hide all controls:
    for (IRepositoryFactory f : dynamicControls.keySet()) {
      for (LabelText control : dynamicControls.get(f).values()) {
        // control.setVisible(false);
        hideControl(control.getLabelControl(), true, false);
        hideControl(control.getTextControl(), true, false);
      }

      for (Button control : dynamicButtons.get(f).values()) {
        // control.setVisible(false);
        hideControl(control, true, false);
      }

      for (LabelledCombo control : dynamicChoices.get(f).values()) {
        // control.setVisible(false);
        hideControl(control.getCombo(), true, false);
      }
    }

    // 2. Show active repository controls:
    if (getRepository() != null) {
      for (LabelText control : dynamicControls.get(getRepository()).values()) {
        // control.setVisible(true);
        hideControl(control.getLabelControl(), false, false);
        hideControl(control.getTextControl(), false, false);
      }

      for (Button control : dynamicButtons.get(getRepository()).values()) {
        // control.setVisible(true);
        hideControl(control, false, false);
      }

      for (LabelledCombo control : dynamicChoices.get(getRepository()).values()) {
        // control.setVisible(true);
        hideControl(control.getCombo(), false, false);
      }
    }
    nameText.getParent().layout();
  }
  private void addListeners() {
    repositoryCombo.addPostSelectionChangedListener(repositoryListener);
    nameText.addModifyListener(standardTextListener);
    descriptionText.addModifyListener(standardTextListener);
    userText.addModifyListener(standardTextListener);
    passwordText.addModifyListener(standardTextListener);
    workSpaceText.addModifyListener(standardTextListener);

    for (IRepositoryFactory f : dynamicControls.keySet()) {
      for (LabelText control : dynamicControls.get(f).values()) {
        control.addModifyListener(standardTextListener);
      }
    }

    for (IRepositoryFactory f : dynamicChoices.keySet()) {
      for (LabelledCombo control : dynamicChoices.get(f).values()) {
        control.getCombo().addModifyListener(standardTextListener);
      }
    }

    deleteProjectsButton.addSelectionListener(deleteProjectClickListener);
  }
Example #5
0
  private Control createSelectionArea(Composite parent) {
    Composite inner = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout();
    gridLayout.marginHeight = 0;
    inner.setLayout(gridLayout);
    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    gridData.minimumWidth = 220;
    gridData.minimumHeight = 150;
    inner.setLayoutData(gridData);

    Group group = new Group(inner, SWT.NONE);
    group.setText(Messages.getString("ContextSetsSelectionDialog.ContextSets")); // $NON-NLS-1$
    gridLayout = new GridLayout();
    gridLayout.horizontalSpacing = 10;
    group.setLayout(new GridLayout(2, false));
    group.setLayoutData(new GridData(GridData.FILL_BOTH));

    combo = new LabelledCombo(group, null, null, contextSetsList, true);
    combo.setText(defalutContext + DEFAULT_FLAG);
    return inner;
  }
Example #6
0
 @Override
 protected void okPressed() {
   selectedContext = combo.getItem(combo.getSelectionIndex());
   super.okPressed();
 }