use of org.eclipse.jface.action.IMenuManager in project cubrid-manager by CUBRID.
the class CubridMenuProvider method buildDatabaseMenu.
/**
* Construct database related actions
*
* @param manager the parent IMenuManager
* @param node the ICubridNode object
*/
private void buildDatabaseMenu(IMenuManager manager, ICubridNode node) {
if (LoginDatabaseAction.isSupportedNode(node)) {
addActionToManager(manager, getAction(LoginDatabaseAction.ID));
}
if (LogoutDatabaseAction.isSupportedNode(node)) {
addActionToManager(manager, getAction(LogoutDatabaseAction.ID));
}
manager.add(new Separator());
addActionToManager(manager, getAction(EditDatabaseLoginAction.ID));
addActionToManager(manager, getAction(ConnectionUrlExportAction.ID));
manager.add(new Separator());
addActionToManager(manager, getAction(DatabaseQueryNewAction.ID));
manager.add(new Separator());
addActionToManager(manager, getAction(ShowDatabaseDashboardAction.ID));
manager.add(new Separator());
ActionManager.addActionToManager(manager, SchemaCompareWizardAction.ID);
ActionManager.addActionToManager(manager, DataCompareWizardAction.ID);
// manager.add(new Separator());
// addActionToManager(manager, getAction(OpenSchemaEditorAction.ID));
manager.add(new Separator());
addActionToManager(manager, getAction(ExportERwinAction.ID));
addActionToManager(manager, getAction(ImportERwinAction.ID));
manager.add(new Separator());
CubridDatabase database = (CubridDatabase) node;
if (database.isDistributorDb()) {
buildReplicationMenu(manager);
manager.add(new Separator());
}
// Export & Import Actions
manager.add(new Separator());
addActionToManager(manager, getAction(ExportWizardAction.ID));
addActionToManager(manager, getAction(ImportWizardAction.ID));
manager.add(new Separator());
addActionToManager(manager, getAction(ExportTableDefinitionAction.ID));
// Install Schema Comment
addActionToManager(manager, getAction(SchemaCommentInstallAction.ID));
manager.add(new Separator());
// manager.add(new Separator());
// addActionToManager(manager, getAction(RunSQLFileAction.ID));
// Database Management Actions
manager.add(new Separator());
IMenuManager dbManMenu = new MenuManager(Messages.dbManMenu, CubridManagerUIPlugin.getImageDescriptor("icons/navigator/database_man.png"), null);
manager.add(dbManMenu);
if (StartDatabaseAction.isSupportedNode(node)) {
addActionToManager(manager, getAction(StartDatabaseAction.ID));
}
if (StopDatabaseAction.isSupportedNode(node)) {
addActionToManager(manager, getAction(StopDatabaseAction.ID));
}
addActionToManager(dbManMenu, getAction(LoadDatabaseAction.ID));
addActionToManager(dbManMenu, getAction(UnloadDatabaseAction.ID));
dbManMenu.add(new Separator());
addActionToManager(dbManMenu, getAction(OptimizeAction.ID));
addActionToManager(dbManMenu, getAction(CompactDatabaseAction.ID));
addActionToManager(dbManMenu, getAction(CheckDatabaseAction.ID));
dbManMenu.add(new Separator());
addActionToManager(dbManMenu, getAction(CopyDatabaseAction.ID));
addActionToManager(dbManMenu, getAction(RenameDatabaseAction.ID));
dbManMenu.add(new Separator());
addActionToManager(dbManMenu, getAction(BackupDatabaseAction.ID));
addActionToManager(dbManMenu, getAction(RestoreDatabaseAction.ID));
dbManMenu.add(new Separator());
addActionToManager(dbManMenu, getAction(DeleteDatabaseAction.ID));
IMenuManager dbInfoMenu = new MenuManager(Messages.dbInfoMenu, CubridManagerUIPlugin.getImageDescriptor("icons/navigator/database_info.png"), null);
manager.add(dbInfoMenu);
addActionToManager(dbInfoMenu, getAction(LockInfoAction.ID));
addActionToManager(dbInfoMenu, getAction(TransactionInfoAction.ID));
if (CompatibleUtil.isSupportPlanAndParamDump(database.getServer().getServerInfo())) {
dbInfoMenu.add(new Separator());
addActionToManager(dbInfoMenu, getAction(PlanDumpAction.ID));
addActionToManager(dbInfoMenu, getAction(ParamDumpAction.ID));
}
dbInfoMenu.add(new Separator());
addActionToManager(dbInfoMenu, getAction(OIDNavigatorAction.ID));
manager.add(new Separator());
addActionToManager(manager, getAction(PropertyAction.ID));
}
use of org.eclipse.jface.action.IMenuManager in project tdi-studio-se by Talend.
the class BusinessAssignmentComposite method createPopupMenu.
private void createPopupMenu() {
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopUp");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager mgr) {
BusinessAssignment businessAssignment = getBusinessAssignment(tableViewer.getSelection());
if (businessAssignment != null) {
repositoryNode = createRepositoryNode(businessAssignment);
if (repositoryNode != null) {
List<ITreeContextualAction> contextualsActions = ActionsHelper.getRepositoryContextualsActions();
for (ITreeContextualAction action : contextualsActions) {
if (action.isReadAction() || action.isEditAction() || action.isPropertiesAction()) {
action.init(null, new StructuredSelection(repositoryNode));
if (action.isVisible()) {
((AContextualAction) action).setAvoidUnloadResources(true);
mgr.add(action);
}
}
}
if (ProjectManager.getInstance().isInCurrentMainProject(repositoryNode)) {
CorePlugin.getDefault().getDiagramModelService().addDeleteAssignmentAction(mgr, tableViewer.getSelection());
}
}
}
}
});
Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
tableViewer.getControl().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuManager in project tdi-studio-se by Talend.
the class HeapHistogramPage method createContextMenu.
/**
* Creates the context menu.
*
* @param actionBars The action bars
*/
private void createContextMenu(IActionBars actionBars) {
final OpenDeclarationAction openAction = OpenDeclarationAction.createOpenDeclarationAction(actionBars);
final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
configureColumnsAction = new ConfigureColumnsAction(this);
heapViewer.addSelectionChangedListener(openAction);
heapViewer.getControl().addFocusListener(new FocusListener() {
@Override
public void focusLost(FocusEvent e) {
heapViewer.removeSelectionChangedListener(copyAction);
}
@Override
public void focusGained(FocusEvent e) {
heapViewer.addSelectionChangedListener(copyAction);
}
});
heapViewer.addOpenListener(new IOpenListener() {
@Override
public void open(OpenEvent event) {
openAction.run();
}
});
//$NON-NLS-1$
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
@Override
public void menuAboutToShow(IMenuManager manager) {
manager.add(openAction);
manager.add(copyAction);
manager.add(new Separator());
manager.add(configureColumnsAction);
}
});
Menu menu = menuMgr.createContextMenu(heapViewer.getControl());
heapViewer.getControl().setMenu(menu);
}
use of org.eclipse.jface.action.IMenuManager in project tdi-studio-se by Talend.
the class AbstractJvmPropertySection method deactivateSection.
/**
* Deactivates the section.
*/
protected void deactivateSection() {
isSectionActivated = false;
if (pageBook.isDisposed() || messagePage.isDisposed() || messageLabel.isDisposed()) {
return;
}
// remove tool bar actions
IToolBarManager toolBarManager = getToolBarManager();
if (toolBarManager != null) {
removeToolBarActions(toolBarManager);
toolBarManager.update(false);
updateActionBars();
}
// remove local menus
IMenuManager menuManager = getMenuManager();
if (menuManager != null) {
menuManager.remove(preferencesAction.getId());
removeLocalMenus(menuManager);
menuManager.update(false);
updateActionBars();
}
// clear status line
clearStatusLine();
}
use of org.eclipse.jface.action.IMenuManager in project tdi-studio-se by Talend.
the class NewActionProvider method fillContextMenu.
/**
* Adds a submenu to the given menu with the name "New Component".
*/
public void fillContextMenu(IMenuManager menu) {
for (IContributionItem item : menu.getItems()) {
if (item == null || item.getId() == null) {
continue;
}
if (item.getId().equals("export") || item.getId().equals("import")) {
//$NON-NLS-1$ //$NON-NLS-2$
menu.remove(item);
}
}
// append the submenu after the GROUP_NEW group.
if (ComponentDesigenerPlugin.getDefault().isUsed()) {
//$NON-NLS-1$
IMenuManager submenu = new MenuManager(Messages.getString("NewActionProvider.New"), NEW_MENU_NAME);
submenu.add(newProjectAction);
menu.insertAfter(ICommonMenuConstants.GROUP_NEW, submenu);
}
}
Aggregations