org.eclipse.jface.dialogs.ErrorDialog.getShell()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(120)

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

ErrorDialog.getShell介绍

暂无

代码示例

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

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button.
 */
private void toggleDetailsArea() {
  boolean opened = false;
  Point windowSize = getShell().getSize();
  if (listCreated) {
    list.dispose();
    listCreated = false;
    detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    opened = false;
  } else {
    list = createDropDownList((Composite) getContents());
    detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    getContents().getShell().layout();
    opened = true;
  }
  Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
  int diffY = newSize.y - windowSize.y;
  // increase the dialog height if details were opened and such increase is necessary
  // decrease the dialog height if details were closed and empty space appeared
  if ((opened && diffY > 0) || (!opened && diffY < 0)) {
    getShell().setSize(new Point(windowSize.x, windowSize.y + (diffY)));
  }
}

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

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button.
 */
private void toggleDetailsArea() {
  Point windowSize = getShell().getSize();
  Point oldSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
  if (listCreated) {
    list.dispose();
    listCreated = false;
    detailsButton.setText(IDialogConstants.get().SHOW_DETAILS_LABEL);
  } else {
    list = createDropDownList((Composite) getContents());
    detailsButton.setText(IDialogConstants.get().HIDE_DETAILS_LABEL);
    getContents().getShell().layout();
  }
  Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
  getShell()
      .setSize(
          new Point(windowSize.x, windowSize.y
              + (newSize.y - oldSize.y)));
}

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

/**
 * Toggles the unfolding of the details area. This is triggered by the user
 * pressing the details button.
 */
private void toggleDetailsArea() {
  boolean opened = false;
  Point windowSize = getShell().getSize();
  if (listCreated) {
    list.dispose();
    listCreated = false;
    detailsButton.setText(IDialogConstants.SHOW_DETAILS_LABEL);
    opened = false;
  } else {
    list = createDropDownList((Composite) getContents());
    detailsButton.setText(IDialogConstants.HIDE_DETAILS_LABEL);
    getContents().getShell().layout();
    opened = true;
  }
  Point newSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
  int diffY = newSize.y - windowSize.y;
  // increase the dialog height if details were opened and such increase is necessary
  // decrease the dialog height if details were closed and empty space appeared
  if ((opened && diffY > 0) || (!opened && diffY < 0)) {
    getShell().setSize(new Point(windowSize.x, windowSize.y + (diffY)));
  }
}

相关文章