Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Evolveum/midpoint
- Loading branch information
Showing
23 changed files
with
498 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
.../java/com/evolveum/midpoint/web/component/wizard/resource/component/WizardHelpDialog.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<!-- | ||
~ Copyright (c) 2010-2013 Evolveum | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
<wicket:panel xmlns:wicket="http://wicket.apache.org"> | ||
<div wicket:id="content" style="padding: 5px"> | ||
|
||
<label wicket:id="helpLabel" style="font-weight: normal"/> | ||
|
||
<div class="main-button-bar" style="padding-bottom: 0px"> | ||
<p align="center"> | ||
<a wicket:id="okButton" class="btn btn-primary btn-sm"> | ||
<span><wicket:message key="WizardHelpDialog.button.ok" /></span> | ||
</a> | ||
</p> | ||
</div> | ||
|
||
</div> | ||
</wicket:panel> |
127 changes: 127 additions & 0 deletions
127
.../java/com/evolveum/midpoint/web/component/wizard/resource/component/WizardHelpDialog.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
/* | ||
* Copyright (c) 2010-2013 Evolveum | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.evolveum.midpoint.web.component.wizard.resource.component; | ||
|
||
import com.evolveum.midpoint.web.component.wizard.resource.*; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.ajax.markup.html.AjaxLink; | ||
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; | ||
import org.apache.wicket.extensions.wizard.IWizardStep; | ||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.model.AbstractReadOnlyModel; | ||
import org.apache.wicket.model.StringResourceModel; | ||
|
||
/** | ||
* @author shood | ||
* */ | ||
public class WizardHelpDialog extends ModalWindow{ | ||
|
||
private static final String ID_HELP = "helpLabel"; | ||
private static final String ID_BUTTON_OK = "okButton"; | ||
|
||
private boolean initialized; | ||
private IWizardStep step; | ||
|
||
public WizardHelpDialog(String id, final IWizardStep step){ | ||
super(id); | ||
|
||
this.step = step; | ||
|
||
setOutputMarkupId(true); | ||
setTitle(createStringResource("WizardHelpDialog.label")); | ||
showUnloadConfirmation(false); | ||
setCssClassName(ModalWindow.CSS_CLASS_GRAY); | ||
setCookieName(WizardHelpDialog.class.getSimpleName() + ((int) (Math.random() * 100))); | ||
setInitialWidth(450); | ||
setInitialHeight(500); | ||
setWidthUnit("px"); | ||
|
||
WebMarkupContainer content = new WebMarkupContainer(getContentId()); | ||
content.setOutputMarkupId(true); | ||
setContent(content); | ||
} | ||
|
||
public StringResourceModel createStringResource(String resourceKey, Object... objects) { | ||
return new StringResourceModel(resourceKey, this, null, resourceKey, objects); | ||
} | ||
|
||
public void updateModal(AjaxRequestTarget target, IWizardStep step){ | ||
this.step = step; | ||
|
||
if(target != null){ | ||
target.add(getContent()); | ||
} | ||
} | ||
|
||
@Override | ||
protected void onBeforeRender(){ | ||
super.onBeforeRender(); | ||
|
||
if(initialized){ | ||
return; | ||
} | ||
|
||
initLayout((WebMarkupContainer) get(getContentId())); | ||
initialized = true; | ||
} | ||
|
||
public void initLayout(WebMarkupContainer content){ | ||
Label helpLabel = new Label(ID_HELP, new AbstractReadOnlyModel<String>() { | ||
|
||
@Override | ||
public String getObject() { | ||
return getString(determineHelpKey()); | ||
} | ||
}); | ||
helpLabel.setEscapeModelStrings(false); | ||
content.add(helpLabel); | ||
|
||
AjaxLink ok = new AjaxLink(ID_BUTTON_OK) { | ||
|
||
@Override | ||
public void onClick(AjaxRequestTarget target) { | ||
closePerformed(target); | ||
} | ||
}; | ||
content.add(ok); | ||
} | ||
|
||
private String determineHelpKey(){ | ||
if(step != null){ | ||
if(step instanceof NameStep){ | ||
return "ResourceWizard.help.nameStep"; | ||
} else if(step instanceof ConfigurationStep){ | ||
return "ResourceWizard.help.configurationStep"; | ||
} else if(step instanceof SchemaStep){ | ||
return "ResourceWizard.help.schemaStep"; | ||
} else if(step instanceof SchemaHandlingStep){ | ||
return "ResourceWizard.help.schemaHandlingStep"; | ||
} else if(step instanceof CapabilityStep){ | ||
return "ResourceWizard.help.capabilityStep"; | ||
} else if(step instanceof SynchronizationStep){ | ||
return "ResourceWizard.help.synchronizationStep"; | ||
} | ||
} | ||
|
||
return null; | ||
} | ||
|
||
private void closePerformed(AjaxRequestTarget target){ | ||
close(target); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...com/evolveum/midpoint/web/component/wizard/resource/component/WizardHelpDialog.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright (c) 2010-2013 Evolveum | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
WizardHelpDialog.label=Get Help With Resource Wizard! | ||
WizardHelpDialog.button.ok=Ok, Got It! |
Oops, something went wrong.