List of usage examples for org.eclipse.swt.widgets Button setOrientation
public void setOrientation(int orientation)
SWT.LEFT_TO_RIGHT
or SWT.RIGHT_TO_LEFT
. From source file:org.eclipse.swt.snippets.Snippet366.java
private static void makeOrientationGroup() { Group orientationGroup = new Group(shell, SWT.None); orientationGroup.setLayout(new RowLayout()); orientationGroup.setText("Orientation group"); final AtomicInteger prevDir = new AtomicInteger(0); final Button alignmentButton = new Button(orientationGroup, SWT.ARROW | SWT.RIGHT); alignmentButton.addListener(SWT.MouseDown, event -> { switch (prevDir.get()) { case 0:// w w w .j av a2s . c o m alignmentButton.setOrientation(SWT.LEFT_TO_RIGHT); prevDir.set(1); break; case 1: alignmentButton.setOrientation(SWT.RIGHT_TO_LEFT); prevDir.set(0); break; default: break; } }); }