[英]Right to Left Shell in SWT
In order to explicitly change the orientation of an SWT control, use 为了显式更改SWT控件的方向,请使用
setOrientation( SWT.RIGHT_TO_LEFT );
It is also possible to pass the RIGHT_TO_LEFT
style flag to the constructor, for example 例如,也可以将
RIGHT_TO_LEFT
样式标志传递给构造函数
new Shell( parent, SWT.DIALOG_TRIM | SWT.RIGHT_TO_LEFT );
A JFace Window
will contain a SWT Shell
when opened. JFace
Window
在打开时将包含SWT Shell
。
There is the Shell#setOrientation
API (which is inherited from Control
, btw). 有
Shell#setOrientation
API(继承自Control
,btw)。 Use that to mirror you controls (check the javadoc). 使用它来镜像您的控件(检查javadoc)。
/**
*
* @author ggrec
*
*/
public class Tester
{
public static void main(final String[] args)
{
final Display display = new Display();
final Shell shell = new Shell(display);
shell.setLayout(new GridLayout(1, false));
shell.setOrientation(SWT.RIGHT_TO_LEFT);
shell.pack();
shell.open();
while (!shell.isDisposed())
{
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.