Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into feature/new-approva…
…l-gui
- Loading branch information
Showing
86 changed files
with
3,673 additions
and
1,223 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
29 changes: 29 additions & 0 deletions
29
...admin-gui/src/main/java/com/evolveum/midpoint/web/component/dialog/ConfirmationPanel.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,29 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
~ Copyright (c) 2010-2016 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="panel"> | ||
<p align="center"> | ||
<span wicket:id="confirmText" /> | ||
</p> | ||
|
||
<p align="center"> | ||
<a class="btn btn-primary btn-sm" wicket:id="yes" /> | ||
<a class="btn btn-default btn-sm" wicket:id="no" /> | ||
</p> | ||
</div> | ||
</wicket:panel> |
123 changes: 123 additions & 0 deletions
123
...admin-gui/src/main/java/com/evolveum/midpoint/web/component/dialog/ConfirmationPanel.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,123 @@ | ||
/* | ||
* Copyright (c) 2010-2016 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.dialog; | ||
|
||
import com.evolveum.midpoint.web.component.AjaxButton; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow; | ||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.markup.html.panel.Panel; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.model.StringResourceModel; | ||
|
||
/** | ||
* Created by Honchar. | ||
* | ||
* class is created based on the ConfirmationDialog. | ||
* ConfirmationPanel panel is to be added | ||
* to main popup (from PageBase class) as a content | ||
* | ||
*/ | ||
public class ConfirmationPanel extends Panel{ | ||
private static final String ID_PANEL = "panel"; | ||
private static final String ID_CONFIRM_TEXT = "confirmText"; | ||
private static final String ID_YES = "yes"; | ||
private static final String ID_NO = "no"; | ||
|
||
private int confirmType; | ||
|
||
public ConfirmationPanel(String id) { | ||
this(id, null); | ||
} | ||
|
||
public ConfirmationPanel(String id, IModel<String> message) { | ||
super(id); | ||
|
||
if (message == null) { | ||
message = new Model(); | ||
} | ||
initLayout(message); | ||
} | ||
|
||
public boolean getLabelEscapeModelStrings(){ | ||
return true; | ||
} | ||
|
||
public void setMessage(IModel<String> message) { | ||
Label label = (Label) get(ID_PANEL).get(ID_CONFIRM_TEXT); | ||
label.setDefaultModel(message); | ||
} | ||
|
||
private void initLayout(IModel<String> message) { | ||
WebMarkupContainer panel = new WebMarkupContainer(ID_PANEL); | ||
|
||
Label label = new Label(ID_CONFIRM_TEXT, message); | ||
label.setEscapeModelStrings(getLabelEscapeModelStrings()); | ||
panel.add(label); | ||
|
||
AjaxButton yesButton = new AjaxButton(ID_YES, new StringResourceModel("confirmationDialog.yes", | ||
this, null)) { | ||
|
||
@Override | ||
public void onClick(AjaxRequestTarget target) { | ||
yesPerformed(target); | ||
} | ||
}; | ||
panel.add(yesButton); | ||
|
||
AjaxButton noButton = new AjaxButton(ID_NO, new StringResourceModel("confirmationDialog.no", | ||
this, null)) { | ||
|
||
@Override | ||
public void onClick(AjaxRequestTarget target) { | ||
noPerformed(target); | ||
} | ||
}; | ||
panel.add(noButton); | ||
add(panel); | ||
} | ||
|
||
public void yesPerformed(AjaxRequestTarget target) { | ||
|
||
} | ||
|
||
public void noPerformed(AjaxRequestTarget target) { | ||
ModalWindow modalWindow = findParent(ModalWindow.class); | ||
if (modalWindow != null) { | ||
modalWindow.close(target); | ||
} | ||
} | ||
|
||
/** | ||
* @return confirmation type identifier | ||
*/ | ||
public int getConfirmType() { | ||
return confirmType; | ||
} | ||
|
||
/** | ||
* This method provides solution for reusing one confirmation dialog for more messages/actions | ||
* by using confirmType identifier. See for example {@link com.evolveum.midpoint.web.page.admin.users.component.TreeTablePanel} | ||
* | ||
* @param confirmType | ||
*/ | ||
public void setConfirmType(int confirmType) { | ||
this.confirmType = confirmType; | ||
} | ||
} |
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
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
Oops, something went wrong.