Examples of Pageable


Examples of com.googlecode.richrest.server.action.Pageable

  public void serialize(Serializable result, HttpServletResponse response)
      throws IOException {
    String page;
    Action<Serializable, Serializable> action = ActionContext.getContext().getAction();
    if (action instanceof Pageable) {
      Pageable pageAction = (Pageable)action;
      page = pageAction.getPage();
    } else {
      page = getPage(action);
    }
    // 页面扩展名
    String pageExtension = getPageExtension();
View Full Code Here

Examples of java.awt.print.Pageable

            getPageable() instanceof OpenBook) {

            /* We could almost(!) use PrinterJob.getPageFormat() except
             * here we need to start with the PageFormat from the OpenBook :
             */
            Pageable pageable = getPageable();
            Printable printable = pageable.getPrintable(0);
            PageFormat pf = (PageFormat)pageable.getPageFormat(0).clone();
            Paper paper = pf.getPaper();

            /* If there's a media but no media printable area, we can try
             * to retrieve the default value for mpa and use that.
             */
 
View Full Code Here

Examples of java.awt.print.Pageable

            if (s != null) {
                return s.getMax();
            }
        }

        Pageable pageable = getPageable();
        if (pageable != null) {
            int numPages = pageable.getNumberOfPages();
            if (numPages <= Pageable.UNKNOWN_NUMBER_OF_PAGES) {
                numPages = MAX_UNKNOWN_PAGES;
            }
            return  ((numPages == 0) ? 1 : numPages);
        }
View Full Code Here

Examples of java.awt.print.Pageable

                }
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)){
                Printable printable = (Printable)data;
                print(printable, null);
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE)) {
                Pageable pageable = (Pageable)data;
                print(null, pageable);
            } else {
                throw new PrintException("Wrong DocFlavor class: "
                        + docflavorClassName);
            }
View Full Code Here

Examples of java.awt.print.Pageable

     * @see java.awt.print.PrinterJob#print()
     */
    public void print() throws PrinterException {
        Doc doc = null;
        if (psPrintable != null) {
            Pageable pageable = new Pageable() {
                public int getNumberOfPages() {
                    return UNKNOWN_NUMBER_OF_PAGES;
                }
                public PageFormat getPageFormat(int pageIndex)
                        throws IndexOutOfBoundsException {
View Full Code Here

Examples of java.awt.print.Pageable

                }
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)){
                Printable printable = (Printable)data;
                print(printable, null);
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE)) {
                Pageable pageable = (Pageable)data;
                print(null, pageable);
            } else {
                throw new PrintException("Wrong DocFlavor class: "
                        + docflavorClassName);
            }
View Full Code Here

Examples of java.awt.print.Pageable

                }
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PRINTABLE)){
                Printable printable = (Printable)data;
                print(printable, null);
            } else if (docflavor.equals(DocFlavor.SERVICE_FORMATTED.PAGEABLE)) {
                Pageable pageable = (Pageable)data;
                print(null, pageable);
            } else {
                throw new PrintException("Wrong DocFlavor class: "
                        + docflavorClassName);
            }
View Full Code Here

Examples of java.awt.print.Pageable

     * @see java.awt.print.PrinterJob#print()
     */
    public void print() throws PrinterException {
        Doc doc = null;
        if (psPrintable != null) {
            Pageable pageable = new Pageable() {
                public int getNumberOfPages() {
                    return UNKNOWN_NUMBER_OF_PAGES;
                }
                public PageFormat getPageFormat(int pageIndex)
                        throws IndexOutOfBoundsException {
View Full Code Here

Examples of net.sourceforge.pebble.util.Pageable

            if ( pageSize <= 0 )
                pageSize = PAGE_SIZE;

            List<SearchHit> hits = result.getHits();
            Pageable pageable = new Pageable(hits);
            pageable.setPageSize(pageSize);
            pageable.setPage(offset);
            List<SearchHit> subList = pageable.getListForPage();

            BlogService service = new BlogService();

            for (SearchHit hit : subList ) {
                BlogEntry entry = service.getBlogEntry(hit.getBlog(), hit.getId());
View Full Code Here

Examples of net.sourceforge.pebble.util.Pageable

      responses = new ArrayList(blog.getRejectedResponses());
    } else {
      responses = new ArrayList(blog.getApprovedResponses());
    }

    Pageable pageable = new Pageable(responses) {
      public List getListForPage() {
        List responses = new ArrayList();
        BlogService service = new BlogService();
        Iterator it = super.getListForPage().iterator();
        while (it.hasNext()) {
          try {
            responses.add(service.getResponse(blog, (String)it.next()));
          } catch (BlogServiceException e) {
            // do nothing - some responses just won't get shown,
            // but a message will be sent to the blog
          }
        }
        return responses;
      }
    };
    pageable.setPageSize(PAGE_SIZE);
    pageable.setPage(page);
    getModel().put("pageable", pageable);

    getModel().put("type", type);

    return new ResponsesView();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.