Search in sources :

Example 1 with CreateStorageWizard

use of org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateStorageWizard in project jbosstools-openshift by jbosstools.

the class CreateStorageHandler method execute.

@Override
public Object execute(ComponentElement component, Shell shell) throws ExecutionException {
    try {
        Odo odo = component.getRoot().getOdo();
        String projectName = component.getParent().getParent().getWrapped();
        String applicationName = component.getParent().getWrapped().getName();
        final CreateStorageModel model = new CreateStorageModel(odo, projectName, applicationName, component.getWrapped().getName(), Storage.getSizes());
        final IWizard createStorageWizard = new CreateStorageWizard(model);
        if (WizardUtils.openWizardDialog(createStorageWizard, shell) == Window.OK) {
            executeInJob("Create storage", monitor -> execute(model, component));
        }
        return Status.OK_STATUS;
    } catch (IOException e) {
        return OpenShiftUIActivator.statusFactory().errorStatus(e);
    }
}
Also used : CreateStorageWizard(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateStorageWizard) CreateStorageModel(org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateStorageModel) IWizard(org.eclipse.jface.wizard.IWizard) Odo(org.jboss.tools.openshift.core.odo.Odo) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)1 IWizard (org.eclipse.jface.wizard.IWizard)1 Odo (org.jboss.tools.openshift.core.odo.Odo)1 CreateStorageModel (org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateStorageModel)1 CreateStorageWizard (org.jboss.tools.openshift.internal.ui.wizard.applicationexplorer.CreateStorageWizard)1