Пример #1
0
  @Override
  public void initialize(final Composite parent) {
    final Section section =
        toolkit.createSection(
            parent,
            ExpandableComposite.EXPANDED | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
    section.setText("Robot framework");
    section.setDescription(
        "Specify which Robot Framework should be used by this project. Currently following framework is in use:");
    GridDataFactory.fillDefaults().grab(true, true).applyTo(section);

    final Composite sectionInternal = toolkit.createComposite(section);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(sectionInternal);
    GridLayoutFactory.fillDefaults().extendedMargins(0, 0, 0, 10).applyTo(sectionInternal);
    section.setClient(sectionInternal);

    createCurrentFrameworkInfo(sectionInternal);
    createSeparator(sectionInternal);
    createSourceButton(sectionInternal);
    createViewer(sectionInternal);
  }
Пример #2
0
  private void createCurrentFrameworkInfo(final Composite parent) {
    currentFramework = toolkit.createFormText(parent, true);
    currentFramework.setImage(IMAGE_FOR_LINK, ImagesManager.getImage(RedImages.getRobotImage()));
    GridDataFactory.fillDefaults().grab(true, false).indent(15, 5).applyTo(currentFramework);

    final IHyperlinkListener hyperlinkListener = createHyperlinkListener();
    currentFramework.addHyperlinkListener(hyperlinkListener);
    currentFramework.addDisposeListener(
        new DisposeListener() {
          @Override
          public void widgetDisposed(final DisposeEvent e) {
            currentFramework.removeHyperlinkListener(hyperlinkListener);
          }
        });
  }
Пример #3
0
  private void createSourceButton(final Composite parent) {
    sourceButton = toolkit.createButton(parent, "Use local settings for this project", SWT.CHECK);
    sourceButton.setEnabled(false);

    sourceButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(final SelectionEvent event) {
            viewer.getTable().setEnabled(sourceButton.getSelection());

            final Object[] elements = viewer.getCheckedElements();
            File file;
            if (elements.length == 1 && sourceButton.getSelection()) {
              final RobotRuntimeEnvironment env = (RobotRuntimeEnvironment) elements[0];
              file = env.getFile();
            } else {
              file = null;
            }
            editorInput.getProjectConfiguration().assignPythonLocation(file);
            setDirty(true);
          }
        });
  }
Пример #4
0
 private void createSeparator(final Composite parent) {
   final Label separator = toolkit.createSeparator(parent, SWT.HORIZONTAL);
   GridDataFactory.fillDefaults().indent(0, 10).applyTo(separator);
 }