use of org.jboss.tools.openshift.internal.ui.models.IServiceWrapper in project jbosstools-openshift by jbosstools.
the class ScaleDeploymentHandler method getDeploymentConfig.
private IDeploymentConfig getDeploymentConfig(IResourceWrapper<?, ?> wrapper) {
if (wrapper == null) {
return null;
}
IDeploymentConfig dc = null;
IResource wrapped = wrapper.getWrapped();
if (wrapper instanceof IServiceWrapper) {
// service selected
dc = getDeploymentConfig((IServiceWrapper) wrapper);
} else if (wrapped instanceof IPod) {
// pod selected
dc = getDeploymentConfig((IPod) wrapped, wrapper);
} else if (wrapped instanceof IDeploymentConfig) {
// deployment config selected
// has to be tested before IReplicationController, IDeploymentConfig extends IReplicationController
dc = (IDeploymentConfig) wrapped;
} else if (wrapped instanceof IReplicationController) {
// replication controller selected (deployment tab in properties)
// has to be tested after IDeploymentConfig, IDeploymentConfig extends IReplicationController
dc = getDeploymentConfig((IReplicationController) wrapped, wrapper);
}
return dc;
}
Aggregations