本文整理了Java中org.eclipse.swt.widgets.List.dispose()
方法的一些代码示例,展示了List.dispose()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。List.dispose()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.List
类名称:List
方法名:dispose
暂无
代码示例来源: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)));
}
内容来源于网络,如有侵权,请联系作者删除!