public class ActionUtils {
static void createLayoutActions(IManagedForm managedForm,
final SashForm sashForm) {
final ScrolledForm form = managedForm.getForm();
Action haction = new Action("hor", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
public void run() {
sashForm.setOrientation(SWT.HORIZONTAL);
form.reflow(true);
}
};
haction.setChecked(true);
haction.setToolTipText(Messages.horizontal);
JMXImages.setLocalImageDescriptors(haction, "th_horizontal.gif"); //$NON-NLS-1$
Action vaction = new Action("ver", Action.AS_RADIO_BUTTON) { //$NON-NLS-1$
public void run() {
sashForm.setOrientation(SWT.VERTICAL);
form.reflow(true);
}
};
vaction.setChecked(false);
vaction.setToolTipText(Messages.vertical);
JMXImages.setLocalImageDescriptors(vaction, "th_vertical.gif"); //$NON-NLS-1$
form.getToolBarManager().add(haction);
form.getToolBarManager().add(vaction);
}