Search in sources :

Example 1 with ConnectionWizard

use of org.mongodb.meclipse.wizards.ConnectionWizard 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();
        }
    };
}
Also used : Action(org.eclipse.jface.action.Action) Shell(org.eclipse.swt.widgets.Shell) ConnectionWizard(org.mongodb.meclipse.wizards.ConnectionWizard) ISelection(org.eclipse.jface.viewers.ISelection) TreeObject(org.mongodb.meclipse.views.objects.TreeObject) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) WizardDialog(org.eclipse.jface.wizard.WizardDialog)

Aggregations

Action (org.eclipse.jface.action.Action)1 ISelection (org.eclipse.jface.viewers.ISelection)1 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Shell (org.eclipse.swt.widgets.Shell)1 TreeObject (org.mongodb.meclipse.views.objects.TreeObject)1 ConnectionWizard (org.mongodb.meclipse.wizards.ConnectionWizard)1