use of com.cubrid.common.ui.common.action.GroupSettingAction in project cubrid-manager by CUBRID.
the class CubridHostNavigatorView method buildToolBar.
/**
* Build the view toolbar
*
* @param toolBarManager IToolBarManager
*/
protected void buildToolBar(IToolBarManager toolBarManager) {
ActionManager manager = ActionManager.getInstance();
RefreshAction refreshAction = (RefreshAction) ActionManager.getInstance().getAction(RefreshAction.ID);
toolBarManager.add(refreshAction);
OpenTargetAction openObjectTabAction = (OpenTargetAction) manager.getAction(OpenTargetAction.ID);
toolBarManager.add(openObjectTabAction);
SwitchGroupModeAction grpSwitchAction = (SwitchGroupModeAction) manager.getAction(SwitchGroupModeAction.ID);
grpSwitchAction.setNavigatorView(this);
grpSwitchAction.init();
toolBarManager.add(grpSwitchAction);
GroupSettingAction groupSettingAction = (GroupSettingAction) manager.getAction(GroupSettingAction.ID);
groupSettingAction.setNavigatorView(this);
toolBarManager.add(groupSettingAction);
ExpandTreeItemAction expandAction = (ExpandTreeItemAction) manager.getAction(ExpandTreeItemAction.ID);
expandAction.setTargetTreeViewer(tv);
toolBarManager.add(expandAction);
UnExpandTreeItemAction unexpandAction = (UnExpandTreeItemAction) manager.getAction(UnExpandTreeItemAction.ID);
unexpandAction.setTv(tv);
toolBarManager.add(unexpandAction);
}
use of com.cubrid.common.ui.common.action.GroupSettingAction in project cubrid-manager by CUBRID.
the class CubridNavigatorView method buildViewMenu.
/**
* Build the view menu
*
* @param menuManager IMenuManager
*/
protected void buildViewMenu(final IMenuManager menuManager) {
ActionManager actionManager = ActionManager.getInstance();
if (isSupportGroup()) {
IMenuManager topLevel = new MenuManager(Messages.topLevelElements);
menuManager.add(topLevel);
{
TopGroupItemAction groupAction = (TopGroupItemAction) actionManager.getAction(TopGroupItemAction.ID);
if (groupAction == null) {
LOGGER.warn("The groupAction is a null.");
return;
}
groupAction.setNavigatorView(this);
topLevel.add(groupAction);
TopGroupAction connAction = (TopGroupAction) actionManager.getAction(TopGroupAction.ID);
if (connAction == null) {
LOGGER.warn("The connAction is a null.");
return;
}
connAction.setNavigatorView(this);
topLevel.add(connAction);
}
menuManager.add(new Separator());
GroupSettingAction gsAction = (GroupSettingAction) actionManager.getAction(GroupSettingAction.ID);
if (gsAction == null) {
LOGGER.warn("The gsAction is a null.");
return;
}
gsAction.setNavigatorView(this);
menuManager.add(gsAction);
}
//add the showTooTip action
menuManager.add(new Separator());
ShowToolTipAction showToolTipAction = new ShowToolTipAction(Messages.showToolTipActionName, null);
menuManager.add(showToolTipAction);
menuManager.add(new Separator());
CollapseAllAction collapseAllAction = (CollapseAllAction) actionManager.getAction(CollapseAllAction.ID);
if (collapseAllAction == null) {
LOGGER.warn("The collapseAllAction is a null.");
return;
}
collapseAllAction.setTargetTreeViewer(tv);
menuManager.add(collapseAllAction);
//add the root node filter action
menuManager.add(new Separator());
//add filter setting action
IAction action = actionManager.getAction(FilterSettingAction.ID);
if (action instanceof FilterSettingAction) {
((FilterSettingAction) action).setTv(tv);
menuManager.add(action);
}
Object inputObj = tv.getInput();
if (!(inputObj instanceof List<?>)) {
return;
}
List<?> list = (List<?>) inputObj;
int i = 1;
for (Object obj : list) {
if (!(obj instanceof ICubridNode)) {
continue;
}
ICubridNode node = (ICubridNode) obj;
String label = "&" + i + " " + node.getLabel();
if (node.getLabel().indexOf("@") >= 0) {
//if text have @ character, the sub string of the last @ will be as accelerator, hence add @
label += "@";
}
NodeFilterAction nodeFilterAction = new NodeFilterAction(label, null, tv, node);
nodeFilterAction.setChecked(NodeFilterManager.getInstance().isExistIdFilter(node.getId()));
menuManager.add(nodeFilterAction);
i++;
}
}
use of com.cubrid.common.ui.common.action.GroupSettingAction in project cubrid-manager by CUBRID.
the class CubridQueryNavigatorView method buildToolBar.
/**
* Build the view toolbar
*
* @param toolBarManager IToolBarManager
*/
protected void buildToolBar(IToolBarManager toolBarManager) {
OpenTargetAction openObjectTabAction = (OpenTargetAction) ActionManager.getInstance().getAction(OpenTargetAction.ID);
toolBarManager.add(openObjectTabAction);
SwitchGroupModeAction grpSwitchAction = (SwitchGroupModeAction) ActionManager.getInstance().getAction(SwitchGroupModeAction.ID);
grpSwitchAction.setNavigatorView(this);
grpSwitchAction.init();
toolBarManager.add(grpSwitchAction);
GroupSettingAction groupSettingAction = (GroupSettingAction) ActionManager.getInstance().getAction(GroupSettingAction.ID);
groupSettingAction.setNavigatorView(this);
toolBarManager.add(groupSettingAction);
ExpandTreeItemAction expandAction = (ExpandTreeItemAction) ActionManager.getInstance().getAction(ExpandTreeItemAction.ID);
expandAction.setTargetTreeViewer(tv);
toolBarManager.add(expandAction);
UnExpandTreeItemAction unexpandAction = (UnExpandTreeItemAction) ActionManager.getInstance().getAction(UnExpandTreeItemAction.ID);
unexpandAction.setTv(tv);
toolBarManager.add(unexpandAction);
}
Aggregations