use of org.eclipse.jface.action.ICoolBarManager 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.jface.action.ICoolBarManager in project cubrid-manager by CUBRID.
the class ApplicationWorkbenchWindowAdvisor method removePlatformDependencyActions.
private void removePlatformDependencyActions() {
// remove some menu items
IMenuManager mm = getWindowConfigurer().getActionBarConfigurer().getMenuManager();
for (IContributionItem item : mm.getItems()) {
if (item == null) {
continue;
}
if (item instanceof MenuManager) {
MenuManager sm = (MenuManager) item;
for (IContributionItem sitem : sm.getItems()) {
if (sitem == null || sitem.getId() == null) {
continue;
}
if (sitem.getId().equals("org.eclipse.ui.actions.showKeyAssistHandler") || sitem.getId().equals("com.cubrid.common.update.p2.menu.install") || sitem.getId().equals("converstLineDelimitersTo") || sitem.getId().equals("save.ext") || sitem.getId().equals("org.eclipse.ui.openLocalFile") || sitem.getId().equals("new.ext")) {
sm.remove(sitem.getId());
sm.update(true);
mm.update(true);
}
}
}
}
// remove some tool bar items
ICoolBarManager cm = getWindowConfigurer().getActionBarConfigurer().getCoolBarManager();
for (IContributionItem item : cm.getItems()) {
if (item == null || item.getId() == null) {
continue;
}
if (item.getId().equals("org.eclipse.ui.edit.text.actionSet.annotationNavigation") || item.getId().equals("org.eclipse.ui.edit.text.actionSet.navigation")) {
cm.remove(item.getId());
cm.update(true);
}
}
// remove some preference items
PreferenceManager pm = getWindowConfigurer().getWindow().getWorkbench().getPreferenceManager();
for (IPreferenceNode item : pm.getRootSubNodes()) {
if (item.getId().equals("org.eclipse.help.ui.browsersPreferencePage") || item.getId().equals("org.eclipse.ui.preferencePages.Workbench")) {
pm.remove(item.getId());
}
}
}
use of org.eclipse.jface.action.ICoolBarManager 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.jface.action.ICoolBarManager 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.jface.action.ICoolBarManager 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