예제 #1
0
  @Inject
  @Optional
  private void whenEnvironmentsWereLoaded(
      @UIEventTopic(RobotProjectConfigEvents.ROBOT_CONFIG_ENV_LOADED) final Environments envs) {
    final List<RobotRuntimeEnvironment> allEnvironments = envs.getAllEnvironments();
    final RobotRuntimeEnvironment env = envs.getActiveEnvironment();

    final RobotProjectConfig configuration = editorInput.getProjectConfiguration();
    final boolean isEditable = editorInput.isEditable();

    if (viewer.getTable() == null || viewer.getTable().isDisposed()) {
      return;
    }

    final boolean isUsingPrefs = configuration.usesPreferences();
    sourceButton.setEnabled(isEditable);

    viewer.setInput(allEnvironments);
    if (env != null) {
      viewer.setCheckedElements(new Object[] {env});
    }
    viewer.getTable().setEnabled(isEditable && !isUsingPrefs);
    viewer.refresh();

    if (env == null) {
      currentFramework.setText(createCurrentFrameworkText("unknown"), true, true);
    } else {
      final String activeText = createActiveFrameworkText(env, isUsingPrefs);
      currentFramework.setText(createCurrentFrameworkText(activeText), true, true);
    }
    currentFramework.getParent().layout();
  }
예제 #2
0
  @Inject
  @Optional
  private void whenEnvironmentLoadingStarted(
      @UIEventTopic(RobotProjectConfigEvents.ROBOT_CONFIG_ENV_LOADING_STARTED)
          final RobotProjectConfig config) {
    currentFramework.setText("", false, false);
    sourceButton.setEnabled(false);
    viewer.getTable().setEnabled(false);

    sourceButton.setSelection(!editorInput.getProjectConfiguration().usesPreferences());
  }