Skip to content

Commit

Permalink
RW pageBase reference fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
erik committed Apr 8, 2015
1 parent d6c373d commit f943b59
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 14 deletions.
Expand Up @@ -46,8 +46,10 @@
public class WizardStep extends org.apache.wicket.extensions.wizard.WizardStep {

private OperationResult result;
private PageBase pageBase;

public WizardStep() {
public WizardStep(PageBase pageBase) {
this.pageBase = pageBase;
setTitleModel(new StringResourceModel("WizardStep.title", this, null, "WizardStep.title"));
}

Expand All @@ -63,7 +65,7 @@ public String getObject() {
}

public PageBase getPageBase() {
return (PageBase) getPage();
return pageBase;
}

public String getString(String resourceKey, Object... objects) {
Expand Down
Expand Up @@ -34,6 +34,7 @@
import com.evolveum.midpoint.web.component.wizard.WizardStep;
import com.evolveum.midpoint.web.component.wizard.resource.component.capability.*;
import com.evolveum.midpoint.web.component.wizard.resource.dto.CapabilityDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
import com.evolveum.midpoint.web.util.WebModelUtils;
Expand Down Expand Up @@ -103,7 +104,8 @@ public class CapabilityStep extends WizardStep {
private IModel<CapabilityStepDto> model;
private IModel<PrismObject<ResourceType>> resourceModel;

public CapabilityStep(IModel<PrismObject<ResourceType>> prismModel){
public CapabilityStep(IModel<PrismObject<ResourceType>> prismModel, PageBase pageBase){
super(pageBase);
this.resourceModel = prismModel;

model = new LoadableModel<CapabilityStepDto>() {
Expand Down
Expand Up @@ -68,7 +68,8 @@ public class ConfigurationStep extends WizardStep {
private boolean isNewResource;
private IModel<ObjectWrapper> configurationProperties;

public ConfigurationStep(IModel<PrismObject<ResourceType>> resourceModel, boolean isNewResource) {
public ConfigurationStep(IModel<PrismObject<ResourceType>> resourceModel, boolean isNewResource, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;
this.isNewResource = isNewResource;

Expand Down
Expand Up @@ -79,7 +79,8 @@ public class NameStep extends WizardStep {
//filtered, based on selection
private LoadableModel<List<PrismObject<ConnectorType>>> connectorTypes;

public NameStep(IModel<PrismObject<ResourceType>> model) {
public NameStep(IModel<PrismObject<ResourceType>> model, PageBase pageBase) {
super(pageBase);
this.resourceModel = model;

connectorsModel = new LoadableModel<List<PrismObject<ConnectorType>>>(false) {
Expand Down
Expand Up @@ -35,6 +35,7 @@
import com.evolveum.midpoint.web.component.wizard.resource.component.schemahandling.*;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ResourceObjectTypeDefinitionTypeDto;
import com.evolveum.midpoint.web.component.wizard.resource.dto.SchemaHandlingDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
Expand Down Expand Up @@ -120,7 +121,8 @@ public class SchemaHandlingStep extends WizardStep {
private IModel<PrismObject<ResourceType>> resourceModel;
private IModel<SchemaHandlingDto> model;

public SchemaHandlingStep(final IModel<PrismObject<ResourceType>> resourceModel) {
public SchemaHandlingStep(final IModel<PrismObject<ResourceType>> resourceModel, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;

model = new LoadableModel<SchemaHandlingDto>(false) {
Expand Down
Expand Up @@ -58,7 +58,8 @@ public class SchemaStep extends WizardStep {
private static final String ID_RELOAD = "reload";
private IModel<PrismObject<ResourceType>> model;

public SchemaStep(IModel<PrismObject<ResourceType>> model) {
public SchemaStep(IModel<PrismObject<ResourceType>> model, PageBase pageBase) {
super(pageBase);
this.model = model;
setOutputMarkupId(true);

Expand Down
Expand Up @@ -37,6 +37,7 @@
import com.evolveum.midpoint.web.component.wizard.resource.component.synchronization.SynchronizationReactionEditor;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ObjectSynchronizationTypeDto;
import com.evolveum.midpoint.web.component.wizard.resource.dto.ResourceSynchronizationDto;
import com.evolveum.midpoint.web.page.PageBase;
import com.evolveum.midpoint.web.session.UserProfileStorage;
import com.evolveum.midpoint.web.util.InfoTooltipBehavior;
import com.evolveum.midpoint.web.util.WebMiscUtil;
Expand Down Expand Up @@ -118,7 +119,8 @@ public class SynchronizationStep extends WizardStep {
private IModel<PrismObject<ResourceType>> resourceModel;
private IModel<ResourceSynchronizationDto> model;

public SynchronizationStep(IModel<PrismObject<ResourceType>> resourceModel) {
public SynchronizationStep(IModel<PrismObject<ResourceType>> resourceModel, PageBase pageBase) {
super(pageBase);
this.resourceModel = resourceModel;

model = new LoadableModel<ResourceSynchronizationDto>(false) {
Expand Down
Expand Up @@ -145,12 +145,12 @@ protected String load() {

private void initLayout() {
WizardModel wizardModel = new WizardModel();
wizardModel.add(new NameStep(model));
wizardModel.add(new ConfigurationStep(model, isNewResource));
wizardModel.add(new SchemaStep(model));
wizardModel.add(new SchemaHandlingStep(model));
wizardModel.add(new CapabilityStep(model));
wizardModel.add(new SynchronizationStep(model));
wizardModel.add(new NameStep(model, this));
wizardModel.add(new ConfigurationStep(model, isNewResource, this));
wizardModel.add(new SchemaStep(model, this));
wizardModel.add(new SchemaHandlingStep(model, this));
wizardModel.add(new CapabilityStep(model, this));
wizardModel.add(new SynchronizationStep(model, this));

Wizard wizard = new Wizard(ID_WIZARD, new Model(wizardModel));
wizard.setOutputMarkupId(true);
Expand Down

0 comments on commit f943b59

Please sign in to comment.