Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
704 additions
and
648 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
31 changes: 31 additions & 0 deletions
31
gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/DisplayNamePanel.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,31 @@ | ||
<!-- | ||
~ 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. | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div class="row"> | ||
<div class="container-fluid prism-container"> | ||
<div class="box-header "> | ||
<i wicket:id="typeImage"></i> | ||
<div class="box-title" wicket:id="assignmentName" /> | ||
</div> | ||
<div wicket:id="description" /> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</body> | ||
</html> |
74 changes: 74 additions & 0 deletions
74
gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/component/DisplayNamePanel.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,74 @@ | ||
package com.evolveum.midpoint.gui.api.component; | ||
|
||
import org.apache.wicket.AttributeModifier; | ||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.model.PropertyModel; | ||
|
||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.prism.Containerable; | ||
import com.evolveum.midpoint.prism.PrismProperty; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AbstractRoleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
public class DisplayNamePanel<C extends Containerable> extends BasePanel<C>{ | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
private final static String ID_DESCRIPTION = "description"; | ||
private final static String ID_TYPE_IMAGE = "typeImage"; | ||
private final static String ID_ASSIGNMENT_NAME = "assignmentName"; | ||
|
||
public DisplayNamePanel(String id, IModel<C> model) { | ||
super(id, model); | ||
|
||
initLayout(); | ||
} | ||
|
||
private void initLayout() { | ||
WebMarkupContainer typeImage = new WebMarkupContainer(ID_TYPE_IMAGE); | ||
typeImage.setOutputMarkupId(true); | ||
typeImage.add(AttributeModifier.append("class", createImageModel())); | ||
typeImage.add(AttributeModifier.append("class", getAdditionalNameLabelStyleClass())); | ||
add(typeImage); | ||
|
||
Label name = new Label(ID_ASSIGNMENT_NAME, createHeaderModel()); | ||
name.add(AttributeModifier.append("class", getAdditionalNameLabelStyleClass())); | ||
name.setOutputMarkupId(true); | ||
add(name); | ||
|
||
add(new Label(ID_DESCRIPTION, new PropertyModel<String>(getModel(), ObjectType.F_DESCRIPTION.getLocalPart()))); | ||
|
||
|
||
} | ||
|
||
private String createImageModel() { | ||
if (ObjectType.class.isAssignableFrom(getModelObject().getClass())) { | ||
return WebComponentUtil.createDefaultIcon((ObjectType) getModelObject()); | ||
} | ||
|
||
return WebComponentUtil.createDefaultColoredIcon(getModelObject().asPrismContainerValue().getContainer().getComplexTypeDefinition().getTypeName()); | ||
|
||
} | ||
|
||
private IModel<String> getAdditionalNameLabelStyleClass() { | ||
return Model.of("text-bold"); | ||
} | ||
|
||
private IModel<String> createHeaderModel() { | ||
if (ObjectType.class.isAssignableFrom(getModelObject().getClass())) { | ||
return Model.of(WebComponentUtil.getEffectiveName((ObjectType) getModelObject(), AbstractRoleType.F_DISPLAY_NAME)); | ||
} | ||
PrismProperty<String> name = getModelObject().asPrismContainerValue().getContainer().findProperty(ObjectType.F_NAME); | ||
if (name == null || name.isEmpty()) { | ||
return Model.of(""); | ||
} | ||
return Model.of(name.getRealValue()); | ||
} | ||
|
||
|
||
|
||
|
||
} |
61 changes: 0 additions & 61 deletions
61
...rc/main/java/com/evolveum/midpoint/gui/api/component/RelationSelectorAssignablePanel.html
This file was deleted.
Oops, something went wrong.
81 changes: 0 additions & 81 deletions
81
...rc/main/java/com/evolveum/midpoint/gui/api/component/RelationSelectorAssignablePanel.java
This file was deleted.
Oops, something went wrong.
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.