Author: adietish
Date: 2011-05-19 05:23:28 -0400 (Thu, 19 May 2011)
New Revision: 31366
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java
Log:
[JBIDE-8090] initialized wizards when editing a connection / creating a new connection so
that they show a dialog title
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java 2011-05-19
09:02:43 UTC (rev 31365)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/EditConnectionHandler.java 2011-05-19
09:23:28 UTC (rev 31366)
@@ -17,11 +17,12 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.ui.IWorkbenchWizard;
import org.eclipse.ui.handlers.HandlerUtil;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
+import org.jboss.tools.internal.deltacloud.ui.utils.WorkbenchUtils;
import org.jboss.tools.internal.deltacloud.ui.wizards.EditCloudConnectionWizard;
/**
@@ -33,10 +34,12 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
+ IStructuredSelection structuredSelection = (IStructuredSelection) selection;
DeltaCloud cloud = UIUtils.getFirstAdaptedElement(selection, DeltaCloud.class);
if (cloud != null) {
- IWizard wizard = new EditCloudConnectionWizard(cloud);
- WizardDialog dialog = new WizardDialog(UIUtils.getActiveWorkbenchWindow().getShell(),
wizard);
+ IWorkbenchWizard wizard = new EditCloudConnectionWizard(cloud);
+ wizard.init(WorkbenchUtils.getWorkbench(), structuredSelection);
+ WizardDialog dialog = new
WizardDialog(WorkbenchUtils.getActiveWorkbenchWindow().getShell(), wizard);
dialog.create();
dialog.open();
}
Show replies by date