Package org.apache.click

Examples of org.apache.click.Context


    @Override
    public List<Element> getHeadElements() {
        if (headElements == null) {
            headElements = super.getHeadElements();

            Context context = getContext();
            String versionIndicator = ClickUtils.getResourceVersionIndicator(context);

            headElements.add(new JsImport("/click/extras-control.js", versionIndicator));
        }
        return headElements;
View Full Code Here


            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
            // $context, $path, $selector and $target
            Map<String, Object> model = ClickUtils.createTemplateModel(this, context);

            // Set path to the AjaxCustomer Page path
            model.put("path", context.getPagePath(AjaxCustomer.class));

            // Add a CSS selector, in this case the customerSelect ID attribute
            model.put("selector", customerSelect.getId());

            // Add the ID of a target element in the Page template to replace
View Full Code Here

     * @return the HTML head import statements for the control
     */
    @Override
    public List<Element> getHeadElements() {
        if (headElements == null) {
            Context context = getContext();
            String versionIndicator = ClickUtils.getResourceVersionIndicator(context);

            headElements = super.getHeadElements();

            headElements.add(new CssImport("/click/checklist/checklist.css",
View Full Code Here

     * sort order if the checkList is sortable.
     */
    @Override
    public void bindRequestValue() {

        Context context = getContext();

        // Page developer has not initialized options, which are required
        // to support sorting
        if (getOptionList().isEmpty()) {
            return;
        }

        // Load the selected items.
        this.selectedValues = new ArrayList<String>();

        String[] values = context.getRequestParameterValues(getName());

        if (values != null) {
            for (String value1 : values) {
                this.selectedValues.add(value1);
            }
        }

        if (isSortable()) {
            String[] order = context.getRequest().getParameterValues(
                    getName() + "_order");
            if (order != null) {
                this.sortorder = new ArrayList<String>(order.length);
                for (String value : order) {
                    if (value != null) {
View Full Code Here

    @Override
    public List<Element> getHeadElements() {
        if (headElements == null) {
            headElements = super.getHeadElements();

            Context context = getContext();
            String versionIndicator = ClickUtils.getResourceVersionIndicator(context);

            headElements.add(new JsImport("/click/extras-control.js", versionIndicator));
        }
        return headElements;
View Full Code Here

            // Include the prototype.js library which is made available under
            // the web folder "/click/prototype/"
            headElements.add(new JsImport("/click/prototype/prototype.js"));

            Context context = getContext();

            // Create a model to pass to the Page JavaScript template. The
            // template recognizes the following Velocity variables:
            // $context, $path, $selector and $target
            Map<String, Object> model = ClickUtils.createTemplateModel(this, context);

            // Set path to the AjaxCustomer Page path
            model.put("path", context.getPagePath(AjaxCustomer.class));

            // Add a CSS selector, in this case the customerSelect ID attribute
            model.put("selector", customerSelect.getId());

            // Add the ID of a target element in the Page template to replace
View Full Code Here

        }

        if (headElements == null) {
            headElements = super.getHeadElements();

            Context context = getContext();
            String versionIndicator = ClickUtils.getResourceVersionIndicator(context);

            CssImport cssImport = new CssImport("/click/menu.css", versionIndicator);
            headElements.add(cssImport);
View Full Code Here

    protected static Menu loadRootMenu(AccessController accessController) {
        if (accessController == null) {
            throw new IllegalArgumentException("Null accessController parameter");
        }

        Context context = Context.getThreadLocalContext();

        Menu menu = new Menu("rootMenu");
        menu.setAccessController(accessController);

        ServletContext servletContext = context.getServletContext();
        InputStream inputStream =
            servletContext.getResourceAsStream(DEFAULT_CONFIG_FILE);

        if (inputStream == null) {
            inputStream = ClickUtils.getResourceAsStream("/menu.xml", Menu.class);
View Full Code Here

     * } </pre>
     *
     * @param field the Field to bind
     */
    public static void bind(Field field) {
        Context context = Context.getThreadLocalContext();
        if (canBind(field, context)) {
            bindField(field, context);
        }
    }
View Full Code Here

     * to check if the Link value can be bound.
     *
     * @param link the AbstractLink to bind
     */
    public static void bind(AbstractLink link) {
        Context context = Context.getThreadLocalContext();
        if (canBind(link, context)) {
            link.bindRequestValue();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.click.Context

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.