本文整理汇总了Java中org.eclipse.swt.SWT.MAX属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.MAX属性的具体用法?Java SWT.MAX怎么用?Java SWT.MAX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.MAX属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: launchXMLTextContainerWindow
/**
* Launches the component property editor window for Unknown components. It is used to display XML content of Unknown
* components on property window.
*
* @return XML content of component.
*/
public String launchXMLTextContainerWindow() {
try{
String xmlText = this.xmlText;
Shell shell = new Shell(Display.getDefault().getActiveShell(), SWT.WRAP | SWT.MAX | SWT.APPLICATION_MODAL);
shell.setLayout(new GridLayout(1, false));
shell.setText("XML Content");
shell.setSize(439, 432);
text = new Text(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
text.setEditable(false);
text.setBackground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 250, 250, 250));
if (this.xmlText != null) {
xmlText = xmlText.substring(xmlText.indexOf('\n') + 1);
xmlText = xmlText.substring(xmlText.indexOf('\n') + 1, xmlText.lastIndexOf('\n') - 13);
text.setText(xmlText);
} else
text.setText(Messages.EMPTY_XML_CONTENT);
GridData gd_text = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
gd_text.widthHint = 360;
gd_text.heightHint = 360;
text.setLayoutData(gd_text);
Monitor primary = shell.getDisplay().getPrimaryMonitor();
Rectangle bounds = primary.getBounds();
Rectangle rect = shell.getBounds();
int x = bounds.x + (bounds.width - rect.width) / 2;
int y = bounds.y + (bounds.height - rect.height) / 2;
shell.setLocation(x, y);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!shell.getDisplay().readAndDispatch()) {
shell.getDisplay().sleep();
}
}
}catch(Exception e)
{
LOGGER.error("Error occurred while creating XML text container widget", e);
}
return getXmlText();
}
示例2: calcState
private int calcState(Shell shell) {
return shell.getMinimized() ? SWT.MIN : shell.getMaximized() ? SWT.MAX : SWT.NONE;
}
示例3: getShellStyle
protected int getShellStyle() {
return super.getShellStyle()|SWT.RESIZE|SWT.MAX;
}