Package org.openfaces.component.window

Examples of org.openfaces.component.window.Confirmation


     * This method is only for internal usage from within the OpenFaces library. It shouldn't be used explicitly
     * by any application code.
     */
    public Confirmation getDeletionConfirmation() {
        FacesContext context = FacesContext.getCurrentInstance();
        Confirmation confirmation = getDeleteEventConfirmation();
        if (confirmation == null) {
            Timetable timetable = getTimetable();
            if (timetable != null)
                confirmation = timetable.getDeleteEventConfirmation();
        }
        if (confirmation == null) {
            confirmation = Components.createComponent(context,
                    Confirmation.COMPONENT_TYPE, Confirmation.class, this, "deleteEventConfirmation");
            confirmation.setMessage("Delete the event?");
            confirmation.setDetails("Click OK to delete the event");
            confirmation.setDraggable(true);
            setDeleteEventConfirmation(confirmation);
        }
        return confirmation;
    }
View Full Code Here


    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
        if (isAjaxSessionExpirationProcessing(context)) {
            DefaultSessionExpiration defaultSessionExpiration = (DefaultSessionExpiration) component;

            Confirmation confirmation = defaultSessionExpiration.getConfirmation();
            if (confirmation == null) {
                confirmation = new Confirmation();
                defaultSessionExpiration.setConfirmation(confirmation);
                confirmation.setId("openfaces_internal_sessionexpiration_confirmation");
                confirmation.setStandalone(true);
                confirmation.setCaption("Session Expired");
                confirmation.setDraggable(false);
                confirmation.setMessage("Your session has expired");
                confirmation.setDetails("A new session will be created when the page is reloaded");
                confirmation.setOkButtonText("Reload page now");
                confirmation.setCancelButtonText("Reload later");
                confirmation.setModal(true);
                confirmation.setWidth("400px");
                confirmation.setHeight("160px");
                confirmation.setModalLayerStyle("background: black; filter: alpha(opacity=50); opacity: .50;");
            }
            confirmation.encodeAll(context);
            String clientId = confirmation.getClientId(context);
            String confirmationId = (clientId != null)
                    ? clientId
                    : confirmation.getId();

            String location = getRedirectLocationOnSessionExpired(context);
            String onExpiredEventFunction = "O$._pageReloadConfirmation('" + confirmationId + "', '" + location + "');" +
                    "O$._fireSessionExpiredEvent();";
            processEvent(context, component.getParent(), "onsessionexpired", onExpiredEventFunction);
View Full Code Here

                eventActions,
                actionRolloverBackgroundIntensity,
                actionPressedBackgroundIntensity));
        Styles.renderStyleClasses(context, actionBar);

        Confirmation confirmation = timeTable.getDeletionConfirmation();

        if (confirmation != null && confirmation.isRendered())
            confirmation.encodeAll(context);
    }
View Full Code Here

                        DeleteEventAction.COMPONENT_TYPE, DeleteEventAction.class, actionBar, "deleteEventAction");
                result.add(deleteEventAction);
                actionBar.getChildren().add(deleteEventAction);
            }
            deleteEventAction.setOnclick("O$.Timetable._deleteCurrentTimetableEvent(event)");
            Confirmation confirmation = timeTable.getDeletionConfirmation();

            if (confirmation != null) {
                if (deleteEventAction.isRendered() && deleteEventAction.getShowConfirmation()) {
                    confirmation.setRendered(true);
                    if (deleteEventAction.getId() == null)
                        deleteEventAction.setId(context.getViewRoot().createUniqueId());
                    confirmation.setFor(deleteEventAction.getId());
                    confirmation.setEvent("click");
                } else
                    confirmation.setRendered(false);
            }
        }

        return result;
    }
View Full Code Here

        writer.writeAttribute("width", "100%", null);
        writer.writeAttribute("style", "height: 100%;", null);

        writer.startElement("tr", abstractWindow);

        Confirmation confirmation = (Confirmation) abstractWindow;
        encodeIcon(confirmation, context);

        boolean hasMessage = encodeMessage(confirmation, writer, clientId);

        encodeMessageDetails(confirmation, hasMessage, writer, clientId);
View Full Code Here

    @Override
    protected void encodeScriptsAndStyles(FacesContext context, PopupLayer component) throws IOException {
        super.encodeScriptsAndStyles(context, component);

        Confirmation confirmation = (Confirmation) component;

        String invokerId;
        String aFor = confirmation.getFor();
        if (aFor != null)
            invokerId = Components.referenceIdToClientId(context, confirmation, aFor);
        else if (!confirmation.isStandalone())
            invokerId = confirmation.getParent().getClientId(context);
        else
            invokerId = null;

        String iconAreaStyle = Styles.getCSSClass(context, component, confirmation.getIconAreaStyle(),
                DEFAULT_ICON_BACKPLANE_CLASS, confirmation.getIconAreaClass());
        String rolloverIconAreaStyle = Styles.getCSSClass(context, component, confirmation.getRolloverIconAreaStyle(),
                StyleGroup.rolloverStyleGroup(), confirmation.getRolloverIconAreaClass());
        rolloverIconAreaStyle = Styles.mergeClassNames(iconAreaStyle, rolloverIconAreaStyle);

        String textAreaStyle = Styles.getCSSClass(context, component, confirmation.getContentStyle(), DEFAULT_TEXT_BACKPLANE_CLASS, confirmation.getContentClass());
        String rolloverTextAreaStyle = Styles.getCSSClass(context, component, confirmation.getRolloverContentStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverContentClass());
        rolloverTextAreaStyle = Styles.mergeClassNames(textAreaStyle, rolloverTextAreaStyle);

        String headerTextStyle = Styles.getCSSClass(context, component, confirmation.getMessageStyle(), DEFAULT_HEADER_TEXT_CLASS, confirmation.getMessageClass());
        String rolloverHeaderTextStyle = Styles.getCSSClass(context, component, confirmation.getRolloverMessageStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverMessageClass());
        rolloverHeaderTextStyle = Styles.mergeClassNames(headerTextStyle, rolloverHeaderTextStyle);

        String messageHeaderText = confirmation.getMessage();
        boolean hasMessage = messageHeaderText != null && messageHeaderText.length() > 0;
        String defaultDetailsTextClass = hasMessage ? DEFAULT_DETAILS_TEXT_MESSAGE_CLASS : DEFAULT_DETAILS_TEXT_CLASS;
        String detailsTextStyle = Styles.getCSSClass(context, component, confirmation.getDetailsStyle(), defaultDetailsTextClass, confirmation.getDetailsClass());
        String rolloverDetailsTextStyle = Styles.getCSSClass(context, component, confirmation.getRolloverDetailsStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverDetailsClass());
        rolloverDetailsTextStyle = Styles.mergeClassNames(detailsTextStyle, rolloverDetailsTextStyle);

        String buttonAreaStyle = Styles.getCSSClass(context, component, confirmation.getButtonAreaStyle(), DEFAULT_BUTTON_BACKPLANE_CLASS, confirmation.getButtonAreaClass());
        String rolloverButtonAreaStyle = Styles.getCSSClass(context, component, confirmation.getRolloverButtonAreaStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverButtonAreaClass());
        rolloverButtonAreaStyle = Styles.mergeClassNames(buttonAreaStyle, rolloverButtonAreaStyle);

        String okButtonStyle = Styles.getCSSClass(context, component, confirmation.getOkButtonStyle(), DEFAULT_YES_BUTTON_CLASS, confirmation.getOkButtonClass());
        String rolloverOkButtonStyle = Styles.getCSSClass(context, component, confirmation.getRolloverOkButtonStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverOkButtonClass(), DEFAULT_ROLLOVER_BUTTON_CLASS);
        rolloverOkButtonStyle = Styles.mergeClassNames(okButtonStyle, rolloverOkButtonStyle);

        String cancelButtonStyle = Styles.getCSSClass(context, component, confirmation.getCancelButtonStyle(), DEFAULT_NO_BUTTON_CLASS, confirmation.getCancelButtonClass());
        String rolloverCancelButtonStyle = Styles.getCSSClass(context, component, confirmation.getRolloverCancelButtonStyle(), StyleGroup.rolloverStyleGroup(), confirmation.getRolloverCancelButtonClass(), DEFAULT_ROLLOVER_BUTTON_CLASS);
        rolloverCancelButtonStyle = Styles.mergeClassNames(cancelButtonStyle, rolloverCancelButtonStyle);

        ScriptBuilder sb = new ScriptBuilder();
        String event = Rendering.getEventWithOnPrefix(context, confirmation, "o:confirmation");

        sb.initScript(context, confirmation, "O$.Confirmation._init",
                invokerId,
                event,
                confirmation.getDefaultButton(),
                confirmation.getAlignToInvoker(),
                new Object[]{
                        iconAreaStyle,
                        rolloverIconAreaStyle,
                        textAreaStyle,
                        rolloverTextAreaStyle,
View Full Code Here

TOP

Related Classes of org.openfaces.component.window.Confirmation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.