Search in sources :

Example 1 with OkButtonWizardDialog

use of org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog in project jbosstools-openshift by jbosstools.

the class PortForwardingHandler method openDialog.

private void openDialog(final IPod pod) {
    Shell shell = PlatformUI.getWorkbench().getModalDialogShellProvider().getShell();
    WizardDialog dialog = new OkButtonWizardDialog(shell, new PortForwardingWizard(new PortForwardingWizardModel(pod)));
    dialog.setMinimumPageSize(700, 400);
    dialog.create();
    dialog.open();
}
Also used : OkButtonWizardDialog(org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog) Shell(org.eclipse.swt.widgets.Shell) PortForwardingWizardModel(org.jboss.tools.openshift.internal.ui.portforwading.PortForwardingWizardModel) OkButtonWizardDialog(org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog) WizardDialog(org.eclipse.jface.wizard.WizardDialog) PortForwardingWizard(org.jboss.tools.openshift.internal.ui.portforwading.PortForwardingWizard)

Example 2 with OkButtonWizardDialog

use of org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog in project jbosstools-openshift by jbosstools.

the class ManageProjectsHandler method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    ISelection selection = HandlerUtil.getCurrentSelection(event);
    Connection connection = UIUtils.getFirstElement(selection, Connection.class);
    if (connection == null) {
        IResource resource = UIUtils.getFirstElement(selection, IResource.class);
        if (resource != null) {
            connection = ConnectionsRegistryUtil.getConnectionFor(resource);
        }
    }
    if (connection == null) {
        return OpenShiftUIActivator.statusFactory().cancelStatus("No connection selected that we can manage projects for.");
    }
    new OkButtonWizardDialog(HandlerUtil.getActiveShell(event), new ManageProjectsWizard(connection)).open();
    return null;
}
Also used : OkButtonWizardDialog(org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog) ISelection(org.eclipse.jface.viewers.ISelection) Connection(org.jboss.tools.openshift.core.connection.Connection) ManageProjectsWizard(org.jboss.tools.openshift.internal.ui.wizard.project.ManageProjectsWizard) IResource(com.openshift.restclient.model.IResource)

Aggregations

OkButtonWizardDialog (org.jboss.tools.openshift.common.ui.wizard.OkButtonWizardDialog)2 IResource (com.openshift.restclient.model.IResource)1 ISelection (org.eclipse.jface.viewers.ISelection)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 Shell (org.eclipse.swt.widgets.Shell)1 Connection (org.jboss.tools.openshift.core.connection.Connection)1 PortForwardingWizard (org.jboss.tools.openshift.internal.ui.portforwading.PortForwardingWizard)1 PortForwardingWizardModel (org.jboss.tools.openshift.internal.ui.portforwading.PortForwardingWizardModel)1 ManageProjectsWizard (org.jboss.tools.openshift.internal.ui.wizard.project.ManageProjectsWizard)1