Пример #1
0
  /**
   * @param remoteProjectNames since the <code>projectID</code> is no longer the name of the project
   *     this mapping is necessary to display the names on host/inviter side instead of ugly random
   *     numbers projectID => projectName
   */
  public EnterProjectNamePage(
      ISarosSession session,
      IConnectionManager connectionManager,
      PreferenceUtils preferenceUtils,
      List<FileList> fileLists,
      JID peer,
      Map<String, String> remoteProjectNames) {

    super(Messages.EnterProjectNamePage_title);
    this.session = session;
    this.connectionManager = connectionManager;
    this.preferenceUtils = preferenceUtils;
    this.peer = peer;
    this.remoteProjectNames = remoteProjectNames;

    // TODO show per project
    for (FileList fileList : fileLists)
      unsupportedCharsets.addAll(getUnsupportedCharsets(fileList.getEncodings()));

    this.fileLists = fileLists;

    setPageComplete(false);
    setTitle(Messages.EnterProjectNamePage_title2);
  }
Пример #2
0
  @Override
  public void createControl(Composite parent) {
    GridData gridData;

    Composite composite = new Composite(parent, SWT.NONE);
    setControl(composite);

    composite.setLayout(new GridLayout());

    gridData = new GridData(SWT.BEGINNING, SWT.FILL, false, false);
    composite.setLayoutData(gridData);

    TabFolder tabFolder = new TabFolder(composite, SWT.TOP);

    /*
     * grabExcessHorizontalSpace must be true or the tab folder will not
     * display a scroll bar if the wizard is resized
     */
    gridData = new GridData(SWT.BEGINNING, SWT.BEGINNING, true, false);

    /*
     * FIXME this does not work and the wizard may "explode" if too many
     * remote projects are presented
     */
    gridData.widthHint = 400;
    tabFolder.setLayoutData(gridData);

    for (final FileList fileList : fileLists) {

      final String projectID = fileList.getProjectID();

      TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
      tabItem.setText(remoteProjectNames.get(projectID));

      ProjectOptionComposite tabComposite = new ProjectOptionComposite(tabFolder, projectID);

      tabItem.setControl(tabComposite);

      projectOptionComposites.put(projectID, tabComposite);
    }

    Composite vcsComposite = new Composite(composite, SWT.NONE);
    vcsComposite.setLayout(new GridLayout());

    disableVCSCheckbox = new Button(vcsComposite, SWT.CHECK);
    disableVCSCheckbox.setText(GeneralPreferencePage.DISABLE_VERSION_CONTROL_TEXT);
    disableVCSCheckbox.setSelection(!preferenceUtils.useVersionControl());

    Button explainButton = new Button(vcsComposite, SWT.PUSH);
    explainButton.setText("Explain");

    final Label explanation = new Label(vcsComposite, SWT.NONE);
    explanation.setEnabled(false);
    explanation.setText(Messages.Explain_version_control);
    explanation.setVisible(false);
    explainButton.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            explanation.setVisible(true);
          }
        });
    explainButton.pack();
    explanation.pack();
    updateConnectionStatus();

    attachListeners();

    // invokes updatePageComplete for every project id
    preselectProjectNames();
  }