/**
   * Creates and returns the contents of the upper part of the dialog (above the button bar).
   *
   * <p>Subclasses should override.
   *
   * @param ancestor the parent composite to contain the dialog area
   * @return the dialog area control
   */
  protected Control createDialogArea(Composite ancestor) {
    Composite composite = (Composite) super.createDialogArea(ancestor);

    Label comment = new Label(composite, SWT.NONE);
    comment.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_comment);
    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.verticalAlignment = GridData.BEGINNING;
    comment.setLayoutData(data);

    Composite inner = new Composite(composite, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    inner.setLayout(layout);
    inner.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label label = new Label(inner, SWT.NULL);
    label.setText(XMLCompareMessages.XMLCompareEditCopyIdMapDialog_label);
    label.setLayoutData(new GridData());

    fIdMapText = new Text(inner, SWT.BORDER);
    fIdMapText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fIdMapText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            doValidation();
          }
        });

    fIdMapText.setFocus();

    return composite;
  }
コード例 #2
0
  public void createButtonPanel(Shell dialog) {
    Composite buttonPanel = new Composite(dialog, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    buttonPanel.setLayoutData(gridData);
    buttonPanel.setLayout(new GridLayout(4, false));

    String buttonAlign =
        System.getProperty("org.pentaho.di.buttonPosition", "right")
            .toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$

    if (!"left".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
    okButton = new Button(buttonPanel, SWT.PUSH);
    okButton.setText(Messages.getString("VfsFileChooserDialog.ok")); // $NON-NLS-1$
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    okButton.setLayoutData(gridData);
    okButton.addSelectionListener(this);
    cancelButton = new Button(buttonPanel, SWT.PUSH);
    cancelButton.setText(Messages.getString("VfsFileChooserDialog.cancel")); // $NON-NLS-1$
    cancelButton.addSelectionListener(this);
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    cancelButton.setLayoutData(gridData);
    if ("center".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
  }
コード例 #3
0
ファイル: UCEditor.java プロジェクト: bjackson/Party-Master
  /** Create contents of the window. */
  protected void createContents() {
    shlUCEditor = new Shell();
    shlUCEditor.setSize(722, 530);
    shlUCEditor.setText("µC Editor");
    shlUCEditor.setLayout(new GridLayout(1, false));

    Label lblAddElements = new Label(shlUCEditor, SWT.CENTER);
    lblAddElements.setFont(SWTResourceManager.getFont("Lucida Grande", 20, SWT.NORMAL));
    lblAddElements.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
    lblAddElements.setText("Microcontroller Editor");

    table = new Table(shlUCEditor, SWT.BORDER | SWT.FULL_SELECTION);
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    table.setHeaderVisible(true);
    table.setLinesVisible(true);

    TableColumn tblclmnType = new TableColumn(table, SWT.CENTER);
    tblclmnType.setWidth(123);
    tblclmnType.setText("Type");
    // Set not editable
    //		tblclmnType.setData(new UCEditorColumnData(false));

    TableColumn tblclmnName = new TableColumn(table, SWT.CENTER);
    tblclmnName.setWidth(193);
    tblclmnName.setText("Name");

    TableColumn tblclmnId = new TableColumn(table, SWT.CENTER);
    tblclmnId.setWidth(184);
    tblclmnId.setText("Port");

    // Allow the table to be edited
    //		table.addListener(SWT.MouseDoubleClick, new ElementsDoubleClickListener(this, table));

    Label label = new Label(shlUCEditor, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setAlignment(SWT.CENTER);
    label.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));

    Label lblDoubleClickTo = new Label(shlUCEditor, SWT.NONE);
    lblDoubleClickTo.setText("Double click a microcontroller to make changes. ");

    Composite composite = new Composite(shlUCEditor, SWT.NONE);
    composite.setLayout(new GridLayout(1, false));

    Button btnNewButton = new Button(composite, SWT.NONE);
    btnNewButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent arg0) {
            addController();
          }
        });
    btnNewButton.setBounds(0, 0, 94, 28);
    btnNewButton.setText("Add Local Arduino");
  }
コード例 #4
0
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginHeight = layout.marginWidth = 8;
    layout.numColumns = 1;

    layout.makeColumnsEqualWidth = false;
    container.setLayout(layout);
    GridData gd = new GridData(GridData.FILL_BOTH);
    container.setLayoutData(gd);
    Label libraryLabel = new Label(container, SWT.NULL);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    libraryLabel.setLayoutData(gd);
    libraryLabel.setText(PDEUIMessages.ManifestEditor_RuntimeLibraryDialog_label);

    libraryText = new Text(container, SWT.SINGLE | SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    libraryText.setLayoutData(gd);
    libraryText.setText(PDEUIMessages.ManifestEditor_RuntimeLibraryDialog_default);
    libraryText.addModifyListener(
        new ModifyListener() {
          @Override
          public void modifyText(ModifyEvent e) {
            updateStatus(validator.validate(libraryText.getText()));
          }
        });
    applyDialogFont(container);
    return container;
  }
コード例 #5
0
  protected void createServerSelectionControl(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(PHPServerUIMessages.getString("ServerTab.server")); // $NON-NLS-1$
    GridLayout ly = new GridLayout(1, false);
    ly.marginHeight = 0;
    ly.marginWidth = 0;
    group.setLayout(ly);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Composite phpServerComp = new Composite(group, SWT.NONE);
    phpServerComp.setLayout(new GridLayout(4, false));
    phpServerComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    phpServerComp.setFont(parent.getFont());

    Label label = new Label(phpServerComp, SWT.WRAP);
    GridData data = new GridData(GridData.BEGINNING);
    data.widthHint = 100;
    label.setLayoutData(data);
    label.setFont(parent.getFont());
    label.setText(PHPServerUIMessages.getString("ServerLaunchConfigurationTab.0")); // $NON-NLS-1$

    serverCombo = new Combo(phpServerComp, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY);
    serverCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    serverCombo.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            handleServerSelection();
          }
        });

    createNewServer =
        createPushButton(
            phpServerComp, PHPServerUIMessages.getString("ServerTab.new"), null); // $NON-NLS-1$
    createNewServer.addSelectionListener(fListener);

    configureServers =
        createPushButton(
            phpServerComp,
            PHPServerUIMessages.getString("ServerTab.configure"),
            null); //$NON-NLS-1$
    configureServers.addSelectionListener(fListener);

    servers = new ArrayList<Server>();
    populateServerList(servers);

    // initialize the servers list
    if (!servers.isEmpty()) {
      for (int i = 0; i < servers.size(); i++) {
        Server svr = servers.get(i);
        serverCombo.add(svr.getName());
      }
    }

    // select first item in list
    if (serverCombo.getItemCount() > 0) {
      serverCombo.select(0);
    }

    serverCombo.forceFocus();
  }
コード例 #6
0
 private void createUILabel(Composite container) {
   Label label = new Label(container, SWT.WRAP);
   label.setText(CSWizardMessages.RegisterCSWizardPage_label);
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.widthHint = 300;
   label.setLayoutData(data);
 }
コード例 #7
0
 private void createUIDescriptionLabel(Composite parent) {
   Label label = new Label(parent, SWT.NONE);
   label.setText(CSWizardMessages.RegisterCSWizardPage_desc);
   int style = GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END;
   GridData data = new GridData(style);
   label.setLayoutData(data);
 }
コード例 #8
0
  /** Method for creating Length Limit Label and Text */
  protected void createLengthLimit(
      int horizontalSpanLabel,
      int verticalSpanLabel,
      int horizontalSpanText,
      int verticalSpanText,
      int minTextWidth) {
    // Length Limit Label

    lengthLimitLabel = new Label(shell, SWT.NONE);
    lengthLimitLabel.setText("Length limit");
    GridData gridData = new GridData(GridData.END, GridData.CENTER, false, false);
    gridData.horizontalSpan = horizontalSpanLabel;
    gridData.verticalSpan = verticalSpanLabel;
    lengthLimitLabel.setLayoutData(gridData);

    // Length Limit Text

    lengthLimit = new Text(shell, SWT.BORDER);
    lengthLimit.addKeyListener(keyAdapter);
    gridData = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
    gridData.horizontalSpan = horizontalSpanText;
    gridData.verticalSpan = verticalSpanText;
    gridData.widthHint = minTextWidth;
    lengthLimit.setLayoutData(gridData);
  }
コード例 #9
0
  public void createFileNamePanel(Shell dialog, String fileName) {
    Composite fileNamePanel = new Composite(dialog, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    fileNamePanel.setLayoutData(gridData);
    fileNamePanel.setLayout(new GridLayout(2, false));
    Label fileNameLabel = new Label(fileNamePanel, SWT.NONE);
    fileNameLabel.setText(Messages.getString("VfsFileChooserDialog.fileName")); // $NON-NLS-1$
    gridData = new GridData(SWT.FILL, SWT.CENTER, false, false);
    fileNameLabel.setLayoutData(gridData);
    fileNameText = new Text(fileNamePanel, SWT.BORDER);
    if (fileName != null) {
      fileNameText.setText(fileName);
    }
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    fileNameText.setLayoutData(gridData);
    fileNameText.addKeyListener(
        new KeyListener() {

          public void keyPressed(KeyEvent arg0) {}

          public void keyReleased(KeyEvent event) {
            if (event.keyCode == SWT.CR || event.keyCode == SWT.KEYPAD_CR) {
              okPressed();
            }
          }
        });
  }
コード例 #10
0
  private void createLabel(Composite c, int span, String content, Image image, LabelAttributes la) {
    if (content == null && image == null) return;

    Label l = new Label(c, la.getFontStyle());
    GridData gd = new GridData();
    gd.verticalSpan = span;
    gd.horizontalIndent = 5;
    if (content != null) l.setText(content);

    if (image != null) l.setImage(image);
    if (la.getForegroundColor() != null)
      l.setForeground(new Color(DisplayManager.getDefaultDisplay(), la.getForegroundColor()));

    Font initialFont = l.getFont();
    FontData[] fontData = initialFont.getFontData();
    for (int i = 0; i < fontData.length; i++) {
      fontData[i].setHeight(la.getFontSize());
      fontData[i].setStyle(la.getFontStyle());
    }
    Font newFont = new Font(DisplayManager.getDefaultDisplay(), fontData[0]);
    l.setFont(newFont);
    l.pack();

    l.setBackground(c.getBackground());
    l.setLayoutData(gd);
  }
コード例 #11
0
 protected void createSpacer(Composite parent) {
   Label spacer = new Label(parent, SWT.NONE);
   GridData data = new GridData();
   data.horizontalAlignment = GridData.FILL;
   data.verticalAlignment = GridData.BEGINNING;
   data.heightHint = 4;
   spacer.setLayoutData(data);
 }
コード例 #12
0
 private void createImpLabel(Composite container) {
   Label label = new Label(container, SWT.NONE);
   label.setText(PDEUIMessages.TargetImplicitPluginsTab_desc);
   label.setFont(container.getFont());
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = 2;
   label.setLayoutData(gd);
 }
コード例 #13
0
 protected Label createLabel(Composite group, String text) {
   Label label = new Label(group, SWT.NONE);
   label.setText(text);
   GridData gd = new GridData();
   gd.horizontalIndent = 15;
   label.setLayoutData(gd);
   return label;
 }
コード例 #14
0
 private Label createLabel(Composite parent, FormToolkit toolkit, Color color, String labelName) {
   Label label = toolkit.createLabel(parent, labelName);
   label.setForeground(color);
   GridData gd = new GridData();
   gd.horizontalIndent = 10;
   label.setLayoutData(gd);
   return label;
 }
コード例 #15
0
 private Control createEmptyLabel(Composite parent, int verticalSpan) {
   Label emptyLabel = new Label(parent, SWT.NONE);
   GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
   gd.horizontalSpan = 2;
   gd.verticalSpan = verticalSpan;
   gd.widthHint = 0;
   emptyLabel.setLayoutData(gd);
   return emptyLabel;
 }
コード例 #16
0
 private void createUILabelProgress(Composite parent) {
   Label label =
       fToolkit.createLabel(
           parent, PDEUIMessages.SplashConfigurationSection_sectionDescCustomization, SWT.WRAP);
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.horizontalSpan = F_NUM_COLUMNS;
   data.verticalIndent = 5;
   label.setLayoutData(data);
 }
コード例 #17
0
ファイル: MessageBox.java プロジェクト: SiteView/rap
 private void createImage() {
   if (image != null) {
     Label label = new Label(shell, SWT.CENTER);
     GridData data = new GridData(SWT.CENTER, SWT.TOP, false, false);
     data.widthHint = image.getBounds().width + SPACING;
     label.setLayoutData(data);
     label.setImage(image);
   }
 }
コード例 #18
0
  public void createClient(Section section, FormToolkit toolkit) {

    section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    section.setLayoutData(data);

    section.setText(PDEUIMessages.IntroSection_sectionText);
    section.setDescription(PDEUIMessages.IntroSection_sectionDescription);

    boolean canCreateNew = TargetPlatformHelper.getTargetVersion() >= NEW_INTRO_SUPPORT_VERSION;

    Composite client = toolkit.createComposite(section);
    client.setLayout(FormLayoutFactory.createSectionClientGridLayout(false, canCreateNew ? 3 : 2));
    client.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    Label label = toolkit.createLabel(client, PDEUIMessages.IntroSection_introLabel, SWT.WRAP);
    GridData td = new GridData();
    td.horizontalSpan = canCreateNew ? 3 : 2;
    label.setLayoutData(td);

    Label introLabel = toolkit.createLabel(client, PDEUIMessages.IntroSection_introInput);
    introLabel.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));

    fIntroCombo = new ComboPart();
    fIntroCombo.createControl(client, toolkit, SWT.READ_ONLY);
    td = new GridData(GridData.FILL_HORIZONTAL);
    fIntroCombo.getControl().setLayoutData(td);
    loadManifestAndIntroIds(false);
    if (fAvailableIntroIds != null) fIntroCombo.setItems(fAvailableIntroIds);
    fIntroCombo.add(""); // $NON-NLS-1$
    fIntroCombo.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            handleSelection();
          }
        });

    if (canCreateNew) {
      Button button = toolkit.createButton(client, PDEUIMessages.IntroSection_new, SWT.PUSH);
      button.setEnabled(isEditable());
      button.setLayoutData(new GridData(GridData.FILL));
      button.addSelectionListener(
          new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) {
              handleNewIntro();
            }
          });
    }

    fIntroCombo.getControl().setEnabled(isEditable());

    toolkit.paintBordersFor(client);
    section.setClient(client);
    // Register to be notified when the model changes
    getModel().addModelChangedListener(this);
  }
コード例 #19
0
  protected void createLimitTypesGroup() {
    GridData gridData; // Group for lengthLimitButton and shortestPlusKButton

    Group limitTypeGroup = new Group(shell, SWT.NONE);
    limitTypeGroup.setText("Stop distance");
    gridData = new GridData(GridData.FILL, GridData.BEGINNING, false, false);
    gridData.horizontalSpan = 2;
    gridData.verticalSpan = 2;
    limitTypeGroup.setLayoutData(gridData);
    limitTypeGroup.setLayout(new GridLayout(2, true));

    // Length limit radio button

    lengthLimitLabel = new Label(limitTypeGroup, SWT.NONE);
    lengthLimitLabel.setText("Length limit");
    gridData = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
    lengthLimitLabel.setLayoutData(gridData);

    // Length limit text

    lengthLimit = new Text(limitTypeGroup, SWT.BORDER);
    lengthLimit.addKeyListener(keyAdapter);
    gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
    lengthLimit.setLayoutData(gridData);

    // Shortest+k radio button

    shortestPlusKButton = new Button(limitTypeGroup, SWT.CHECK);
    shortestPlusKButton.setText("Shortest+k");
    gridData = new GridData(GridData.BEGINNING, GridData.CENTER, false, false);
    shortestPlusKButton.setLayoutData(gridData);
    shortestPlusKButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent arg0) {
            shortestPlusK.setEnabled(shortestPlusKButton.getSelection());
          }
        });

    // Shortest+k text

    shortestPlusK = new Text(limitTypeGroup, SWT.BORDER);
    shortestPlusK.addKeyListener(keyAdapter);
    gridData = new GridData(GridData.FILL, GridData.CENTER, false, false);
    shortestPlusK.setLayoutData(gridData);

    // Strict check box

    strictButton = new Button(shell, SWT.CHECK | SWT.WRAP);
    strictButton.setText("Ignore source-source/target-target paths");
    gridData = new GridData(GridData.CENTER, GridData.CENTER, false, false);
    gridData.verticalSpan = 2;
    gridData.horizontalSpan = 4;
    strictButton.setLayoutData(gridData);
  }
コード例 #20
0
  private void createLabels(Composite pageContent) {
    Label label = new Label(pageContent, SWT.LEFT);
    label.setText(Messages._UI_LABEL_SOURCE_FILES);

    GridData data = new GridData();
    data.horizontalAlignment = GridData.FILL;
    data.horizontalSpan = 2;
    label.setLayoutData(data);

    label = new Label(pageContent, SWT.LEFT);
    label.setText(Messages._UI_LABEL_SELECTED_FILES);
  }
コード例 #21
0
  /**
   * Create shell for query dialogs
   *
   * @param opt
   */
  protected void createContents(QueryOptionsPack opt) {
    shell = new Shell(getParent(), SWT.RESIZE | SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);

    // Information is added as the first thing into each query dialog.
    infoLabel = new Label(shell, SWT.NONE);
    GridData gridData = new GridData(GridData.FILL, GridData.FILL, false, false);
    // Maximum span within all different query dialogs
    gridData.horizontalSpan = 8;
    gridData.verticalSpan = 6;
    infoLabel.setLayoutData(gridData);
    if (forSIF) selectedTypes = opt.getSifTypes();
  }
コード例 #22
0
ファイル: MessageBox.java プロジェクト: SiteView/rap
 private void createText() {
   Label textLabel = new Label(shell, SWT.WRAP);
   GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
   int imageWidth = image == null ? 0 : image.getBounds().width;
   int maxTextWidth = MAX_WIDTH - imageWidth - SPACING;
   int maxLineWidth = getMaxMessageLineWidth();
   if (maxLineWidth > maxTextWidth) {
     data.widthHint = maxTextWidth;
   }
   textLabel.setLayoutData(data);
   textLabel.setText(message);
 }
コード例 #23
0
  @Override
  public Control contribute(Composite parent) {
    Composite result = new Composite(parent, SWT.INHERIT_DEFAULT);
    result.setLayout(new FormLayout());

    Label separator = new Label(result, SWT.NONE);
    separator.setData(WidgetUtil.CUSTOM_VARIANT, "footer_separator");
    FormData separatorData = new FormData();
    separator.setLayoutData(separatorData);
    separatorData.top = new FormAttachment(0, 0);
    separatorData.left = new FormAttachment(0, 0);
    separatorData.right = new FormAttachment(100, 0);
    separatorData.height = SEPARATOR_HEIGHT;

    Label versionInfo = new Label(result, SWT.NONE);
    versionInfo.setText(getVersionInfo());
    versionInfo.pack();
    FormData versionInfoData = new FormData();
    versionInfo.setLayoutData(versionInfoData);
    Point size = versionInfo.getSize();
    versionInfoData.top = new FormAttachment(50, -(size.y / 2) + (SEPARATOR_HEIGHT / 2));
    versionInfoData.left = new FormAttachment(50, -(size.x / 2));
    return result;
  }
コード例 #24
0
  private void createDescription(Composite container, FormToolkit toolkit) {

    Label label =
        toolkit.createLabel(container, PDEUIMessages.AbstractSchemaDetails_descriptionLabel);
    GridData gd = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gd.horizontalSpan = 3;
    label.setLayoutData(gd);
    label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));

    fDescriptionViewer = new PDESourceViewer(getPage());
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 75;
    gd.widthHint = 60;
    gd.horizontalSpan = 3;
    gd.horizontalIndent = 1;
    /*
     * Needed to align vertically with form entry field and allow space
     * for a possible field decoration
     * commented out for now since fields are already grossly misaligned (see bug 196879)
     * commenting out temporarily makes the alignment better on Element details and Attribute details
     * but worse on RootElement details
     */
    // gd.horizontalIndent = FormLayoutFactory.CONTROL_HORIZONTAL_INDENT;
    fDescriptionViewer.createUI(container, gd);
    fDescriptionViewer
        .getDocument()
        .addDocumentListener(
            new IDocumentListener() {
              @Override
              public void documentChanged(DocumentEvent event) {
                if (blockListeners()) return;
                if (fSchemaObject != null) {
                  // Get the text from the event
                  IDocument document = event.getDocument();
                  if (document == null) {
                    return;
                  }
                  // Get the text from the event
                  String text = document.get().trim();
                  updateObjectDescription(text);
                }
              }

              @Override
              public void documentAboutToBeChanged(DocumentEvent event) {}
            });
  }
コード例 #25
0
  public void createControl(final Shell parent) {
    parent.setLayout(new GridLayout());

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    composite.setLayout(new GridLayout(2, false));

    Label nameLabel = new Label(composite, SWT.NONE);
    nameLabel.setText("Name:");

    GridData gd = new GridData(GridData.FILL);
    gd.widthHint = 100;
    nameLabel.setLayoutData(gd);

    nameText = new Text(composite, SWT.BORDER);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    nameText.setLayoutData(gd);

    Composite buttons = new Composite(parent, SWT.NONE);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalAlignment = GridData.END;
    buttons.setLayoutData(gd);
    buttons.setLayout(new RowLayout());

    Button saveButton = new Button(buttons, SWT.PUSH);
    saveButton.setText("Save");

    saveButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            name = "".equals(nameText.getText()) ? null : nameText.getText();
            action = OK;

            shell.close();
          }
        });

    Button cancelButton = new Button(buttons, SWT.PUSH);
    cancelButton.setText("Cancel");
    cancelButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            shell.close();
          }
        });
  }
コード例 #26
0
 public void createFileFilterPanel(Shell dialog) {
   Composite filterPanel = new Composite(dialog, SWT.NONE);
   GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
   filterPanel.setLayoutData(gridData);
   filterPanel.setLayout(new GridLayout(3, false));
   // create filter label
   Label filterLabel = new Label(filterPanel, SWT.NONE);
   filterLabel.setText(Messages.getString("VfsFileChooserDialog.filter")); // $NON-NLS-1$
   gridData = new GridData(SWT.FILL, SWT.CENTER, false, false);
   filterLabel.setLayoutData(gridData);
   // create file filter combo
   fileFilterCombo = new Combo(filterPanel, SWT.READ_ONLY);
   gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
   fileFilterCombo.setLayoutData(gridData);
   fileFilterCombo.setItems(fileFilterNames);
   fileFilterCombo.addSelectionListener(this);
   fileFilterCombo.select(0);
 }
コード例 #27
0
  public void createURLControl(Composite composite) {
    Group group = new Group(composite, SWT.NONE);
    String projectLabel = PHPServerUIMessages.getString("ServerTab.url"); // $NON-NLS-1$
    group.setText(projectLabel);
    group.setLayout(new GridLayout(2, false));
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    autoGeneratedURL = new Button(group, SWT.CHECK);
    autoGeneratedURL.setText(
        PHPServerUIMessages.getString("ServerTab.autoGenerate")); // $NON-NLS-1$
    autoGeneratedURL.setSelection(true);
    autoGeneratedURL.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 2, 1));
    autoGeneratedURL.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            initializeURLControl();
            updateLaunchConfigurationDialog();
          }
        });

    fURLLabel = new Label(group, SWT.NONE);
    fURLLabel.setText(PHPServerUIMessages.getString("ServerTab.urlLabel")); // $NON-NLS-1$
    GridData gridData = new GridData();
    gridData.horizontalIndent = 20;
    gridData.horizontalSpan = 1;
    fURLLabel.setLayoutData(gridData);

    Composite urlComposite = new Composite(group, SWT.NONE);
    urlComposite.setLayout(new GridLayout(2, false));
    urlComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    fURLHost = new Text(urlComposite, SWT.SINGLE | SWT.BORDER);
    fURLHost.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fURLHost.setEnabled(false);

    fURLPath = new Text(urlComposite, SWT.SINGLE | SWT.BORDER);
    fURLPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fURLPath.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            updateLaunchConfigurationDialog();
          }
        });
  }
コード例 #28
0
    public void init(String labelText) {
      GridLayout lay = new GridLayout();
      lay.numColumns = 1;

      this.setLayout(lay);

      label = new Label(this, SWT.NONE);
      label.setText(labelText == null ? "Gene symbols:" : labelText);
      GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, false);
      gridData.verticalSpan = 1;
      gridData.horizontalSpan = 1;
      label.setLayoutData(gridData);

      symbolText = new Text(this, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
      gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
      gridData.verticalSpan = 1;
      gridData.horizontalSpan = 1;
      symbolText.setLayoutData(gridData);
    }
コード例 #29
0
  /**
   * Creates the contents of this group, using the given toolkit where appropriate so that the
   * controls have the form editor look and feel.
   *
   * @param parent parent composite
   * @param toolkit toolkit to create controls with
   */
  protected void createFormContents(Composite parent, FormToolkit toolkit) {
    fGrouping = GROUP_BY_NONE;

    Composite comp = toolkit.createComposite(parent);
    GridLayout layout = new GridLayout(2, false);
    layout.marginWidth = layout.marginHeight = 0;
    comp.setLayout(layout);
    comp.setLayoutData(new GridData(GridData.FILL_BOTH));
    comp.setFont(parent.getFont());

    createTree(comp, toolkit);
    createButtons(comp, toolkit);

    fCountLabel = toolkit.createLabel(comp, ""); // $NON-NLS-1$
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 2;
    fCountLabel.setLayoutData(data);

    updateButtons();
    initializeFilters();
  }
コード例 #30
0
  public Composite fillGeneralOption(Composite generalTabContent) {

    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    layout.numColumns = 3;
    generalTabContent.setLayout(layout);

    XModel model = getXModel();
    if (model == null) model = XModelFactory.getDefaultInstance();
    support.init(model.getRoot(), data);
    Control c = support.createControl(generalTabContent);
    pcl = new PCL();
    support.addPropertyChangeListener(pcl);

    fWizardModel = getSpecificWizard().getWizardModel();
    mpcl = new MPCL();
    fWizardModel.addPropertyChangeListener(mpcl);

    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 3;
    c.setLayoutData(data);

    data = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
    generalTabContent.setLayoutData(data);

    Label properties = new Label(generalTabContent, SWT.NONE);
    properties.setText(JsfUIMessages.DataTableWizardPage_Properties);
    data = new GridData(GridData.FILL_HORIZONTAL);
    data.horizontalSpan = 3;
    properties.setLayoutData(data);

    propertyListEditor.setObject(propertyListObject);
    Control propertiesTable = propertyListEditor.createControl(generalTabContent);
    data = new GridData(GridData.FILL_BOTH);
    data.horizontalSpan = 3;
    propertiesTable.setLayoutData(data);

    return generalTabContent;
  }