use of org.mongodb.meclipse.views.objects.TreeObject in project meclipse by flaper87.
the class MeclipseView method makeActions.
private void makeActions() {
final MeclipseView mView = this;
connection = new Action() {
public void run() {
ConnectionWizard wizard = new ConnectionWizard();
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
WizardDialog dialog = new WizardDialog(shell, wizard);
dialog.create();
dialog.open();
mView.refreshMe();
}
};
connection.setText(getCaption("connection.new"));
connection.setToolTipText(getCaption("connection.new"));
connection.setImageDescriptor(Images.getDescriptor(Images.PageCommit));
doubleClickAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
TreeObject obj = (TreeObject) ((IStructuredSelection) selection).getFirstElement();
obj.doubleClickAction();
}
};
}
use of org.mongodb.meclipse.views.objects.TreeObject in project meclipse by flaper87.
the class MeclipseView method hookContextMenu.
private void hookContextMenu() {
MenuManager menuMgr = new MenuManager("#PopupMenu");
menuMgr.setRemoveAllWhenShown(true);
menuMgr.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
if (selection.isEmpty()) {
MeclipseView.this.fillContextMenu(manager);
return;
}
TreeObject obj = (TreeObject) selection.getFirstElement();
manager.add(new Separator());
obj.fillContextMenu(manager);
}
});
Menu menu = menuMgr.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(menuMgr, viewer);
}
Aggregations