Search in sources :

Example 1 with ApplicationWorkbenchWindowAdvisor

use of net.heartsome.cat.ts.ApplicationWorkbenchWindowAdvisor in project translationstudio8 by heartsome.

the class OpenStatusBarHandler method execute.

public Object execute(ExecutionEvent event) throws ExecutionException {
    IPreferenceStore preferenceStore = Activator.getDefault().getPreferenceStore();
    boolean oldValue = preferenceStore.getBoolean(TsPreferencesConstant.TS_statusBar_status);
    ApplicationWorkbenchWindowAdvisor configurer = ApplicationWorkbenchAdvisor.WorkbenchWindowAdvisor;
    configurer.setStatusVisible(!oldValue);
    preferenceStore.setValue(TsPreferencesConstant.TS_statusBar_status, !oldValue);
    ICommandService commandService = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
    commandService.refreshElements(event.getCommand().getId(), null);
    return null;
}
Also used : ApplicationWorkbenchWindowAdvisor(net.heartsome.cat.ts.ApplicationWorkbenchWindowAdvisor) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) ICommandService(org.eclipse.ui.commands.ICommandService)

Aggregations

ApplicationWorkbenchWindowAdvisor (net.heartsome.cat.ts.ApplicationWorkbenchWindowAdvisor)1 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)1 ICommandService (org.eclipse.ui.commands.ICommandService)1