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);
      }
    }
  }