コード例 #1
0
  private void createTitleGroup(Composite parent) {
    Composite group = new Composite(parent, SWT.NONE);

    GridLayout layout = new GridLayout(2, false);
    group.setLayout(layout);

    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 1;
    group.setLayoutData(gd);

    Label label = new Label(group, SWT.NONE);
    label.setText(Messages.WebQueryWizardPage_Query_Title_);

    title = new Text(group, SWT.BORDER);
    title.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL));
    title.setText(
        getQuery() == null ? getDefaultQueryTitle(getTaskRepository()) : getQuery().getSummary());
    title.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            setPageComplete(isPageComplete());
          }
        });
    title.setFocus();
  }
コード例 #2
0
  public void addDescriptionRow(String sectionName) {
    RowData rowdata = (RowData) descriptionGroup.getLayoutData();
    rowdata.height += 60;
    descriptionGroup.setLayoutData(new RowData(rowdata.width, rowdata.height));
    Rectangle rect = descriptionGroup.getBounds();
    rect.height += 60;
    descriptionGroup.setBounds(rect);

    /*Add the row*/
    Text prevText = sections.get(new Integer(secCount - 1)).getEndTokens();
    rect = prevText.getBounds();
    Text newText_1 = new Text(descriptionGroup, SWT.BORDER);
    newText_1.setBounds(10, rect.y + 40, 75, 20);
    newText_1.setFocus();

    Label lblNew = new Label(descriptionGroup, SWT.NONE);
    lblNew.setBounds(120, rect.y + 40, 145, 20);
    lblNew.setText(sectionName);

    Text newText_2 = new Text(descriptionGroup, SWT.BORDER);
    newText_2.setBounds(270, rect.y + 40, 115, 20);

    Text newText_3 = new Text(descriptionGroup, SWT.BORDER);
    newText_3.setBounds(420, rect.y + 40, 115, 20);

    Text newText_4 = new Text(descriptionGroup, SWT.BORDER);
    newText_4.setBounds(570, rect.y + 40, 115, 20);
    sections.put(
        new Integer(secCount), new SectionBean(newText_1, lblNew, newText_2, newText_3, newText_4));
    secCount++;

    descScrolledComposite.setMinSize(descriptionGroup.computeSize(SWT.DEFAULT, SWT.DEFAULT));
  }
コード例 #3
0
ファイル: MultipageWizard.java プロジェクト: alevy/comet
  private void createControls() {
    GridLayout gLayout = new GridLayout();
    gLayout.marginHeight = 0;
    gLayout.marginWidth = 0;
    gLayout.verticalSpacing = 0;
    shell.setLayout(gLayout);
    Utils.setShellIcon(shell);

    topPanel = new Composite(shell, SWT.NONE);
    topPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    GridLayout gLayout1 = new GridLayout();
    gLayout1.marginBottom = 10;
    topPanel.setLayout(gLayout1);
    topPanel.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    topPanel.setBackgroundMode(SWT.INHERIT_FORCE);

    Label separator1 = new Label(shell, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator1.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    contentPanel = new Composite(shell, SWT.NONE);
    contentPanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    contentStackLayout = new StackLayout();
    contentPanel.setLayout(contentStackLayout);

    titleLabel = new Label(topPanel, SWT.NONE);
    titleLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    Utils.setFontHeight(titleLabel, 16, SWT.NORMAL);

    descriptionLabel = new Label(topPanel, SWT.WRAP);
    GridData gData = new GridData(SWT.FILL, SWT.FILL, true, true);
    gData.horizontalIndent = 10;
    descriptionLabel.setLayoutData(gData);

    shell.layout(true, true);
  }
コード例 #4
0
  /**
   * Creates the project name specification controls.
   *
   * @param parent the parent composite
   */
  private final void createProjectNameGroup(Composite parent) {

    Font dialogFont = parent.getFont();

    // project specification group
    Composite projectGroup = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    projectGroup.setFont(dialogFont);
    projectGroup.setLayout(layout);
    projectGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // new project label
    Label projectLabel = new Label(projectGroup, SWT.NONE);
    projectLabel.setText(DataTransferMessages.WizardExternalProjectImportPage_nameLabel);
    projectLabel.setFont(dialogFont);

    // new project name entry field
    projectNameField = new Text(projectGroup, SWT.BORDER | SWT.READ_ONLY);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.widthHint = SIZING_TEXT_FIELD_WIDTH;
    projectNameField.setLayoutData(data);
    projectNameField.setFont(dialogFont);
    projectNameField.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
  }
コード例 #5
0
ファイル: Sleak.java プロジェクト: cbsrbiobank/biobank
 void layout() {
   Rectangle rect = shell.getClientArea();
   // String[] strings = new String[objects.length];
   int width = 0;
   String[] items = list.getItems();
   GC gc = new GC(list);
   for (int i = 0; i < objects.length; i++) {
     width = Math.max(width, gc.stringExtent(items[i]).x);
   }
   gc.dispose();
   Point size1 = start.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size2 = stop.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size3 = check.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   Point size4 = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
   width = Math.max(size1.x, Math.max(size2.x, Math.max(size3.x, width)));
   width = Math.max(64, Math.max(size4.x, list.computeSize(width, SWT.DEFAULT).x));
   start.setBounds(0, 0, width, size1.y);
   stop.setBounds(0, size1.y, width, size2.y);
   check.setBounds(0, size1.y + size2.y, width, size3.y);
   label.setBounds(0, rect.height - size4.y, width, size4.y);
   int height = size1.y + size2.y + size3.y;
   list.setBounds(0, height, width, rect.height - height - size4.y);
   text.setBounds(width, 0, rect.width - width, rect.height);
   canvas.setBounds(width, 0, rect.width - width, rect.height);
 }
コード例 #6
0
 private static void createLabel(Composite parent, int ncol, String t) {
   Label line = new Label(parent, SWT.HORIZONTAL | SWT.BOLD);
   line.setText(t);
   GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
   gridData.horizontalSpan = ncol;
   line.setLayoutData(gridData);
 }
コード例 #7
0
  private Composite addOrderEntryChoices(Composite buttonComposite) {
    Label enterLabel = new Label(buttonComposite, SWT.NONE);
    enterLabel.setText(CodeInsertionDialog.insertionPoint);
    if (!enableInsertPosition) enterLabel.setEnabled(false);
    GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
    enterLabel.setLayoutData(gd);

    final Combo enterCombo = new Combo(buttonComposite, SWT.READ_ONLY);
    enterCombo.setVisibleItemCount(COMBO_VISIBLE_ITEM_COUNT);
    if (!enableInsertPosition) enterCombo.setEnabled(false);
    enterCombo.setItems(fLabels.toArray(new String[fLabels.size()]));
    enterCombo.select(currentPositionIndex);

    gd = new GridData(GridData.FILL_BOTH);
    gd.widthHint = convertWidthInCharsToPixels(60);
    enterCombo.setLayoutData(gd);
    enterCombo.addSelectionListener(
        new SelectionAdapter() {

          @Override
          public void widgetSelected(SelectionEvent e) {
            int index = enterCombo.getSelectionIndex();
            setInsertPosition(index);
            System.out.println(getElementPosition().toString());
          }
        });

    return buttonComposite;
  }
コード例 #8
0
  public void createProjectControls(Composite parent, int nColumns) {

    Label locationLabel = new Label(parent, SWT.NONE);
    locationLabel.setText("Project:");
    locationLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

    projectCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
    GridData data = new GridData(SWT.FILL, SWT.CENTER, true, false);
    data.horizontalSpan = 2;
    projectCombo.setLayoutData(data);
    projectCombo.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            projectText = projectCombo.getText();
            projectChanged();
          }
        });
    gwtProjects = Util.getGwtProjects();
    for (int i = 0; i < gwtProjects.length; i++) {
      IJavaProject gwtProject = gwtProjects[i];
      String name = gwtProject.getProject().getName();
      projectCombo.add(name);
      if (name.equals(selectedProject)) projectCombo.select(i);
    }
    if (projectCombo.getSelectionIndex() == -1) projectCombo.select(0);

    new Label(parent, SWT.NONE);
  }
コード例 #9
0
 private void createLabel(Composite c, String text) {
   Label l = new Label(c, SWT.NONE);
   l.setText(text);
   GridData gd = new GridData();
   gd.horizontalAlignment = SWT.RIGHT;
   l.setLayoutData(gd);
 }
 private void addSeparator(Composite parent) {
   Label separator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL);
   GridData gridData = new GridData();
   gridData.horizontalAlignment = GridData.FILL;
   gridData.grabExcessHorizontalSpace = true;
   separator.setLayoutData(gridData);
 }
  private void addProjectsSection(Composite parent) {
    Composite composite = createComposite(parent, 1, true);
    initializeDialogUnits(composite);

    Label label = new Label(composite, SWT.NONE);
    label.setText(PROJECTS_TEXT);

    projectList = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
    projectList.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
    projectList.setLabelProvider(
        new LabelProvider() {
          @Override
          public Image getImage(Object element) {
            return PlatformUI.getWorkbench()
                .getSharedImages()
                .getImage(IDE.SharedImages.IMG_OBJ_PROJECT);
          }

          @Override
          public String getText(Object element) {
            return ((IProject) element).getName();
          }
        });

    // Filter out closed projects!
    ArrayList<IProject> projects = new ArrayList<IProject>();
    for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
      if (project.isOpen()) projects.add(project);
    }
    projectList.setContentProvider(new ArrayContentProvider());
    projectList.setInput(projects);

    Dialog.applyDialogFont(composite);
  }
コード例 #12
0
ファイル: DataSetWizard.java プロジェクト: Tagin/aurora-ide
 public void createControl(Composite parent) {
   Composite content = new Composite(parent, SWT.NONE);
   content.setLayout(new GridLayout(2, false));
   Label label = new Label(content, SWT.CANCEL);
   label.setText(LocaleMessage.getString("please.input.id"));
   final Text text = new Text(content, SWT.NONE);
   text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   text.addModifyListener(
       new ModifyListener() {
         public void modifyText(ModifyEvent e) {
           if (text.getText() != null && !(text.getText().equals(""))) {
             Set ids = new HashSet();
             CompositeMapUtil.collectAttribueValues(ids, "id", parentCM.getRoot());
             if (ids.contains(text.getText())) {
               setErrorMessage(LocaleMessage.getString("This.id.has.exists.please.change.it"));
               setPageComplete(false);
               return;
             }
             setErrorMessage(null);
             id = text.getText();
             setPageComplete(true);
           } else {
             setErrorMessage(LocaleMessage.getString("id.can.not.be.null"));
             setPageComplete(false);
           }
         }
       });
   setControl(content);
 }
コード例 #13
0
  public ParamBoolean(Composite parent, int style, String key, String label, boolean labelFirst) {
    super(parent, style);

    this.key = key;
    this.label = label;

    this.setLayout(new GridLayout(2, false));
    if (labelFirst) {
      labelItem = new Label(this, SWT.NONE);
      labelItem.setText(label);

      check = new Button(this, SWT.CHECK);
      check.addSelectionListener(new SelectionCheck());
    } else {
      check = new Button(this, SWT.CHECK);
      check.addSelectionListener(new SelectionCheck());

      labelItem = new Label(this, SWT.NONE);
      labelItem.setText(label);
    }
    GridData gdata = new GridData();
    // gdata.minimumWidth=20;
    gdata.grabExcessHorizontalSpace = false;
    // text.setLayoutData(gdata);
  }
コード例 #14
0
    public Setting(Composite comp, String title) {
      final Composite settingComp = new Composite(comp, SWT.BORDER);
      settingComp.setLayout(new FillLayout(SWT.VERTICAL));

      final RowLayout infoLayout = new RowLayout();
      infoLayout.center = true;

      final Composite infoComp = new Composite(settingComp, SWT.NONE);
      infoComp.setLayout(infoLayout);

      final Label settingLabel = new Label(infoComp, SWT.CENTER);
      settingLabel.setText(title);

      settingValue = new Text(infoComp, SWT.BORDER | SWT.SINGLE);
      settingValue.setText("000");

      settingScale = new Scale(settingComp, SWT.BORDER);
      settingScale.setSize(200, 64);
      settingScale.setMaximum(50);
      settingScale.addListener(
          SWT.Selection,
          new Listener() {
            @Override
            public void handleEvent(Event e) {
              settingValue.setText("" + settingScale.getSelection());
            }
          });
    }
コード例 #15
0
ファイル: SpotTool.java プロジェクト: DawnScience/dawn-ui
  public void createControl(Composite parent, IActionBars actionbars) {

    this.content = new Composite(parent, SWT.NONE);
    content.setLayout(new GridLayout(1, false));
    GridUtils.removeMargins(content);
    content.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    // Make some sashes
    final SashForm horiz = new SashForm(content, SWT.VERTICAL);
    horiz.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    horiz.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    final SashForm top = new SashForm(horiz, SWT.HORIZONTAL);
    final SashForm bottom = new SashForm(horiz, SWT.HORIZONTAL);

    // Fill the sashes
    topSystem.createPlotPart(top, "Integration", null, PlotType.XY, getPart());
    Label label = new Label(top, SWT.NONE);
    label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));

    super.createControl(bottom, actionbars);
    rightSystem.createPlotPart(bottom, "Integration", null, PlotType.XY, getPart());

    horiz.setWeights(new int[] {30, 70});
    top.setWeights(new int[] {70, 30});
    bottom.setWeights(new int[] {70, 30});

    topSystem.setShowLegend(false);
    rightSystem.setShowLegend(false);
    profilePlottingSystem.setShowIntensity(false);
  }
コード例 #16
0
  /* (non-Javadoc)
   * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
   */
  @Override
  protected Control createContents(Composite parent) {
    Composite content = new Composite(parent, SWT.NONE);
    GridLayout gridLayout = new GridLayout(2, false);
    gridLayout.marginWidth = gridLayout.marginHeight = 0;
    content.setLayout(gridLayout);
    initializeDialogUnits(content);

    Label label = new Label(content, SWT.NONE);
    label.setText("Name:");
    name = new Text(content, SWT.BORDER);
    name.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

    label = new Label(content, SWT.NONE);
    label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

    label = new Label(content, SWT.NONE);
    label.setText("Target repository:");
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository = new ComboViewer(content, SWT.READ_ONLY);
    repository.getControl().setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    repository.setLabelProvider(new LabelProvider());
    repository.setContentProvider(new ArrayContentProvider());
    repository.setSorter(new ViewerSorter());
    repository.setInput(getRepositoryService().getRepositories());
    repository.setSelection(new StructuredSelection(getRepositoryService().getRepository("local")));

    performDefaults();
    name.addModifyListener(modifyListener);

    return content;
  }
 private void createSeparator(Composite composite) {
   new Label(composite, SWT.NONE);
   new Label(composite, SWT.NONE);
   new Label(composite, SWT.NONE);
   Label label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
   label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 3, 1));
 }
コード例 #18
0
    UI(Composite parent) {
      super(parent, SWT.NONE);

      GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this);

      new Label(this, SWT.NONE).setText("First Name:");
      new Label(this, SWT.NONE).setText("Last Name");

      GridDataFactory gdf =
          GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false);
      firstName = new Text(this, SWT.BORDER);
      gdf.applyTo(firstName);

      lastName = new Text(this, SWT.BORDER);
      gdf.applyTo(lastName);

      gdf =
          GridDataFactory.swtDefaults().span(2, 1).grab(true, false).align(SWT.FILL, SWT.BEGINNING);
      Label label = new Label(this, SWT.NONE);
      label.setText("Formatted Name:");
      gdf.applyTo(label);

      formattedName = new Text(this, SWT.BORDER);
      formattedName.setEditable(false);
      gdf.applyTo(formattedName);
    }
コード例 #19
0
 public static Label addLabel(Composite parent, String text, int horizontalSpan) {
   Label label = new Label(parent, SWT.WRAP | SWT.LEFT);
   label.setText(text);
   GridData gd = SWTHelper.setGridData(label, SWT.FILL, true, SWT.CENTER, false);
   gd.horizontalSpan = horizontalSpan;
   return label;
 }
コード例 #20
0
  @Override
  protected Control createContents(Composite parent) {
    // TODO Auto-generated method stub
    container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 2;

    final Label tokenLabel = new Label(container, SWT.NULL);
    tokenLabel.setText("Pivotal Tracker Token: ");

    tokenText = new Text(container, SWT.BORDER | SWT.SINGLE);
    tokenText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    tokenText.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            //	dialogChanged();
          }
        });
    String[] defaults = (Activator.getDefault().getGitAccountPreference());

    if (defaults != null) {
      this.tokenText.setText(defaults[0]);
    }
    return container;
  }
コード例 #21
0
  /*
   * @see IContributionItem#fill(Composite)
   */
  public void fill(Composite parent) {

    Label sep = new Label(parent, SWT.SEPARATOR);
    fLabel = new CLabel(parent, SWT.SHADOW_NONE);

    fLabel.addDisposeListener(
        new DisposeListener() {
          public void widgetDisposed(DisposeEvent e) {
            fMouseListener = null;
          }
        });
    if (fActionHandler != null) {
      fMouseListener = new Listener();
      fLabel.addMouseListener(fMouseListener);
    }

    StatusLineLayoutData data = new StatusLineLayoutData();
    data.widthHint = getWidthHint(parent);
    fLabel.setLayoutData(data);

    data = new StatusLineLayoutData();
    data.heightHint = getHeightHint(parent);
    sep.setLayoutData(data);

    updateMessageLabel();
  }
コード例 #22
0
ファイル: ArtifactImportPage.java プロジェクト: eclipse/osee
  private void createDestinationArtifactSelectArea(Composite parent) {
    Label selectParentInstructions = new Label(parent, SWT.NONE);
    selectParentInstructions.setText("Select parent artifact:");

    artifactSelectPanel.createControl(parent);
    artifactSelectPanel.addListener(this);
  }
コード例 #23
0
ファイル: FileFeederGUI.java プロジェクト: Cazna/ipscan
  public void initialize() {
    setLayout(new GridLayout(3, false));
    Label fileNameLabel = new Label(this, SWT.NONE);
    fileNameText = new Text(this, SWT.BORDER);
    Button browseButton = new Button(this, SWT.NONE);

    fileNameLabel.setText(getLabel("feeder.file.name") + ":");

    fileNameText.setLayoutData(new GridData(160, -1));

    browseButton.setText(getLabel("feeder.file.browse"));
    browseButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(getShell());
            dialog.setText(getLabel("feeder.file.browse"));
            String fileName = dialog.open();
            if (fileName != null) {
              fileNameText.setText(fileName);
              fileNameText.setSelection(fileName.length());
            }
          }
        });

    pack();
  }
コード例 #24
0
ファイル: ArtifactImportPage.java プロジェクト: eclipse/osee
  private void createArtifactTypeSelectArea(Composite parent) {
    Label selectArtifactTypeInstructions = new Label(parent, SWT.NONE);
    selectArtifactTypeInstructions.setText("Select artifact type for imported data:");

    artifactTypeSelectPanel.createControl(parent);
    artifactTypeSelectPanel.addListener(this);
  }
コード例 #25
0
  /**
   * @param composite
   * @return
   */
  private Composite createBooleanConfigurationComposite(Composite composite) {

    Composite booleanComposite = new Composite(composite, SWT.NONE);
    booleanComposite.setLayout(new GridLayout(2, false));
    Label nameLabel = new Label(booleanComposite, SWT.NONE);
    nameLabel.setText(Messages.AddSimulationDataWizardPage_ProbabilityOfTrueLabel);
    Text labelText = new Text(booleanComposite, SWT.BORDER);
    labelText.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
    //        ControlDecoration controlDecoration = new ControlDecoration(labelText,
    // SWT.LEFT|SWT.TOP);
    //        FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault()
    //                .getFieldDecoration(FieldDecorationRegistry.DEC_ERROR);
    //        controlDecoration.setImage(fieldDecoration.getImage());
    //        controlDecoration.setDescriptionText(Messages.mustBeAPercentage);
    UpdateValueStrategy targetToModel = new UpdateValueStrategy();
    targetToModel.setConverter(
        StringToNumberConverter.toDouble(BonitaNumberFormat.getPercentInstance(), true));
    targetToModel.setAfterGetValidator(
        new ProbabilityValidator(
            new StringToDoubleValidator(
                StringToNumberConverter.toDouble(BonitaNumberFormat.getPercentInstance(), false))));

    Binding provider =
        context.bindValue(
            SWTObservables.observeText(labelText, SWT.Modify),
            PojoObservables.observeValue(this, "probabilityOfTrue"),
            targetToModel,
            new UpdateValueStrategy()
                .setConverter(
                    NumberToStringConverter.fromDouble(
                        BonitaNumberFormat.getPercentInstance(), true)));

    ControlDecorationSupport.create(provider, SWT.TOP | SWT.LEFT);
    return booleanComposite;
  }
コード例 #26
0
    /**
     * {@inheritDoc}
     *
     * @see
     *     org.eclipse.jface.dialogs.MessageDialog#createCustomArea(org.eclipse.swt.widgets.Composite)
     */
    @Override
    protected Control createCustomArea(final Composite parent) {
      final Composite panel = new Composite(parent, SWT.NONE);
      panel.setLayout(new GridLayout(2, false));
      panel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

      final Label lbl = new Label(panel, SWT.NONE);
      lbl.setText(RestClientI18n.serverPagePasswordLabel);

      final Text txt = new Text(panel, SWT.BORDER);
      txt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
      txt.setToolTipText(RestClientI18n.serverPagePasswordToolTip);
      txt.addModifyListener(
          new ModifyListener() {

            /**
             * {@inheritDoc}
             *
             * @see
             *     org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
             */
            @Override
            public void modifyText(final ModifyEvent e) {
              handlePasswordChanged(((Text) e.widget).getText());
            }
          });

      return super.createCustomArea(parent);
    }
コード例 #27
0
ファイル: InfoPage.java プロジェクト: purejava/viarcorsms
  /**
   * Create the info message page
   *
   * @author Ralph Plawetzki
   * @param parent parent shell
   * @param style SWT style
   * @param message text to be displayed on the info message page
   */
  public InfoPage(Composite parent, int style, String message) {
    super(parent, style);

    lblNewLabel = new Label(this, SWT.CENTER);
    lblNewLabel.setBounds(63, 51, 319, 25);
    lblNewLabel.setText(message);
  }
コード例 #28
0
  /**
   * 创建文件类型列表
   *
   * @param title
   * @param composite
   * @return ;
   */
  private ComboViewer createConvertControl(String title, Composite composite) {
    Label positiveConvertLabel = new Label(composite, SWT.NONE);
    GridData positiveConvertLabelData = new GridData();
    positiveConvertLabelData.horizontalSpan = 2;
    positiveConvertLabelData.horizontalAlignment = SWT.CENTER;
    positiveConvertLabelData.grabExcessHorizontalSpace = true;
    positiveConvertLabel.setLayoutData(positiveConvertLabelData);
    positiveConvertLabel.setText(title);

    Label suportFormat = new Label(composite, SWT.NONE);
    suportFormat.setText("Suport Format");

    ComboViewer supportList = new ComboViewer(composite, SWT.READ_ONLY);
    GridData gridData = new GridData();
    gridData.horizontalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    supportList.getCombo().setLayoutData(gridData);
    supportList.addSelectionChangedListener(
        new ISelectionChangedListener() {

          public void selectionChanged(SelectionChangedEvent event) {
            ISelection selection = event.getSelection();
            if (selection.isEmpty()) {
              okButton.setEnabled(false);
            } else {
              okButton.setEnabled(true);
            }
          }
        });

    return supportList;
  }
コード例 #29
0
  /** @see IDialogPage#createControl(Composite) */
  public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    container.setLayout(layout);
    layout.numColumns = 2;
    layout.verticalSpacing = 9;
    Label lblprojectName = new Label(container, SWT.NULL);
    lblprojectName.setText("&Project name:");

    projectName = new Text(container, SWT.BORDER | SWT.SINGLE);
    projectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    projectName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    projectName.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            dialogChanged();
          }
        });

    Label lblExamples = new Label(container, SWT.NULL);
    lblExamples.setText("&Create example data");

    examples = new Button(container, SWT.CHECK);
    examples.setSelection(false);

    dialogChanged();
    setControl(container);
  }
コード例 #30
0
 public QualifiedNameComponent(
     Composite parent,
     int style,
     final IQualifiedNameUpdating refactoring,
     IDialogSettings settings) {
   super(parent, style);
   GridLayout layout = new GridLayout();
   layout.marginWidth = 0;
   layout.marginHeight = 0;
   layout.numColumns = 2;
   setLayout(layout);
   Label label = new Label(this, SWT.NONE);
   label.setText(RefactoringMessages.QualifiedNameComponent_patterns_label);
   fPatterns = new Text(this, SWT.BORDER);
   fPatterns.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
   label = new Label(this, SWT.NONE);
   label.setText(RefactoringMessages.QualifiedNameComponent_patterns_description);
   GridData gd = new GridData(GridData.FILL_HORIZONTAL);
   gd.horizontalSpan = 2;
   label.setLayoutData(gd);
   String text = refactoring.getFilePatterns();
   if (text == null) text = settings.get(PATTERNS);
   if (text != null) {
     fPatterns.setText(text);
     refactoring.setFilePatterns(text);
   }
   fPatterns.addModifyListener(
       new ModifyListener() {
         public void modifyText(ModifyEvent e) {
           refactoring.setFilePatterns(fPatterns.getText());
         }
       });
 }