Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
members tab - unified panel for role, org, service members
- Loading branch information
Showing
12 changed files
with
642 additions
and
551 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
33 changes: 33 additions & 0 deletions
33
...ava/com/evolveum/midpoint/web/component/dialog/ChooseFocusTypeAndRelationDialogPanel.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,33 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
~ Copyright (c) 2010-2017 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> | ||
|
||
<div class="form-group"> | ||
<div class="col-md-12" wicket:id="type"/> | ||
</div> | ||
<div class="form-group col-md-12"> | ||
<label class="col-md-4"><wicket:message key="chooseFocusTypeAndRelationDialogPanel.relation"/></label> | ||
<div class="col-md-8" wicket:id="relation" /> | ||
</div> | ||
|
||
<p align="center"> | ||
<a class="btn btn-primary btn-sm" wicket:id="ok" /> | ||
</p> | ||
</div> | ||
</wicket:panel> |
128 changes: 128 additions & 0 deletions
128
...ava/com/evolveum/midpoint/web/component/dialog/ChooseFocusTypeAndRelationDialogPanel.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,128 @@ | ||
package com.evolveum.midpoint.web.component.dialog; | ||
|
||
import java.util.Collection; | ||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import javax.xml.namespace.QName; | ||
|
||
import com.evolveum.midpoint.web.component.input.ListMultipleChoicePanel; | ||
import com.evolveum.midpoint.web.component.input.QNameObjectTypeChoiceRenderer; | ||
import org.apache.wicket.Component; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.markup.html.form.DropDownChoice; | ||
import org.apache.wicket.markup.repeater.RepeatingView; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.model.StringResourceModel; | ||
import org.apache.wicket.model.util.ListModel; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.web.component.AjaxButton; | ||
import com.evolveum.midpoint.web.component.form.CheckFormGroup; | ||
import com.evolveum.midpoint.web.component.form.DropDownFormGroup; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
|
||
public class ChooseFocusTypeAndRelationDialogPanel extends BasePanel implements Popupable{ | ||
|
||
private static final String ID_OBJECT_TYPE = "type"; | ||
private static final String ID_RELATION = "relation"; | ||
private static final String ID_BUTTON_OK = "ok"; | ||
|
||
public ChooseFocusTypeAndRelationDialogPanel(String id) { | ||
super(id); | ||
|
||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
} | ||
|
||
private void initLayout(){ | ||
|
||
DropDownFormGroup<QName> type = new DropDownFormGroup<QName>(ID_OBJECT_TYPE, Model.of(UserType.COMPLEX_TYPE), new ListModel<>(WebComponentUtil.createFocusTypeList()), | ||
new QNameObjectTypeChoiceRenderer(), createStringResource("chooseFocusTypeAndRelationDialogPanel.type"), | ||
"chooseFocusTypeAndRelationDialogPanel.tooltip.type", true, "col-md-4", "col-md-8", false); | ||
type.getInput().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); | ||
type.setOutputMarkupId(true); | ||
add(type); | ||
|
||
IModel<Map<String, String>> options = new Model(null); | ||
Map<String, String> optionsMap = new HashMap<>(); | ||
// optionsMap.put("nonSelectedText", createStringResource("LoggingConfigPanel.appenders.Inherit").getString()); | ||
options.setObject(optionsMap); | ||
ListMultipleChoicePanel<QName> relation = new ListMultipleChoicePanel<QName>(ID_RELATION, new ListModel<>(), | ||
new ListModel<QName>(getSupportedRelations()), new QNameObjectTypeChoiceRenderer(), options); | ||
relation.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior()); | ||
relation.setOutputMarkupId(true); | ||
add(relation); | ||
|
||
AjaxButton confirmButton = new AjaxButton(ID_BUTTON_OK, createStringResource("Button.ok")) { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@Override | ||
public void onClick(AjaxRequestTarget target) { | ||
DropDownFormGroup<QName> type = (DropDownFormGroup<QName>) getParent().get(ID_OBJECT_TYPE); | ||
QName typeChosen = type.getModelObject(); | ||
|
||
ListMultipleChoicePanel<QName> relation = (ListMultipleChoicePanel<QName>) getParent().get(ID_RELATION); | ||
Collection<QName> relationChosen = relation.getModelObject(); | ||
ChooseFocusTypeAndRelationDialogPanel.this.okPerformed(typeChosen, relationChosen, target); | ||
getPageBase().hideMainPopup(target); | ||
|
||
} | ||
}; | ||
|
||
add(confirmButton); | ||
|
||
|
||
|
||
} | ||
|
||
protected void okPerformed(QName type, Collection<QName> relation, AjaxRequestTarget target) { | ||
// TODO Auto-generated method stub | ||
|
||
} | ||
|
||
protected List<QName> getSupportedRelations() { | ||
return WebComponentUtil.getAllRelations(getPageBase()); | ||
} | ||
|
||
@Override | ||
public int getWidth() { | ||
return 400; | ||
} | ||
|
||
@Override | ||
public int getHeight() { | ||
return 300; | ||
} | ||
|
||
@Override | ||
public String getWidthUnit(){ | ||
return "px"; | ||
} | ||
|
||
@Override | ||
public String getHeightUnit(){ | ||
return "px"; | ||
} | ||
|
||
@Override | ||
public StringResourceModel getTitle() { | ||
return new StringResourceModel("ChooseFocusTypeDialogPanel.chooseType"); | ||
} | ||
|
||
@Override | ||
public Component getComponent() { | ||
return this; | ||
} | ||
|
||
|
||
} |
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.