public void createControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.NULL);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(
        new GridData(GridData.VERTICAL_ALIGN_FILL | GridData.HORIZONTAL_ALIGN_FILL));
    setControl(composite);

    initializeDialogUnits(parent);

    // Actual contents
    Composite appSettings = new Composite(composite, SWT.NULL);
    appSettings.setLayout(new GridLayout(2, false));

    Label label = new Label(appSettings, SWT.NONE);
    label.setText(Messages.HerokuDeployWizardPage_ApplicationNameLabel);

    appName = new Text(appSettings, SWT.SINGLE | SWT.BORDER);
    appName.setLayoutData(new GridData(250, SWT.DEFAULT));
    // Set default name to project name
    appName.setText(getProjectName());
    appName.addModifyListener(
        new ModifyListener() {

          public void modifyText(ModifyEvent e) {
            getContainer().updateButtons();
          }
        });

    publishButton = new Button(composite, SWT.CHECK);
    publishButton.setText(Messages.HerokuDeployWizardPage_PublishApplicationLabel);
    publishButton.setSelection(
        Platform.getPreferencesService()
            .getBoolean(
                HerokuPlugin.getPluginIdentifier(),
                IPreferenceConstants.HEROKU_AUTO_PUBLISH,
                true,
                null));

    if (doesntHaveGitRepo()) {
      Label note = new Label(composite, SWT.WRAP);
      // We need this italic, we may need to set a font explicitly here to get it
      Font dialogFont = JFaceResources.getDialogFont();
      FontData[] data = SWTUtils.italicizedFont(JFaceResources.getDialogFont());
      final Font italic = new Font(dialogFont.getDevice(), data);
      note.setFont(italic);
      note.addDisposeListener(
          new DisposeListener() {
            public void widgetDisposed(DisposeEvent e) {
              if (!italic.isDisposed()) {
                italic.dispose();
              }
            }
          });

      note.setLayoutData(new GridData(400, SWT.DEFAULT));
      note.setText(Messages.HerokuDeployWizardPage_NoGitRepoNote);
    }

    Dialog.applyDialogFont(composite);
  }
    @Override
    protected void initialize(ColumnViewer viewer, ViewerColumn column) {
      super.initialize(viewer, column);

      Font font = viewer.getControl().getFont();

      if (font != null) {
        FontData data = font.getFontData()[0];

        boldFont = new Font(font.getDevice(), data.getName(), data.getHeight(), SWT.BOLD);
      }
    }
Beispiel #3
0
  public static void initFormText(FormText formText) {

    formText.setWhitespaceNormalized(false);

    Font formTextFont = formText.getFont();
    FontData formTextFontData = formTextFont.getFontData()[0];

    FontData h1FontData =
        new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 5, SWT.BOLD);
    final Font h1Font = new Font(formTextFont.getDevice(), h1FontData);
    formText.setFont(FONT_H1_KEY, h1Font);

    FontData h3FontData =
        new FontData(formTextFontData.getName(), formTextFontData.getHeight() + 3, SWT.BOLD);
    final Font h3Font = new Font(formTextFont.getDevice(), h3FontData);
    formText.setFont(FONT_H3_KEY, h3Font);

    Font codeFont = JFaceResources.getTextFont();
    formText.setFont(FONT_CODE_KEY, codeFont);

    formText.addDisposeListener(
        new DisposeListener() {

          @Override
          public void widgetDisposed(DisposeEvent e) {
            h1Font.dispose();
            h3Font.dispose();
          }
        });

    // Set fontKeySet = JFaceResources.getFontRegistry().getKeySet();
    // if (fontKeySet != null) {
    // for (Object fontKey : fontKeySet) {
    // System.out.println(fontKey);
    // }
    // }

  }
Beispiel #4
0
 public static Font modifyFont(Font normalFont, int style) {
   FontData[] fontData = normalFont.getFontData();
   fontData[0].setStyle(fontData[0].getStyle() | style);
   return new Font(normalFont.getDevice(), fontData[0]);
 }
 private void initializeItalicBold() {
   FontData italicBoldData = createFontDataFromNormal();
   italicBoldData.setStyle(SWT.BOLD | SWT.ITALIC);
   ITALIC_BOLD = new Font(NORMAL.getDevice(), italicBoldData);
 }
 private void initializeBold() {
   FontData boldData = createFontDataFromNormal();
   boldData.setStyle(SWT.BOLD);
   BOLD = new Font(NORMAL.getDevice(), boldData);
 }