org.eclipse.swt.widgets.Label.getSize()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(167)

本文整理了Java中org.eclipse.swt.widgets.Label.getSize()方法的一些代码示例,展示了Label.getSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Label.getSize()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Label
类名称:Label
方法名:getSize

Label.getSize介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean isMouseInButton(MouseEvent e) {
    Point buttonSize= clearButton.getSize();
    return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

private boolean isMouseInButton(MouseEvent e) {
    Point buttonSize = clearButton.getSize();
    return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
  }
});

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean isMouseInButton(MouseEvent e) {
    Point buttonSize= clearButton.getSize();
    return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
  }
});

代码示例来源:origin: org.eclipse.mylyn.commons/workbench

private boolean isMouseInButton(MouseEvent e) {
    Point buttonSize = labelButton.getSize();
    return 0 <= e.x && e.x < buttonSize.x && 0 <= e.y && e.y < buttonSize.y;
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

protected void createTextField(String labelText, String initialValue, boolean allowEmpty) {
  Label label = new Label(panel, SWT.NONE);
  label.setText(labelText);
  label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
  final Text text = new Text(panel, SWT.SINGLE | SWT.BORDER);
  text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  text.setData(FIELD_NAME, labelText);
  // make sure rows are the same height on both panels.
  label.setSize(label.getSize().x, text.getSize().y);
  if (initialValue != null) {
    text.setText(initialValue);
  }
  if (!allowEmpty) {
    validators.add(new Validator() {
      @Override
      public boolean validate() {
        return !text.getText().equals(IInternalDebugCoreConstants.EMPTY_STRING);
      }
    });
    text.addModifyListener(new ModifyListener() {
      @Override
      public void modifyText(ModifyEvent e) {
        validateFields();
      }
    });
  }
  controlList.add(text);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

label.setSize(label.getSize().x, text.getSize().y);

代码示例来源:origin: org.eclipse.platform/org.eclipse.debug.ui

label.setSize(label.getSize().x, text.getSize().y);

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

public void handleEvent(Event event) {
    if (event.detail != SWT.DRAG) {
      Rectangle clientArea = shell.getClientArea();
      int newWidth = clientArea.width - event.x - (sash.getSize().x + rightSeparator.getSize().x);
      if (newWidth != data.widthHint) {
        data.widthHint = newWidth;
        shell.layout();
      }
    }
  }
});

代码示例来源:origin: BiglySoftware/BiglyBT

protected final Label createFixedLabel(int width) {
  assertConstructing();
  Label result = new Label(splash, SWT.NONE);
  result.setBackground(Colors.white);
  result.setSize(width, SWT.DEFAULT );
  result.setLocation(this.xSize, 0);
  result.addMouseListener(this.mListener);
  result.addMouseMoveListener(this.mMoveListener);
  result.setMenu(this.menu);
  if (this.hSize == -1) {
    int hSizeText = result.getSize().y;
    int hSizeImage = this.lDrag.getSize().y;
    this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
  }
  this.xSize += width;
  return( result );
}

代码示例来源:origin: BiglySoftware/BiglyBT

protected final Label createFixedTextLabel(String msg_key, boolean add_colon, boolean bold) {
  assertConstructing();
  Label result = new Label(splash, SWT.NONE);
  result.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);
  result.setForeground(Colors.blues[Colors.BLUES_DARKEST]);
  result.setText(MessageText.getString(msg_key) + ((add_colon) ? ":" : ""));
  if (bold) {
    if (this.bold_font == null) {
      this.bold_font = createBoldFont(result.getFont());
    }
    result.setFont(this.bold_font);
  }
  result.addMouseListener(this.mListener);
  result.addMouseMoveListener(this.mMoveListener);
  result.pack();
  result.setLocation(this.xSize, 0);
  result.setMenu(this.menu);
  if (this.hSize == -1) {
    int hSizeText = result.getSize().y;
    int hSizeImage = this.lDrag.getSize().y;
    this.hSize = hSizeText > hSizeImage ? hSizeText : hSizeImage;
  }
  this.xSize += result.getSize().x + 3;
  return( result );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Returns the minimal required height for the proposal, may return 0 if the popup has not been
 * created yet.
 *
 * @return the minimal height
 * @since 3.3
 */
int getMinimalHeight() {
  int height= 0;
  if (Helper.okToUse(fProposalTable)) {
    int items= fProposalTable.getItemHeight() * 10;
    Rectangle trim= fProposalTable.computeTrim(0, 0, SWT.DEFAULT, items);
    height= trim.height;
  }
  if (Helper.okToUse(fMessageText))
    height+= fMessageText.getSize().y + 1;
  return height;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Returns the minimal required height for the proposal, may return 0 if the popup has not been
 * created yet.
 *
 * @return the minimal height
 * @since 3.3
 */
int getMinimalHeight() {
  int height= 0;
  if (Helper.okToUse(fProposalTable)) {
    int items= fProposalTable.getItemHeight() * 10;
    Rectangle trim= fProposalTable.computeTrim(0, 0, SWT.DEFAULT, items);
    height= trim.height;
  }
  if (Helper.okToUse(fMessageText))
    height+= fMessageText.getSize().y + 1;
  return height;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

@Override
protected void adjustBounds() {
  // grow/shrink a wrappable Label's height to show its content as it changes
  Display display = getShell().getDisplay();
  if (display != null && label != null) {
    Rectangle clientArea = display.getClientArea();
    if (clientArea != null && clientArea.width > 0) {
      int workbenchWidth = clientArea.width;
      int currentHeight = label.getSize().y;
      int preferredHeight = label.computeSize(workbenchWidth, SWT.DEFAULT).y;
      if (currentHeight != preferredHeight) {
        GridData data = (GridData) label.getLayoutData();
        data.heightHint = preferredHeight;
        getShell().pack();
      }
    }
  }
}

代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui

int minLabelWidth= label.getSize().x + 3 * layout.horizontalSpacing;
if (minLabelWidth > combo.getSize().x)
  label.setLayoutData(new GridData(minLabelWidth, label.getSize().y));

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

int minLabelWidth= label.getSize().x + 3 * layout.horizontalSpacing;
if (minLabelWidth > combo.getSize().x)
  label.setLayoutData(new GridData(minLabelWidth, label.getSize().y));

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

int minLabelWidth= label.getSize().x + 3 * layout.horizontalSpacing;
if (minLabelWidth > combo.getSize().x)
  label.setLayoutData(new GridData(minLabelWidth, label.getSize().y));

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

shell.removeControlListener (resizeListener);
resizeListener = null;
final int trayWidth = trayControl.getSize().x + leftSeparator.getSize().x + sash.getSize().x + rightSeparator.getSize().x;
trayControl.dispose();
trayControl = null;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

if (event.detail != SWT.DRAG) {
  Rectangle clientArea1 = shell.getClientArea();
  int newWidth = clientArea1.width - event.x - (sash.getSize().x + rightSeparator.getSize().x);
  if (newWidth != data.widthHint) {
    data.widthHint = newWidth;

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

shell.removeControlListener (resizeListener);
resizeListener = null;
int trayWidth = trayControl.getSize().x + leftSeparator.getSize().x + sash.getSize().x + rightSeparator.getSize().x;
trayControl.dispose();
trayControl = null;

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

shell.removeControlListener (resizeListener);
resizeListener = null;
int trayWidth = trayControl.getSize().x + leftSeparator.getSize().x + sash.getSize().x + rightSeparator.getSize().x;
trayControl.dispose();
trayControl = null;

相关文章