コード例 #1
0
  /*
   * (non-Javadoc)
   *
   * @see org.eclipse.jface.dialogs.Dialog#okPressed()
   */
  protected void okPressed() {
    String result = getNameCheckResult();
    if (result != null) {
      MessageBox mb = new MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_WARNING);
      mb.setText(
          Messages.getString("HyperlinkEditorDialog.HyperlinkName.Title.Warning")); // $NON-NLS-1$
      mb.setMessage(result);
      mb.open();
      fTxtHyperlinkLabel.setFocus();
      return;
    }

    if (fsBaseURL == null) {
      MessageBox mb = new MessageBox(Display.getDefault().getActiveShell(), SWT.ICON_WARNING);
      mb.setText(
          Messages.getString("HyperlinkEditorDialog.HyperlinkName.Title.Warning")); // $NON-NLS-1$
      mb.setMessage(Messages.getString("HyperlinkEditorDialog.BaseURL.Message")); // $NON-NLS-1$
      mb.open();
      fTxtHyperlinkLabel.setFocus();
      return;
    }
    fURLValue.getLabel().getCaption().setValue(fTxtHyperlinkLabel.getText().trim());
    fURLValue.setBaseUrl(fsBaseURL);
    fURLValue.setBaseParameterName(fTxtBaseParm.getText());
    fURLValue.setSeriesParameterName(fTxtSeriesParm.getText());
    fURLValue.setValueParameterName(fTxtValueParm.getText());
    super.okPressed();
  }
コード例 #2
0
  private void createFontStylePanel() {
    Label lblStyle = new Label(cmpContent, SWT.NONE);
    lblStyle.setText(Messages.getString("FontDefinitionDialog.Lbl.Style")); // $NON-NLS-1$

    Composite cmpFontStyle = new Composite(cmpContent, SWT.NONE);
    {
      GridLayout layout = new GridLayout(4, false);
      layout.marginWidth = 0;
      layout.marginHeight = 0;
      cmpFontStyle.setLayout(layout);
      GridData gd = new GridData();
      gd.horizontalSpan = 8;
      cmpFontStyle.setLayoutData(gd);
    }

    btnBold = new Button(cmpFontStyle, SWT.TOGGLE);
    {
      GridData gdBBold = new GridData();
      btnBold.setLayoutData(gdBBold);
      btnBold.setImage(UIHelper.getImage("icons/obj16/fnt_style_bold.gif")); // $NON-NLS-1$
      btnBold.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.Bold")); // $NON-NLS-1$
      btnBold.addSelectionListener(this);
      btnBold.setSelection(fdCurrent.isSetBold() && fdCurrent.isBold());
    }

    btnItalic = new Button(cmpFontStyle, SWT.TOGGLE);
    {
      GridData gdBItalic = new GridData();
      btnItalic.setLayoutData(gdBItalic);
      btnItalic.setImage(UIHelper.getImage("icons/obj16/fnt_style_italic.gif")); // $NON-NLS-1$
      btnItalic.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.Italic")); // $NON-NLS-1$
      btnItalic.addSelectionListener(this);
      btnItalic.setSelection(fdCurrent.isSetItalic() && fdCurrent.isItalic());
    }

    btnUnderline = new Button(cmpFontStyle, SWT.TOGGLE);
    {
      GridData gdBUnderline = new GridData();
      btnUnderline.setLayoutData(gdBUnderline);
      btnUnderline.setImage(
          UIHelper.getImage("icons/obj16/fnt_style_underline.gif")); // $NON-NLS-1$
      btnUnderline.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.Underline")); // $NON-NLS-1$
      btnUnderline.addSelectionListener(this);
      btnUnderline.setSelection(fdCurrent.isSetUnderline() && fdCurrent.isUnderline());
    }

    btnStrikethru = new Button(cmpFontStyle, SWT.TOGGLE);
    {
      btnStrikethru.setImage(
          UIHelper.getImage("icons/obj16/fnt_style_Sthrough.gif")); // $NON-NLS-1$
      btnStrikethru.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.Strikethrough")); // $NON-NLS-1$
      btnStrikethru.addSelectionListener(this);
      btnStrikethru.setSelection(fdCurrent.isSetStrikethrough() && fdCurrent.isStrikethrough());
    }
  }
コード例 #3
0
  /**
   * Check if specified label already is used.
   *
   * @return
   */
  private String getNameCheckResult() {
    if ("".equals(fTxtHyperlinkLabel.getText().trim())) // $NON-NLS-1$
    {
      return Messages.getString("HyperlinkEditorDialog.ErrorMessage.NullText"); // $NON-NLS-1$
    }

    if (fExistingLabels != null && fExistingLabels.contains(fTxtHyperlinkLabel.getText().trim())) {
      return Messages.getString("HyperlinkEditorDialog.ErrorMessage.ExistingText"); // $NON-NLS-1$;
    }

    return null;
  }
コード例 #4
0
 /*
  * (non-Javadoc)
  *
  * @see
  * org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
  * .Composite)
  */
 protected Control createDialogArea(Composite parent) {
   getShell()
       .setText(Messages.getString("HyperlinkEditorDialog.Title.HyperlinkEditor")); // $NON-NLS-1$
   Composite c = (Composite) super.createDialogArea(parent);
   createURLComposite(c);
   updateUIValues();
   return c;
 }
コード例 #5
0
 private String getAdvancedButtonText(boolean bAdvanced) {
   if (bAdvanced) {
     return Messages.getString("TriggerDataComposite.Text.OpenAdvanced"); // $NON-NLS-1$
   }
   return Messages.getString("TriggerDataComposite.Text.Advanced"); // $NON-NLS-1$
 }
コード例 #6
0
  /**
   * @param glURL
   * @param glParameter
   */
  private void createURLComposite(Composite parent) {
    GridLayout gl = (GridLayout) parent.getLayout();
    gl.numColumns = 2;

    Label lblTarget = new Label(parent, SWT.NONE);
    GridData gdLBLTarget = new GridData();
    gdLBLTarget.horizontalIndent = 2;
    lblTarget.setLayoutData(gdLBLTarget);
    lblTarget.setText(Messages.getString("HyperlinkEditorDialog.Text.MenuLabel")); // $NON-NLS-1$

    fTxtHyperlinkLabel = new Text(parent, SWT.BORDER);
    GridData gdTXTTarget = new GridData(GridData.FILL_HORIZONTAL);
    gdTXTTarget.widthHint = 80;
    fTxtHyperlinkLabel.setLayoutData(gdTXTTarget);

    AssistField af =
        new TextAssistField(fTxtHyperlinkLabel, null) {

          private boolean fIsDuplicate = false;

          /* (non-Javadoc)
           * @see org.eclipse.birt.chart.ui.swt.fieldassist.TextAssistField#isValid()
           */
          public boolean isValid() {
            fIsDuplicate = false;
            String text = fTxtHyperlinkLabel.getText();
            if (text == null || "".equals(text.trim())) { // $NON-NLS-1$
              return false;
            }

            if (fExistingLabels != null && fExistingLabels.contains(fTxtHyperlinkLabel.getText())) {
              fIsDuplicate = true;
              return false;
            }

            return true;
          }

          /* (non-Javadoc)
           * @see org.eclipse.birt.chart.ui.swt.fieldassist.AssistField#isRequiredField()
           */
          public boolean isRequiredField() {
            return true;
          }

          public String getErrorMessage() {
            if (fIsDuplicate) {
              return Messages.getString(
                  "HyperlinkEditorDialog.ErrorMessage.ExistingText"); //$NON-NLS-1$
            }
            return Messages.getString("HyperlinkEditorDialog.ErrorMessage.NullText"); // $NON-NLS-1$
          }
        };
    FieldAssistHelper.getInstance().addRequiredFieldIndicator(af, lblTarget);

    Label lblBaseURL = new Label(parent, SWT.NONE);
    GridData gdLBLBaseURL = new GridData();
    gdLBLBaseURL.horizontalIndent = 2;
    lblBaseURL.setLayoutData(gdLBLBaseURL);
    lblBaseURL.setText(Messages.getString("TriggerDataComposite.Lbl.BaseURL")); // $NON-NLS-1$

    fBtnBaseURL = new Button(parent, SWT.NONE);
    {
      GridData gd = new GridData();
      fBtnBaseURL.setLayoutData(gd);
      fBtnBaseURL.setText(
          Messages.getString("TriggerDataComposite.Text.EditBaseURL")); // $NON-NLS-1$
      fBtnBaseURL.setToolTipText(
          Messages.getString("TriggerDataComposite.Tooltip.InvokeURLBuilder")); // $NON-NLS-1$
      fBtnBaseURL.addSelectionListener(this);
      fBtnBaseURL.setEnabled(fContext.getUIServiceProvider().isInvokingSupported());
    }

    Label lblDefine = new Label(parent, SWT.WRAP);
    {
      GridData gd = new GridData(GridData.FILL_HORIZONTAL);
      gd.horizontalIndent = 2;
      gd.horizontalSpan = 3;
      gd.widthHint = 200;
      lblDefine.setLayoutData(gd);
      lblDefine.setText(
          Messages.getString("TriggerDataComposite.Label.Description")); // $NON-NLS-1$
    }

    fBtnAdvanced = new Button(parent, SWT.NONE);
    {
      GridData gd = new GridData();
      gd.horizontalSpan = 2;
      fBtnAdvanced.setLayoutData(gd);
      fBtnAdvanced.setText(getAdvancedButtonText(bAdvanced));
      fBtnAdvanced.setToolTipText(
          Messages.getString("TriggerDataComposite.Tooltip.Advanced")); // $NON-NLS-1$
      fBtnAdvanced.addSelectionListener(this);
      fBtnAdvanced.setEnabled(fbEnableURLParameters);
    }

    fGrpParameters = new Group(parent, SWT.NONE);
    GridData gdGRPParameters = new GridData(GridData.FILL_HORIZONTAL);
    gdGRPParameters.horizontalSpan = 3;
    fGrpParameters.setLayoutData(gdGRPParameters);

    GridLayout glParameter = new GridLayout();
    glParameter.marginWidth = 2;
    glParameter.marginHeight = 6;
    glParameter.horizontalSpacing = 6;
    glParameter.numColumns = 3;

    fGrpParameters.setLayout(glParameter);
    fGrpParameters.setText(
        Messages.getString("TriggerDataComposite.Lbl.ParameterNames")); // $NON-NLS-1$
    fGrpParameters.setVisible(bAdvanced);

    StyledText stParameters = new StyledText(fGrpParameters, SWT.WRAP | SWT.READ_ONLY);
    {
      GridData gd = new GridData(GridData.FILL_HORIZONTAL);
      gd.horizontalIndent = 2;
      gd.horizontalSpan = 3;
      gd.widthHint = 200;
      stParameters.setLayoutData(gd);
      stParameters.setText(
          Messages.getString("TriggerDataComposite.Label.OptionalURLParameters")); // $NON-NLS-1$
      stParameters.setBackground(parent.getBackground());
    }

    Label lblBaseParm = new Label(fGrpParameters, SWT.NONE);
    {
      GridData gdLBLBaseParm = new GridData();
      gdLBLBaseParm.horizontalIndent = 2;
      lblBaseParm.setLayoutData(gdLBLBaseParm);
      lblBaseParm.setText(
          Messages.getString("TriggerDataComposite.Lbl.CategorySeries")); // $NON-NLS-1$
      lblBaseParm.setToolTipText(
          Messages.getString("TriggerDataComposite.Tooltip.ParameterCategory")); // $NON-NLS-1$
    }

    fTxtBaseParm = new Text(fGrpParameters, SWT.BORDER);
    GridData gdTXTBaseParm = new GridData(GridData.FILL_HORIZONTAL);
    gdTXTBaseParm.horizontalSpan = 2;
    fTxtBaseParm.setLayoutData(gdTXTBaseParm);
    fTxtBaseParm.setToolTipText(
        Messages.getString("TriggerDataComposite.Tooltip.ParameterCategory")); // $NON-NLS-1$
    fTxtBaseParm.setEnabled(
        fbEnableURLParameters
            && ((fOptionalStyle & TriggerDataComposite.DISABLE_CATEGORY_SERIES)
                != TriggerDataComposite.DISABLE_CATEGORY_SERIES));
    Label lblValueParm = new Label(fGrpParameters, SWT.NONE);
    {
      GridData gdLBLValueParm = new GridData();
      gdLBLValueParm.horizontalIndent = 2;
      lblValueParm.setLayoutData(gdLBLValueParm);
      lblValueParm.setText(
          Messages.getString("TriggerDataComposite.Lbl.ValueSeries")); // $NON-NLS-1$
      lblValueParm.setToolTipText(
          Messages.getString("TriggerDataComposite.Tooltip.ParameterValue")); // $NON-NLS-1$
    }

    fTxtValueParm = new Text(fGrpParameters, SWT.BORDER);
    GridData gdTXTValueParm = new GridData(GridData.FILL_HORIZONTAL);
    gdTXTValueParm.horizontalSpan = 2;
    fTxtValueParm.setLayoutData(gdTXTValueParm);
    fTxtValueParm.setToolTipText(
        Messages.getString("TriggerDataComposite.Tooltip.ParameterValue")); // $NON-NLS-1$
    fTxtValueParm.setEnabled(
        fbEnableURLParameters
            && ((fOptionalStyle & TriggerDataComposite.DISABLE_VALUE_SERIES)
                != TriggerDataComposite.DISABLE_VALUE_SERIES));

    Label lblSeriesParm = new Label(fGrpParameters, SWT.NONE);
    {
      GridData gdLBLSeriesParm = new GridData();
      gdLBLSeriesParm.horizontalIndent = 2;
      lblSeriesParm.setLayoutData(gdLBLSeriesParm);
      lblSeriesParm.setText(
          Messages.getString("TriggerDataComposite.Lbl.ValueSeriesName")); // $NON-NLS-1$
      lblSeriesParm.setToolTipText(
          Messages.getString("TriggerDataComposite.Tooltip.ParameterSeries")); // $NON-NLS-1$
    }

    fTxtSeriesParm = new Text(fGrpParameters, SWT.BORDER);
    GridData gdTXTSeriesParm = new GridData(GridData.FILL_HORIZONTAL);
    gdTXTSeriesParm.horizontalSpan = 2;
    fTxtSeriesParm.setLayoutData(gdTXTSeriesParm);
    fTxtSeriesParm.setToolTipText(
        Messages.getString("TriggerDataComposite.Tooltip.ParameterSeries")); // $NON-NLS-1$
    fTxtSeriesParm.setEnabled(
        fbEnableURLParameters
            && ((fOptionalStyle & TriggerDataComposite.DISABLE_VALUE_SERIES_NAME)
                != TriggerDataComposite.DISABLE_VALUE_SERIES_NAME));
  }
コード例 #7
0
  private void createRotationPanel() {
    Composite cmpRotation = new Composite(cmpContent, SWT.NONE);
    {
      GridLayout layout = new GridLayout(3, false);
      layout.verticalSpacing = 5;
      layout.horizontalSpacing = 5;
      layout.marginHeight = 7;
      layout.marginWidth = 7;
      cmpRotation.setLayout(layout);
      GridData gd = new GridData(GridData.FILL_BOTH);
      gd.horizontalSpan = 3;
      gd.heightHint = 150;
      cmpRotation.setLayoutData(gd);
    }

    Label lblRotation = new Label(cmpRotation, SWT.NONE);
    {
      lblRotation.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
      lblRotation.setText(Messages.getString("FontDefinitionDialog.Lbl.Rotation")); // $NON-NLS-1$
    }

    ascRotation =
        new AngleSelectorComposite(
            cmpRotation,
            SWT.BORDER,
            ChartUIUtil.getFontRotation(fdCurrent),
            Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    GridData gdASCRotation = new GridData(GridData.FILL_BOTH);
    gdASCRotation.horizontalSpan = 2;
    ascRotation.setLayoutData(gdASCRotation);
    ascRotation.setAngleChangeListener(this);

    Label lblDegree = new Label(cmpRotation, SWT.NONE);
    {
      lblDegree.setLayoutData(new GridData());
      lblDegree.setText(Messages.getString("FontDefinitionDialog.Label.Degree")); // $NON-NLS-1$
    }

    iscRotation =
        new IntegerSpinControl(cmpRotation, SWT.NONE, ChartUIUtil.getFontRotation(fdCurrent));
    GridData gdISCRotation = new GridData(GridData.FILL_HORIZONTAL);
    gdISCRotation.horizontalSpan = 2;
    iscRotation.setLayoutData(gdISCRotation);
    iscRotation.setMinimum(-90);
    iscRotation.setMaximum(90);
    iscRotation.setIncrement(1);
    iscRotation.addListener(this);

    Label lblPreview = new Label(cmpContent, SWT.NONE);
    {
      lblPreview.setText(Messages.getString("FontDefinitionDialog.Lbl.Preview")); // $NON-NLS-1$
      lblPreview.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
    }

    FillLayout flPreview = new FillLayout();
    flPreview.marginHeight = 2;
    flPreview.marginWidth = 3;
    Composite grpPreview = new Composite(cmpContent, SWT.NONE);
    GridData gdGRPPreview = new GridData(GridData.FILL_BOTH);
    gdGRPPreview.horizontalSpan = 4;
    grpPreview.setLayoutData(gdGRPPreview);
    grpPreview.setLayout(flPreview);

    fcPreview = new FontCanvas(grpPreview, SWT.BORDER, fdCurrent, cdCurrent, true, true, true);
  }
コード例 #8
0
  private void createAlignmentPanel() {
    new Label(cmpContent, SWT.NONE)
        .setText(Messages.getString("FontDefinitionDialog.Lbl.Alignment")); // $NON-NLS-1$

    Composite cmpAlignment = new Composite(cmpContent, SWT.NONE);
    {
      GridData gdCMPAlignment = new GridData(GridData.FILL_HORIZONTAL);
      gdCMPAlignment.horizontalSpan = 8;
      cmpAlignment.setLayoutData(gdCMPAlignment);
      GridLayout glAlignment = new GridLayout(11, false);
      glAlignment.marginWidth = 2;
      glAlignment.marginHeight = 0;
      cmpAlignment.setLayout(glAlignment);
    }

    btnATopLeft = createAlighmentButton(cmpAlignment);
    btnATopCenter = createAlighmentButton(cmpAlignment);
    btnATopRight = createAlighmentButton(cmpAlignment);
    btnACenterLeft = createAlighmentButton(cmpAlignment);
    btnACenter = createAlighmentButton(cmpAlignment);
    btnACenterRight = createAlighmentButton(cmpAlignment);
    btnABottomLeft = createAlighmentButton(cmpAlignment);
    btnABottomCenter = createAlighmentButton(cmpAlignment);
    btnABottomRight = createAlighmentButton(cmpAlignment);

    if (isFlippedAxes()) {
      btnATopLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomRight")); // $NON-NLS-1$
      btnATopLeft.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomright.gif")); // $NON-NLS-1$
      btnATopLeft.getImage().setBackground(btnATopLeft.getBackground());

      btnATopCenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenterRight")); // $NON-NLS-1$
      btnATopCenter.setImage(
          UIHelper.getImage("icons/obj28/alignmentcenterright.gif")); // $NON-NLS-1$
      btnATopCenter.getImage().setBackground(btnATopCenter.getBackground());

      btnATopRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopRight")); // $NON-NLS-1$
      btnATopRight.setImage(UIHelper.getImage("icons/obj28/alignmenttopright.gif")); // $NON-NLS-1$
      btnATopRight.getImage().setBackground(btnATopRight.getBackground());

      createSeparator(cmpAlignment);

      btnACenterLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomCenter")); // $NON-NLS-1$
      btnACenterLeft.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomcenter.gif")); // $NON-NLS-1$
      btnACenterLeft.getImage().setBackground(btnACenterLeft.getBackground());

      btnACenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenter")); // $NON-NLS-1$
      btnACenter.setImage(UIHelper.getImage("icons/obj28/alignmentcenter.gif")); // $NON-NLS-1$
      btnACenter.getImage().setBackground(btnACenter.getBackground());

      btnACenterRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopCenter")); // $NON-NLS-1$
      btnACenterRight.setImage(
          UIHelper.getImage("icons/obj28/alignmenttopcenter.gif")); // $NON-NLS-1$
      btnACenterRight.getImage().setBackground(btnACenterRight.getBackground());

      createSeparator(cmpAlignment);

      btnABottomLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomLeft")); // $NON-NLS-1$
      btnABottomLeft.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomleft.gif")); // $NON-NLS-1$
      btnABottomLeft.getImage().setBackground(btnABottomLeft.getBackground());

      btnABottomCenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenterLeft")); // $NON-NLS-1$
      btnABottomCenter.setImage(
          UIHelper.getImage("icons/obj28/alignmentcenterleft.gif")); // $NON-NLS-1$
      btnABottomCenter.getImage().setBackground(btnABottomCenter.getBackground());

      btnABottomRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopLeft")); // $NON-NLS-1$
      btnABottomRight.setImage(
          UIHelper.getImage("icons/obj28/alignmenttopleft.gif")); // $NON-NLS-1$
      btnABottomRight.getImage().setBackground(btnABottomRight.getBackground());
    } else {
      btnATopLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopLeft")); // $NON-NLS-1$
      btnATopLeft.setImage(UIHelper.getImage("icons/obj28/alignmenttopleft.gif")); // $NON-NLS-1$
      btnATopLeft.getImage().setBackground(btnATopLeft.getBackground());

      btnATopCenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopCenter")); // $NON-NLS-1$
      btnATopCenter.setImage(
          UIHelper.getImage("icons/obj28/alignmenttopcenter.gif")); // $NON-NLS-1$
      btnATopCenter.getImage().setBackground(btnATopCenter.getBackground());

      btnATopRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignTopRight")); // $NON-NLS-1$
      btnATopRight.setImage(UIHelper.getImage("icons/obj28/alignmenttopright.gif")); // $NON-NLS-1$
      btnATopRight.getImage().setBackground(btnATopRight.getBackground());

      createSeparator(cmpAlignment);

      btnACenterLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenterLeft")); // $NON-NLS-1$
      btnACenterLeft.setImage(
          UIHelper.getImage("icons/obj28/alignmentcenterleft.gif")); // $NON-NLS-1$
      btnACenterLeft.getImage().setBackground(btnACenterLeft.getBackground());

      btnACenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenter")); // $NON-NLS-1$
      btnACenter.setImage(UIHelper.getImage("icons/obj28/alignmentcenter.gif")); // $NON-NLS-1$
      btnACenter.getImage().setBackground(btnACenter.getBackground());

      btnACenterRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignCenterRight")); // $NON-NLS-1$
      btnACenterRight.setImage(
          UIHelper.getImage("icons/obj28/alignmentcenterright.gif")); // $NON-NLS-1$
      btnACenterRight.getImage().setBackground(btnACenterRight.getBackground());

      createSeparator(cmpAlignment);

      btnABottomLeft.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomLeft")); // $NON-NLS-1$
      btnABottomLeft.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomleft.gif")); // $NON-NLS-1$
      btnABottomLeft.getImage().setBackground(btnABottomLeft.getBackground());

      btnABottomCenter.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomCenter")); // $NON-NLS-1$
      btnABottomCenter.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomcenter.gif")); // $NON-NLS-1$
      btnABottomCenter.getImage().setBackground(btnABottomCenter.getBackground());

      btnABottomRight.setToolTipText(
          Messages.getString("FontDefinitionDialog.Tooltip.AlignBottomRight")); // $NON-NLS-1$
      btnABottomRight.setImage(
          UIHelper.getImage("icons/obj28/alignmentbottomright.gif")); // $NON-NLS-1$
      btnABottomRight.getImage().setBackground(btnABottomRight.getBackground());
    }
  }
コード例 #9
0
  protected Control createDialogArea(Composite parent) {
    GridLayout glContent = new GridLayout();
    glContent.verticalSpacing = 5;
    glContent.horizontalSpacing = 5;
    glContent.marginHeight = 7;
    glContent.marginWidth = 7;
    glContent.numColumns = 9;

    cmpContent = new Composite(parent, SWT.NONE);
    cmpContent.setLayout(glContent);
    cmpContent.setLayoutData(new GridData(GridData.FILL_BOTH));

    Label lblFont = new Label(cmpContent, SWT.NONE);
    GridData gdLFont = new GridData();
    lblFont.setLayoutData(gdLFont);
    lblFont.setText(Messages.getString("FontDefinitionDialog.Lbl.Font")); // $NON-NLS-1$

    cmbFontNames = new Combo(cmpContent, SWT.DROP_DOWN | SWT.READ_ONLY);
    GridData gdCMBFontNames = new GridData(GridData.FILL_HORIZONTAL);
    gdCMBFontNames.horizontalSpan = 8;
    cmbFontNames.setLayoutData(gdCMBFontNames);
    cmbFontNames.addSelectionListener(this);
    cmbFontNames.setVisibleItemCount(30);

    Label lblSize = new Label(cmpContent, SWT.NONE);
    GridData gdLSize = new GridData();
    lblSize.setLayoutData(gdLSize);
    lblSize.setText(Messages.getString("FontDefinitionDialog.Lbl.Size")); // $NON-NLS-1$

    cmbFontSizes = new Combo(cmpContent, SWT.NONE);
    {
      cmbFontSizes.setItems(FONT_SIZE);
      cmbFontSizes.setText(
          fdCurrent.isSetSize()
              ? String.valueOf((int) fdCurrent.getSize())
              : ChartUIUtil.FONT_AUTO);
      GridData gdISCFontSizes = new GridData(GridData.FILL_HORIZONTAL);
      gdISCFontSizes.horizontalSpan = 3;
      cmbFontSizes.setLayoutData(gdISCFontSizes);
      cmbFontSizes.addSelectionListener(this);
      cmbFontSizes.addFocusListener(this);
      cmbFontSizes.setVisibleItemCount(30);
    }

    Label lblForeground = new Label(cmpContent, SWT.NONE);
    GridData gdLForeground = new GridData();
    gdLForeground.horizontalSpan = 2;
    gdLForeground.horizontalIndent = 40;
    lblForeground.setLayoutData(gdLForeground);
    lblForeground.setText(Messages.getString("FontDefinitionDialog.Lbl.Color")); // $NON-NLS-1$

    fccColor =
        new FillChooserComposite(
            cmpContent,
            SWT.NONE,
            wizardContext,
            cdCurrent,
            false,
            false,
            true,
            false,
            false,
            false);
    {
      GridData gdFCCColor = new GridData(GridData.FILL_HORIZONTAL);
      gdFCCColor.horizontalSpan = 3;
      fccColor.setLayoutData(gdFCCColor);
      fccColor.addListener(this);
    }

    createFontStylePanel();

    if (isAlignmentEnabled) {
      createAlignmentPanel();
    }

    createRotationPanel();

    populateLists();
    updatePreview();

    return cmpContent;
  }
コード例 #10
0
 protected Control createContents(Composite parent) {
   ChartUIUtil.bindHelp(parent, ChartHelpContextIds.DIALOG_FONT_EDITOR);
   getShell()
       .setText(Messages.getString("FontDefinitionDialog.Title.FontDescriptor")); // $NON-NLS-1$
   return super.createContents(parent);
 }