Search in sources :

Example 1 with DeleteConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel in project midpoint by Evolveum.

the class DefinitionStagesPanel method deletePerformed.

private void deletePerformed(AjaxRequestTarget target) {
    ConfirmationPanel dialog = new DeleteConfirmationPanel(getPageBase().getMainPopupBodyId(), new IModel<String>() {

        @Override
        public String getObject() {
            StageDefinitionDto dto = getModelObject().get(tabPanel.getSelectedTab());
            return getString("DefinitionStagesPanel.confirmDeleteText", dto.getName());
        }
    }) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteConfirmedPerformed(target);
        }
    };
    getPageBase().showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) StageDefinitionDto(com.evolveum.midpoint.web.page.admin.certification.dto.StageDefinitionDto) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel)

Example 2 with DeleteConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel in project midpoint by Evolveum.

the class PageResources method deleteResourcePerformed.

private void deleteResourcePerformed(AjaxRequestTarget target, ResourceType single) {
    List<ResourceType> selected = isAnyResourceSelected(target, single);
    if (selected.size() < 1) {
        warn(createStringResource("pageResources.message.noResourceSelected").getString());
        target.add(getFeedbackPanel());
        return;
    }
    singleDelete = single;
    if (selected.isEmpty()) {
        return;
    }
    ConfirmationPanel dialog = new DeleteConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString("pageResources.message.deleteResourceConfirm", "pageResources.message.deleteResourcesConfirm")) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteResourceConfirmedPerformed(target);
        }
    };
    ((PageBase) getPage()).showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 3 with DeleteConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel in project midpoint by Evolveum.

the class PageConnectorHosts method deleteHostPerformed.

private void deleteHostPerformed(AjaxRequestTarget target) {
    List<ConnectorHostType> selected = getObjectListPanel().getSelectedRealObjects();
    if (selected.isEmpty()) {
        warn(getString("pageResources.message.noHostSelected"));
        target.add(getFeedbackPanel());
        return;
    }
    ConfirmationPanel dialog = new DeleteConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString("pageResources.message.deleteHostConfirm", "pageResources.message.deleteHostsConfirm", false)) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteHostConfirmedPerformed(target);
        }
    };
    ((PageBase) getPage()).showMainPopup(dialog, target);
}
Also used : ConnectorHostType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 4 with DeleteConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel in project midpoint by Evolveum.

the class ResourceContentPanel method deleteResourceObjectPerformed.

// TODO: as a task?
protected void deleteResourceObjectPerformed(ShadowType selected, AjaxRequestTarget target) {
    final List<ShadowType> selectedShadow = getSelectedShadowsList(selected);
    final OperationResult result = new OperationResult(OPERATION_DELETE_OBJECT);
    if (selectedShadow == null || selectedShadow.isEmpty()) {
        result.recordWarning(createStringResource("ResourceContentPanel.message.deleteResourceObjectPerformed.warning").getString());
        getPageBase().showResult(result);
        target.add(getPageBase().getFeedbackPanel());
        return;
    }
    ConfirmationPanel dialog = new DeleteConfirmationPanel(((PageBase) getPage()).getMainPopupBodyId(), createDeleteConfirmString(selected, "pageContentAccounts.message.deleteConfirmationSingle", "pageContentAccounts.message.deleteConfirmation")) {

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteAccountConfirmedPerformed(target, result, selectedShadow);
        }
    };
    ((PageBase) getPage()).showMainPopup(dialog, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) PageBase(com.evolveum.midpoint.gui.api.page.PageBase)

Example 5 with DeleteConfirmationPanel

use of com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel in project midpoint by Evolveum.

the class OperationalButtonsPanel method deletePerformed.

private void deletePerformed(AjaxRequestTarget target) {
    ConfirmationPanel confirmationPanel = new DeleteConfirmationPanel(getPageBase().getMainPopupBodyId(), createStringResource("OperationalButtonsPanel.deletePerformed", WebComponentUtil.getDisplayNameOrName(getPrismObject()))) {

        private static final long serialVersionUID = 1L;

        @Override
        public void yesPerformed(AjaxRequestTarget target) {
            deleteConfirmPerformed(target);
        }
    };
    getPageBase().showMainPopup(confirmationPanel, target);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel) ConfirmationPanel(com.evolveum.midpoint.web.component.dialog.ConfirmationPanel) DeleteConfirmationPanel(com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel)

Aggregations

ConfirmationPanel (com.evolveum.midpoint.web.component.dialog.ConfirmationPanel)6 DeleteConfirmationPanel (com.evolveum.midpoint.web.component.dialog.DeleteConfirmationPanel)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)6 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)3 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)1 StageDefinitionDto (com.evolveum.midpoint.web.page.admin.certification.dto.StageDefinitionDto)1 ConnectorHostType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1