* @param menu
* @param mainWindow
* @return
*/
public static Menu createDebugMenuItem(final Menu menu) {
MenuItem item;
final UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
if (null == uiFunctions) {
throw new IllegalStateException(
"UIFunctionsManagerSWT.getUIFunctionsSWT() is returning null");
}
item = new MenuItem(menu, SWT.CASCADE);
item.setText("&Debug");
Menu menuDebug = new Menu(menu.getParent(), SWT.DROP_DOWN);
item.setMenu(menuDebug);
item = new MenuItem(menuDebug, SWT.CASCADE);
item.setText("ScreenSize");
Menu menuSS = new Menu(menu.getParent(), SWT.DROP_DOWN);
item.setMenu(menuSS);
item = new MenuItem(menuSS, SWT.NONE);
item.setText("640x400");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(640, 400);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("800x560");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(850, 560);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1024x700");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1024, 700);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1024x768");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1024, 768);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1152x784");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1152, 784);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1280x720");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1280, 720);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1280x1024");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1280, 1024);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1440x820");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1440, 820);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1600x970");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1600, 970);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("1920x1200");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(1920, 1200);
}
});
item = new MenuItem(menuSS, SWT.NONE);
item.setText("2560x1520");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
uiFunctions.getMainShell().setSize(2560, 1520);
}
});
item = new MenuItem(menuDebug, SWT.NONE);
item.setText("Reload messagebundle");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
MessageText.loadBundle(true);
DisplayFormatters.setUnits();
DisplayFormatters.loadMessages();
UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
if (uiFunctions != null) {
uiFunctions.refreshLanguage();
}
}
});
item = new MenuItem(menuDebug, SWT.CHECK);
item.setText("SR ChangeFlagChecker Paused");
item.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
StartStopRulesDefaultPlugin.pauseChangeFlagChecker = !StartStopRulesDefaultPlugin.pauseChangeFlagChecker;
((MenuItem)e.widget).setSelection(StartStopRulesDefaultPlugin.pauseChangeFlagChecker);
}
});