-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sort choices for lifecycle state panel and use this panel in generate…
…d forms
- Loading branch information
Showing
8 changed files
with
139 additions
and
31 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
55 changes: 55 additions & 0 deletions
55
...src/main/java/com/evolveum/midpoint/gui/impl/component/input/LifecycleStateFormPanel.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,55 @@ | ||
/* | ||
* Copyright (C) 2010-2023 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.gui.impl.component.input; | ||
|
||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismPropertyWrapper; | ||
import com.evolveum.midpoint.gui.api.util.DisplayableChoiceRenderer; | ||
import com.evolveum.midpoint.gui.api.util.LocalizationUtil; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.gui.impl.component.search.SearchValue; | ||
import com.evolveum.midpoint.prism.impl.binding.AbstractMutableContainerable; | ||
import com.evolveum.midpoint.schema.constants.SchemaConstants; | ||
import com.evolveum.midpoint.util.DisplayableValue; | ||
import com.evolveum.midpoint.util.exception.SchemaException; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.web.component.input.DisplayableValueChoiceRenderer; | ||
import com.evolveum.midpoint.web.component.prism.InputPanel; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableRowType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType; | ||
|
||
import org.apache.commons.lang3.StringUtils; | ||
import org.apache.wicket.ajax.AjaxRequestTarget; | ||
import org.apache.wicket.behavior.AttributeAppender; | ||
import org.apache.wicket.markup.head.IHeaderResponse; | ||
import org.apache.wicket.markup.head.OnDomReadyHeaderItem; | ||
import org.apache.wicket.markup.html.form.DropDownChoice; | ||
import org.apache.wicket.markup.html.form.FormComponent; | ||
import org.apache.wicket.markup.html.form.IChoiceRenderer; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.util.string.AppendingStringBuffer; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Comparator; | ||
import java.util.List; | ||
import java.util.Optional; | ||
|
||
public class LifecycleStateFormPanel extends LifecycleStatePanel { | ||
|
||
public LifecycleStateFormPanel(String id, IModel<PrismPropertyWrapper<String>> model) { | ||
super(id, model); | ||
} | ||
|
||
@Override | ||
protected String customCssClassForInputField() { | ||
return "w-100"; | ||
} | ||
} |
File renamed without changes.
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
56 changes: 56 additions & 0 deletions
56
...rc/main/java/com/evolveum/midpoint/gui/impl/factory/panel/LifecycleStatePanelFactory.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,56 @@ | ||
/* | ||
* Copyright (C) 2023 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
package com.evolveum.midpoint.gui.impl.factory.panel; | ||
|
||
import javax.xml.datatype.XMLGregorianCalendar; | ||
|
||
import com.evolveum.midpoint.gui.impl.component.input.LifecycleStateFormPanel; | ||
import com.evolveum.midpoint.gui.impl.component.input.LifecycleStatePanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
|
||
import jakarta.annotation.PostConstruct; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.evolveum.midpoint.gui.api.prism.wrapper.ItemWrapper; | ||
import com.evolveum.midpoint.gui.api.prism.wrapper.PrismValueWrapper; | ||
import com.evolveum.midpoint.gui.api.registry.GuiComponentRegistry; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.schema.constants.SchemaConstants; | ||
import com.evolveum.midpoint.util.DOMUtil; | ||
import com.evolveum.midpoint.web.component.input.DatePanel; | ||
import com.evolveum.midpoint.web.component.prism.InputPanel; | ||
import com.evolveum.midpoint.web.util.DateValidator; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ScheduleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; | ||
|
||
@Component | ||
public class LifecycleStatePanelFactory extends AbstractInputGuiComponentFactory<String> { | ||
|
||
@Autowired private GuiComponentRegistry registry; | ||
|
||
@PostConstruct | ||
public void register() { | ||
registry.addToRegistry(this); | ||
} | ||
|
||
@Override | ||
public <IW extends ItemWrapper<?, ?>, VW extends PrismValueWrapper<?>> boolean match(IW wrapper, VW valueWrapper) { | ||
return ObjectType.F_LIFECYCLE_STATE.equals(wrapper.getItemName()); | ||
} | ||
|
||
@Override | ||
protected InputPanel getPanel(PrismPropertyPanelContext<String> panelCtx) { | ||
return new LifecycleStateFormPanel(panelCtx.getComponentId(), panelCtx.getItemWrapperModel()); | ||
} | ||
|
||
@Override | ||
public Integer getOrder() { | ||
return 1000; | ||
} | ||
} |
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