Package org.eclipse.swt.widgets

Examples of org.eclipse.swt.widgets.Text.computeSize()


    Text description = new Text(composite, SWT.READ_ONLY | SWT.SINGLE);
    description.setText(SSEUIMessages.TaskTagPreferenceTab_33); //$NON-NLS-1$
//    description.setBackground(composite.getBackground());
    GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1);
    // https://bugs.eclipse.org/bugs/show_bug.cgi?id=104403
    Point sizeHint = description.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    gd.widthHint = sizeHint.x;
    description.setLayoutData(gd);

    valueTable = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    valueTable.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
View Full Code Here


      Text text = (Text) celleditor.getControl();
      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (getWrapLabel().isTextWrapOn()
          && getWrapLabel().getText().length() > 0) {
        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
View Full Code Here

        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
            SWT.DEFAULT)).expand(avr * 2, 0));
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
View Full Code Here

      Text text = (Text) celleditor.getControl();
      Rectangle rect = getLabel().getTextBounds().getCopy();
      getLabel().translateToAbsolute(rect);
      int avr = FigureUtilities.getFontMetrics(text.getFont())
          .getAverageCharWidth();
      rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
          SWT.DEFAULT)).expand(avr * 2, 0));
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here

      Text text = (Text) celleditor.getControl();
      Rectangle rect = getLabel().getTextBounds().getCopy();
      getLabel().translateToAbsolute(rect);
      int avr = FigureUtilities.getFontMetrics(text.getFont())
          .getAverageCharWidth();
      rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
          SWT.DEFAULT)).expand(avr * 2, 0));
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
    }
View Full Code Here

      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (!text.getFont().isDisposed()) {
        if (getWrapLabel().isTextWrapOn()
            && getWrapLabel().getText().length() > 0) {
          rect.setSize(new Dimension(text.computeSize(rect.width,
              SWT.DEFAULT)));
        } else {
          int avr = FigureUtilities.getFontMetrics(text.getFont())
              .getAverageCharWidth();
          rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
View Full Code Here

          rect.setSize(new Dimension(text.computeSize(rect.width,
              SWT.DEFAULT)));
        } else {
          int avr = FigureUtilities.getFontMetrics(text.getFont())
              .getAverageCharWidth();
          rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
              SWT.DEFAULT)).expand(avr * 2, 0));
        }
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
View Full Code Here

      Rectangle rect = getLabel().getTextBounds().getCopy();
      getLabel().translateToAbsolute(rect);
      if (!text.getFont().isDisposed()) {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
            SWT.DEFAULT)).expand(avr * 2, 0));
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
View Full Code Here

      Text text = (Text) celleditor.getControl();
      Rectangle rect = getWrapLabel().getTextBounds().getCopy();
      getWrapLabel().translateToAbsolute(rect);
      if (getWrapLabel().isTextWrapOn()
          && getWrapLabel().getText().length() > 0) {
        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
View Full Code Here

        rect.setSize(new Dimension(text.computeSize(rect.width,
            SWT.DEFAULT)));
      } else {
        int avr = FigureUtilities.getFontMetrics(text.getFont())
            .getAverageCharWidth();
        rect.setSize(new Dimension(text.computeSize(SWT.DEFAULT,
            SWT.DEFAULT)).expand(avr * 2, 0));
      }
      if (!rect.equals(new Rectangle(text.getBounds()))) {
        text.setBounds(rect.x, rect.y, rect.width, rect.height);
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.