Search in sources :

Example 1 with ScenePanel

use of com.evolveum.midpoint.web.component.prism.show.ScenePanel in project midpoint by Evolveum.

the class ObjectDeltaOperationPanel method initLayout.

private void initLayout() {
    // ObjectDeltaType od = getModel().getObjectDelta();
    WebMarkupContainer objectDeltaOperationMarkup = new WebMarkupContainer(ID_OBJECT_DELTA_OPERATION_MARKUP);
    objectDeltaOperationMarkup.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(AttributeModifier.append("class", new AbstractReadOnlyModel<String>() {

        @Override
        public String getObject() {
            return getBoxCssClass();
        }
    }));
    add(objectDeltaOperationMarkup);
    Label executionResult = new Label(ID_PARAMETERS_EXECUTION_RESULT, new PropertyModel(getModel(), "executionResult.status"));
    executionResult.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(executionResult);
    Label resourceName = new Label(ID_PARAMETERS_RESOURCE_NAME, new PropertyModel(getModel(), ObjectDeltaOperationType.F_RESOURCE_NAME.getLocalPart()));
    resourceName.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(resourceName);
    Label objectName = new Label(ID_PARAMETERS_OBJECT_NAME, new PropertyModel(getModel(), ObjectDeltaOperationType.F_OBJECT_NAME.getLocalPart()));
    objectName.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(objectName);
    final SceneDto sceneDto;
    try {
        sceneDto = loadSceneForDelta();
    } catch (SchemaException | ExpressionEvaluationException e) {
        OperationResult result = new OperationResult(ObjectDeltaOperationPanel.class.getName() + ".loadSceneForDelta");
        result.recordFatalError("Couldn't fetch or visualize the delta: " + e.getMessage(), e);
        parentPage.showResult(result);
        throw parentPage.redirectBackViaRestartResponseException();
    }
    IModel<SceneDto> deltaModel = new AbstractReadOnlyModel<SceneDto>() {

        private static final long serialVersionUID = 1L;

        public SceneDto getObject() {
            return sceneDto;
        }
    };
    ScenePanel deltaPanel = new ScenePanel(ID_DELTA_PANEL, deltaModel) {

        @Override
        public void headerOnClickPerformed(AjaxRequestTarget target, IModel<SceneDto> model) {
            super.headerOnClickPerformed(target, model);
            //				model.getObject().setMinimized(!model.getObject().isMinimized());
            target.add(ObjectDeltaOperationPanel.this);
        }
    };
    deltaPanel.setOutputMarkupId(true);
    objectDeltaOperationMarkup.add(deltaPanel);
}
Also used : AbstractReadOnlyModel(org.apache.wicket.model.AbstractReadOnlyModel) SchemaException(com.evolveum.midpoint.util.exception.SchemaException) ScenePanel(com.evolveum.midpoint.web.component.prism.show.ScenePanel) ExpressionEvaluationException(com.evolveum.midpoint.util.exception.ExpressionEvaluationException) IModel(org.apache.wicket.model.IModel) Label(org.apache.wicket.markup.html.basic.Label) PropertyModel(org.apache.wicket.model.PropertyModel) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto)

Example 2 with ScenePanel

use of com.evolveum.midpoint.web.component.prism.show.ScenePanel in project midpoint by Evolveum.

the class ModelOperationStatusPanel method initLayout.

protected void initLayout() {
    add(new Label(ID_STATE, new StringResourceModel("ModelOperationStatusPanel.state.${}", new PropertyModel<ModelState>(getModel(), ModelOperationStatusDto.F_STATE))));
    //        add(new Label(ID_FOCUS_TYPE, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_TYPE)));
    //        add(new Label(ID_FOCUS_NAME, new PropertyModel<String>(getModel(), ModelOperationStatusDto.F_FOCUS_NAME)));
    ScenePanel deltaPanel = new ScenePanel(ID_PRIMARY_DELTA, new PropertyModel<SceneDto>(getModel(), ModelOperationStatusDto.F_PRIMARY_DELTA));
    deltaPanel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject() != null && getModelObject().getPrimaryDelta() != null;
        }
    });
    add(deltaPanel);
}
Also used : ScenePanel(com.evolveum.midpoint.web.component.prism.show.ScenePanel) SceneDto(com.evolveum.midpoint.web.component.prism.show.SceneDto) Label(org.apache.wicket.markup.html.basic.Label) ModelState(com.evolveum.midpoint.model.api.context.ModelState) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Example 3 with ScenePanel

use of com.evolveum.midpoint.web.component.prism.show.ScenePanel in project midpoint by Evolveum.

the class TaskChangesPanel method initLayout.

protected void initLayout() {
    //        add(new Label(ID_TITLE, new AbstractReadOnlyModel<String>() {
    //			@Override
    //			public String getObject() {
    //				return getString(getModelObject().getTitleKey());
    //			}
    //		}));
    ScenePanel deltaPanel = new ScenePanel(ID_PRIMARY_DELTA, new PropertyModel<>(getModel(), TaskChangesDto.F_PRIMARY_DELTAS));
    deltaPanel.add(new VisibleEnableBehaviour() {

        @Override
        public boolean isVisible() {
            return getModelObject() != null && getModelObject().getPrimaryDeltas() != null;
        }
    });
    add(deltaPanel);
}
Also used : ScenePanel(com.evolveum.midpoint.web.component.prism.show.ScenePanel) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Aggregations

ScenePanel (com.evolveum.midpoint.web.component.prism.show.ScenePanel)3 SceneDto (com.evolveum.midpoint.web.component.prism.show.SceneDto)2 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)2 Label (org.apache.wicket.markup.html.basic.Label)2 ModelState (com.evolveum.midpoint.model.api.context.ModelState)1 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 ExpressionEvaluationException (com.evolveum.midpoint.util.exception.ExpressionEvaluationException)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)1 IModel (org.apache.wicket.model.IModel)1 PropertyModel (org.apache.wicket.model.PropertyModel)1 StringResourceModel (org.apache.wicket.model.StringResourceModel)1