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

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

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

ErrorDialog.createDropDownList介绍

[英]Create this dialog's drop-down list component. The list is displayed after the user presses details button. It is developer responsibility to display details button if and only if there is some content on drop down list. The visibility of the details button is controlled by #shouldShowDetailsButton(), which should also be overridden together with this method.
[中]创建此对话框的下拉列表组件。用户按下“详细信息”按钮后,将显示该列表。当且仅当下拉列表中有某些内容时,开发人员才有责任显示详细信息按钮。详细信息按钮的可见性由#shouldshowtailsbutton()控制,该按钮也应与此方法一起覆盖。

代码示例

代码示例来源: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.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)));
  }
}

代码示例来源: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)));
}

相关文章