]>
git.argeo.org Git - gpl/argeo-jcr.git/blob - swt/org.argeo.cms.jcr.ui/src/org/argeo/cms/jcr/swt/JcrQueryTabularPart.java
1 package org
.argeo
.cms
.jcr
.swt
;
4 import javax
.jcr
.NodeIterator
;
5 import javax
.jcr
.RepositoryException
;
6 import javax
.jcr
.query
.Query
;
8 import org
.argeo
.cms
.ux
.widgets
.AbstractTabularPart
;
9 import org
.argeo
.jcr
.JcrException
;
11 public class JcrQueryTabularPart
extends AbstractTabularPart
<Query
, Node
> {
12 private int cursor
= 0;
13 private NodeIterator nit
= null;
16 public int getItemCount() {
17 return (int) nit
.getSize();
21 public Node
getData(int row
) {
22 // System.out.println("Row " + row);
27 } else if (row
> cursor
) {
28 nit
.skip(row
- cursor
);
32 } else if (row
< cursor
) {
34 nit
= getInput().execute().getNodes();
35 } catch (RepositoryException e
) {
36 throw new JcrException("Cannot refresh query", e
);
38 notifyItemCountChange();
44 throw new IllegalStateException("Cursor is " + cursor
+ " and row is " + row
);
50 public void refresh() {
53 nit
= getInput().execute().getNodes();
54 } catch (RepositoryException e
) {
55 throw new JcrException("Cannot refresh query", e
);
60 public long getQuerySize() {