Author: tchemit Date: 2008-02-14 15:38:28 +0000 (Thu, 14 Feb 2008) New Revision: 969 Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/ListTabModel.java Log: ajout de la propri?\195?\169t?\195?\169 remote sur le model d'un onglet de type liste pour connaitre ?\195?\160 tout moment la provenances des objets (utilis?\195?\169 pour diff?\195?\169rencier les exports) Modified: trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/ListTabModel.java =================================================================== --- trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/ListTabModel.java 2008-02-14 15:37:06 UTC (rev 968) +++ trunk/simexplorer-is/simexplorer-is-swing/src/java/fr/cemagref/simexplorer/is/ui/swing/model/ListTabModel.java 2008-02-14 15:38:28 UTC (rev 969) @@ -45,6 +45,8 @@ protected int selectedIndex; + protected boolean remote; + private static final long serialVersionUID = -3623331875470531459L; public String getName() { @@ -55,6 +57,10 @@ return tab; } + public boolean isRemote() { + return remote; + } + public boolean hasQuery() { return query != null && !query.isEmpty(); } @@ -92,12 +98,6 @@ return dateOrder; } - private void checkSize(int index) { - if (isEmpty() || size() < index) { - throw new IllegalStateException(getClass() + " has size " + size() + " and was required index " + index); - } - } - public boolean isOnlyLatest() { return onlyLatest; } @@ -125,7 +125,6 @@ this.tab = SimExplorerTab.valueOf(name); } - public void setList(MetaData[] list) { this.list = list; } @@ -141,6 +140,7 @@ public void initTabModel(boolean remote, SimExplorerContext context) throws Exception { // first local query, build model String query = getQuery(); + this.remote = remote; long size = StorageServiceHelper.getCount(context, remote, query, isOnlyLatest()); // init pagination PaginationModel paginationModel = new PaginationModel(); @@ -168,4 +168,10 @@ // save in model setList(data); } + + private void checkSize(int index) { + if (isEmpty() || size() < index) { + throw new IllegalStateException(getClass() + " has size " + size() + " and was required index " + index); + } + } }
participants (1)
-
tchemit@users.labs.libre-entreprise.org