/**
   * 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();
  }
예제 #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();
  }
  /* (non-Javadoc)
   * Initializes the editor part with a site and input.
   */
  public void init(IEditorSite site, IEditorInput input) {
    super.init(site, input);

    TomcatServer ts = (TomcatServer) server.getAdapter(TomcatServer.class);
    try {
      tomcatConfiguration = ts.getTomcatConfiguration();
    } catch (Exception e) {
      // ignore
    }
    addChangeListener();
    initialize();
  }
  /*
   * (non-Javadoc)
   * Initializes the editor part with a site and input.
   */
  public void init(IEditorSite site, IEditorInput input) {
    super.init(site, input);

    GenericServer gserver = (GenericServer) server.getOriginal().getAdapter(GenericServer.class);
    try {
      gserver.getServerInstanceProperties();
      int a = 10;
    } catch (Exception e) {
      log.error(e);
    }
    addChangeListener();
    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));
 }
예제 #6
0
  public void init(IEditorSite site, IEditorInput input) {
    super.init(site, input);

    serverListener =
        new PropertyChangeListener() {

          @Override
          public void propertyChange(PropertyChangeEvent evt) {
            if (updating) {
              return;
            }
            updating = true;
            try {
              if (ISlingLaunchpadServer.PROP_PORT.equals(evt.getPropertyName())) {
                portText.setText(((Integer) evt.getNewValue()).toString());
              } else if (ISlingLaunchpadServer.PROP_DEBUG_PORT.equals(evt.getPropertyName())) {
                debugPortText.setText(((Integer) evt.getNewValue()).toString());
              } else if (ISlingLaunchpadServer.PROP_CONTEXT_PATH.equals(evt.getPropertyName())) {
                contextPathText.setText((String) evt.getNewValue());
              } else if (ISlingLaunchpadServer.PROP_USERNAME.equals(evt.getPropertyName())) {
                usernameText.setText((String) evt.getNewValue());
              } else if (ISlingLaunchpadServer.PROP_PASSWORD.equals(evt.getPropertyName())) {
                passwordText.setText((String) evt.getNewValue());
              }
            } finally {
              updating = false;
            }
          }
        };

    server.addPropertyChangeListener(serverListener);

    launchpadServer = (ISlingLaunchpadServer) server.getAdapter(ISlingLaunchpadServer.class);
    if (launchpadServer == null) {
      // TODO progress monitor
      launchpadServer =
          (ISlingLaunchpadServer)
              server.loadAdapter(ISlingLaunchpadServer.class, new NullProgressMonitor());
    }
  }
예제 #7
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();
  }
예제 #8
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.wst.server.ui.editor.ServerEditorSection#dispose()
   */
  @Override
  public void dispose() {
    if (server != null) server.removePropertyChangeListener(serverListener);

    super.dispose();
  }
 @Override
 public void setServerEditorPart(ServerEditorPart editor) {
   super.setServerEditorPart(editor);
   this.editor = editor;
 }
 public void init(IEditorSite site, IEditorInput input) {
   super.init(site, input);
   this.input = input;
 }