Package org.apache.click

Examples of org.apache.click.Context


     * representation to
     */
    protected void renderCalendarButton(HtmlStringBuffer buffer) {

        if (!isReadonly() && !isDisabled()) {
            Context context = getContext();
            buffer.append("<img align=\"top\" ");
            buffer.append("style=\"cursor:hand\" src=\"");
            buffer.append(context.getRequest().getContextPath());
            buffer.append("/click/calendar/calendar");
            buffer.append(ClickUtils.getResourceVersionIndicator(context));
            buffer.append(".gif\"");
            String id = getId();
            if (id != null) {
View Full Code Here


     *
     * @return the list of HEAD elements for the Table
     */
    @Override
    public List<Element> getHeadElements() {
        Context context = getContext();
        String versionIndicator = ClickUtils.getResourceVersionIndicator(context);

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

            headElements.add(new CssImport("/click/table.css", versionIndicator));

            headElements.addAll(getControlLink().getHeadElements());
        }

        String tableId = getId();
        CssStyle cssStyle = new CssStyle();
        cssStyle.setId(tableId + "_css_setup");

        if (!headElements.contains(cssStyle)) {
            boolean isDarkStyle = isDarkStyle();

            String contextPath = context.getRequest().getContextPath();
            HtmlStringBuffer buffer = new HtmlStringBuffer(300);
            buffer.append("th.sortable a {\n");
            buffer.append("background: url(");
            buffer.append(contextPath);
            buffer.append("/click/column-sortable-");
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

     * } </pre>
     *
     * @param container the container which Fields and Links to bind
     */
    public static void bind(Container container) {
        Context context = Context.getThreadLocalContext();
        if (canBind(container, context)) {
            bind(container, context);
        }
    }
View Full Code Here

     *
     * @param field the Field to bind and validate
     * @return true if field was bound and valid, or false otherwise
     */
    public static boolean bindAndValidate(Field field) {
        Context context = Context.getThreadLocalContext();
        if (canBind(field, context)) {
            return bindAndValidate(field, context);
        }
        return false;
    }
View Full Code Here

     * @param container the container which Fields and Links to bind and
     * validate
     * @return true if all Fields are valid, false otherwise
     */
    public static boolean bindAndValidate(Container container) {
        Context context = Context.getThreadLocalContext();
        if (canBind(container, context)) {
            return bindAndValidate(container, context);
        }
        return false;
    }
View Full Code Here

        }

        // Check if the Context has been set
        if (Context.hasThreadLocalContext()) {

            Context context = Context.getThreadLocalContext();
            ConfigService configService = ClickUtils.getConfigService(context.getServletContext());

            boolean isProductionModes = configService.isProductionMode()
                || configService.isProfileMode();

            if (isProductionModes && ClickUtils.isEnableResourceVersion(context)) {
View Full Code Here

     *
     * @param control the control which request parameter to check
     * @return true if the control has a submitted request value, false otherwise
     */
    public static boolean hasRequestParameter(Control control) {
        Context context = Context.getThreadLocalContext();
        if (canBind(control, context)) {
            return context.hasRequestParameter(control.getName());
        }
        return false;
    }
View Full Code Here

     * to perform the lookup.
     *
     * @return the application LogService instance
     */
    public static LogService getLogService() {
        Context context = Context.getThreadLocalContext();
        ServletContext servletContext = context.getServletContext();
        ConfigService configService = getConfigService(servletContext);
        LogService logService = configService.getLogService();
        return logService;
    }
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.