/**
   * Creates the SWT controls for this workbench part.
   *
   * @param parent the parent control
   */
  public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());

    Section section =
        toolkit.createSection(
            parent,
            ExpandableComposite.TWISTIE
                | ExpandableComposite.EXPANDED
                | ExpandableComposite.TITLE_BAR
                | Section.DESCRIPTION
                | ExpandableComposite.FOCUS_TITLE);
    section.setText("Ports");
    section.setDescription("Modify the server ports.");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));

    // ports
    Composite composite = toolkit.createComposite(section);
    GridLayout layout = new GridLayout();
    layout.marginHeight = 8;
    layout.marginWidth = 8;
    composite.setLayout(layout);
    composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL));
    // IWorkbenchHelpSystem whs = PlatformUI.getWorkbench().getHelpSystem();
    // whs.setHelp(composite, ContextIds.CONFIGURATION_EDITOR_PORTS);
    toolkit.paintBordersFor(composite);
    section.setClient(composite);

    ports = toolkit.createTable(composite, SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION);
    ports.setHeaderVisible(true);
    ports.setLinesVisible(true);
    // whs.setHelp(ports, ContextIds.CONFIGURATION_EDITOR_PORTS_LIST);

    TableLayout tableLayout = new TableLayout();

    TableColumn col = new TableColumn(ports, SWT.NONE);
    col.setText("Port Name");
    ColumnWeightData colData = new ColumnWeightData(15, 150, true);
    tableLayout.addColumnData(colData);

    col = new TableColumn(ports, SWT.NONE);
    col.setText("Value");
    colData = new ColumnWeightData(8, 80, true);
    tableLayout.addColumnData(colData);

    GridData data = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL);
    data.widthHint = 230;
    data.heightHint = 100;
    ports.setLayoutData(data);
    ports.setLayout(tableLayout);

    viewer = new TableViewer(ports);
    viewer.setColumnProperties(new String[] {"name", "port"});

    initialize();
  }
Ejemplo n.º 2
0
  @Override
  public void createSection(Composite parent) {
    super.createSection(parent);
    FormToolkit toolkit = getFormToolkit(parent.getDisplay());

    Section section =
        toolkit.createSection(
            parent,
            ExpandableComposite.TWISTIE
                | ExpandableComposite.EXPANDED
                | ExpandableComposite.TITLE_BAR
                | Section.DESCRIPTION
                | ExpandableComposite.FOCUS_TITLE);
    section.setText("Connection");
    section.setDescription("Connection details for this server");
    section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));

    // ports
    Composite composite = toolkit.createComposite(section);

    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    layout.marginHeight = 8;
    layout.marginWidth = 8;
    composite.setLayout(layout);
    GridData gridData = new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.FILL_HORIZONTAL);
    composite.setLayoutData(gridData);
    toolkit.paintBordersFor(composite);
    section.setClient(composite);

    createLabel(toolkit, composite, "Port");
    portText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Debug Port");
    debugPortText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Context path");
    contextPathText = createText(toolkit, composite, SWT.SINGLE);

    // TODO wrong parent
    Label separator = toolkit.createSeparator(parent, SWT.HORIZONTAL);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    separator.setLayoutData(data);

    createLabel(toolkit, composite, "Username");
    usernameText = createText(toolkit, composite, SWT.SINGLE);

    createLabel(toolkit, composite, "Password");
    passwordText = createText(toolkit, composite, SWT.PASSWORD);

    initialize();
  }
 public void createSection(Composite parent) {
   super.createSection(parent);
   FormToolkit toolkit2 = new FormToolkit(parent.getDisplay());
   Section publishTypeSection =
       toolkit2.createSection(
           parent,
           ExpandableComposite.TWISTIE
               | ExpandableComposite.EXPANDED
               | ExpandableComposite.TITLE_BAR);
   publishTypeSection.setText(Messages.ServerBehavior);
   Control c = createPublishMethodComposite(publishTypeSection);
   publishTypeSection.setClient(c);
   publishTypeSection.setLayoutData(
       new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_FILL));
 }
Ejemplo n.º 4
0
  public void createSection(Composite parent) {

    // Don't create section if CF server is not the Pivotal CF server
    if (!CloudFoundryURLNavigation.canEnableCloudFoundryNavigation(getCloudFoundryServer())) {
      return;
    }
    super.createSection(parent);

    FormToolkit toolkit = getFormToolkit(parent.getDisplay());

    Section section =
        toolkit.createSection(parent, ExpandableComposite.TWISTIE | ExpandableComposite.TITLE_BAR);
    section.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
    section.setText(Messages.SpringInsightSection_TEXT_SPRING_INSIGHT);
    section.setExpanded(false);

    Composite composite = toolkit.createComposite(section);
    section.setClient(composite);

    GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 5).applyTo(composite);
    GridDataFactory.fillDefaults().grab(true, false).applyTo(composite);

    new GoToSpringLinkWidget(composite, toolkit).createControl();
  }