use of org.jboss.tools.openshift.internal.ui.models.applicationexplorer.ApplicationExplorerUIModel in project jbosstools-openshift by jbosstools.
the class RefreshHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
ApplicationExplorerUIModel cluster = UIUtils.getFirstElement(selection, ApplicationExplorerUIModel.class);
if (cluster == null) {
// $NON-NLS-1$
return OpenShiftUIActivator.statusFactory().cancelStatus("No cluster selected");
}
Shell parent = HandlerUtil.getActiveShell(event);
executeInJob("Refresh cluster", monitor -> execute(parent, cluster));
return null;
}
use of org.jboss.tools.openshift.internal.ui.models.applicationexplorer.ApplicationExplorerUIModel in project jbosstools-openshift by jbosstools.
the class NewProjectHandler method execute.
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
ApplicationExplorerUIModel cluster = UIUtils.getFirstElement(selection, ApplicationExplorerUIModel.class);
if (cluster == null) {
// $NON-NLS-1$
return OpenShiftUIActivator.statusFactory().cancelStatus("No cluster selected");
}
Shell shell = HandlerUtil.getActiveShell(event);
openDialog(cluster, shell);
return null;
}
Aggregations