use of org.eclipse.ui.internal.WorkbenchWindow in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method updateStatusLineForRestoreQueryEditor.
private void updateStatusLineForRestoreQueryEditor() {
final int countOfRestorableQueryEditors = ApplicationPersistUtil.getInstance().countOfRestorableQueryEditorsAtLastSession();
if (countOfRestorableQueryEditors <= 0) {
return;
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
StatusLineManager statusLineManager = null;
if (window instanceof WorkbenchWindow) {
statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
}
if (statusLineManager == null) {
return;
}
IContributionItem scaleItem = new ControlContribution(RESTORE_QUERY_EDITORS_CONTR_ID) {
protected Control createControl(Composite parent) {
Button btn = new Button(parent, SWT.None);
String buttonTitle = Messages.bind(Messages.restoreQueryEditorTitle, countOfRestorableQueryEditors);
btn.setText(buttonTitle);
btn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
ActionManager manager = ActionManager.getInstance();
IAction action = manager.getAction(RestoreQueryEditorAction.ID);
if (action != null && action instanceof RestoreQueryEditorAction) {
((RestoreQueryEditorAction) action).run();
}
}
});
return btn;
}
;
};
statusLineManager.add(scaleItem);
}
use of org.eclipse.ui.internal.WorkbenchWindow in project cubrid-manager by CUBRID.
the class CubridStatusLineContrItem method clearStatusLine.
/**
*
* Clear the status line information of CUBRID Query
*
*/
public void clearStatusLine() {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window == null) {
return;
}
if (window instanceof WorkbenchWindow) {
StatusLineManager statusLineManager = ((WorkbenchWindow) window).getStatusLineManager();
if (statusLineManager != null) {
statusLineManager.remove(RESTORE_QUERY_EDITORS_CONTR_ID);
statusLineManager.remove(UPDATE_APP_CONTR_ID);
statusLineManager.remove(DB_INFO_CONTR_ID);
statusLineManager.remove(OBJ_NUM_INFO_CONTR_ID);
statusLineManager.update(true);
}
}
}
use of org.eclipse.ui.internal.WorkbenchWindow in project cubrid-manager by CUBRID.
the class PerspectiveChangedListener method showPerspective.
public void showPerspective(PerspectiveChangeEvent event) {
WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
ICoolBarManager coolBarManager = window.getCoolBarManager2();
IMenuManager menuManager = window.getMenuBarManager();
ActionAdvisor.getInstance().showToolbar(coolBarManager);
ActionAdvisor.getInstance().showMenu(menuManager);
}
ActionManager.getInstance().setMenuProvider(menuProvider);
LayoutManager.getInstance().setStatusLineContrItem(cubridStatusLineContrItem);
LayoutManager.getInstance().setTitleLineContrItem(cubridTitleLineContrItem);
cubridTitleLineContrItem.changeTitleForNavigator(null);
LayoutManager.getInstance().setWorkbenchContrItem(cubridWorkbenchContrItem);
CubridNavigatorView cubridNavigatorView = CubridNavigatorView.findNavigationView();
if (cubridNavigatorView != null) {
cubridNavigatorView.setFocus();
}
}
use of org.eclipse.ui.internal.WorkbenchWindow in project cubrid-manager by CUBRID.
the class PerspectiveChangedListener method hidePerspectiveHide.
public void hidePerspectiveHide(PerspectiveChangeEvent event) {
WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
ICoolBarManager coolBarManager = window.getCoolBarManager2();
IMenuManager menuManager = window.getMenuBarManager();
ActionAdvisor.getInstance().hideToolbar(coolBarManager);
ActionAdvisor.getInstance().hideMenu(menuManager);
}
}
use of org.eclipse.ui.internal.WorkbenchWindow in project cubrid-manager by CUBRID.
the class PerspectiveChangedListener method showPerspective.
public void showPerspective(PerspectiveChangeEvent event) {
WorkbenchWindow window = (WorkbenchWindow) PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
ICoolBarManager coolBarManager = window.getCoolBarManager2();
IMenuManager menuManager = window.getMenuBarManager();
ActionAdvisor.getInstance().showToolbar(coolBarManager);
ActionAdvisor.getInstance().showMenu(menuManager);
}
ActionManager.getInstance().setMenuProvider(menuProvider);
LayoutManager.getInstance().setStatusLineContrItem(cubridStatusLineContrItem);
LayoutManager.getInstance().setTitleLineContrItem(cubridTitleLineContrItem);
cubridTitleLineContrItem.changeTitleForNavigator(null);
LayoutManager.getInstance().setWorkbenchContrItem(cubridWorkbenchContrItem);
CubridNavigatorView navigatorView = CubridNavigatorView.findNavigationView();
if (navigatorView != null) {
navigatorView.setFocus();
if (navigatorView.getViewer() != null) {
navigatorView.getViewer().refresh(true);
}
}
}
Aggregations