r302 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/conten
Author: kmorin Date: 2014-07-01 08:34:20 +0200 (Tue, 01 Jul 2014) New Revision: 302 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/302 Log: - extraction des attributs dans le css - am?\195?\169lioration du calcul des quantit?\195?\169s par gamme Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-07-01 06:34:20 UTC (rev 302) @@ -373,4 +373,33 @@ List<Email> results = findAll(query); return results; } + + public Map<Range, Long[]> computeQuantitiesByRange(List<MailFolder> folders) { + String query = "SELECT range, " + + "SUM(rangeRow." + RangeRow.PROPERTY_PRODUCT_QUANTITY + ") AS prodQ, " + + "SUM(rangeRow." + RangeRow.PROPERTY_SAV_QUANTITY + ") AS savQ, " + + "SUM(rangeRow." + RangeRow.PROPERTY_QUOTATION_QUANTITY + ") AS quotQ " + + "FROM " + Email.class.getName() + " AS email " + + "INNER JOIN email." + Email.PROPERTY_RANGE_ROW + " AS rangeRow " + + "INNER JOIN rangeRow." + RangeRow.PROPERTY_RANGE + " AS range " + + "WHERE email." + Email.PROPERTY_MAIL_FOLDER + " IN :folders " + + "GROUP BY range"; + + Map<String, Object> args = new HashMap<>(); + args.put("folders", folders); + + Map<Range, Long[]> result = new HashMap<>(); + + List<Object[]> queryResuts = findAll(query, args); + for (Object[] queryResut : queryResuts) { + Range range = (Range) queryResut[0]; + Long[] sums = new Long[3]; + sums[0] = (Long) queryResut[1]; + sums[1] = (Long) queryResut[2]; + sums[2] = (Long) queryResut[3]; + result.put(range, sums); + } + + return result; + } } Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailService.java 2014-07-01 06:34:20 UTC (rev 302) @@ -47,6 +47,7 @@ import javax.activation.FileDataSource; import javax.mail.MessagingException; +import com.franciaflex.faxtomail.persistence.entities.Range; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.Predicate; import org.apache.commons.io.IOUtils; @@ -428,21 +429,8 @@ return result; } - /** - * @deprecated Ne pas recuperer trop de mails - */ - @Deprecated - public List<Email> getEmailForFolderAndSubfolders(MailFolder folder) { - EmailTopiaDao dao = getPersistenceContext().getEmailDao(); + public List<MailFolder> getChildrenRecursively(MailFolder folder) { List<MailFolder> folders = new ArrayList<>(); - folders.addAll(getChildrenRecursively(folder)); - return new ArrayList<>(dao.forMailFolderIn(folders) - .findAll()); - } - - @Deprecated - protected List<MailFolder> getChildrenRecursively(MailFolder folder) { - List<MailFolder> folders = new ArrayList<>(); folders.add(folder); Collection<MailFolder> children = folder.getChildren(); for (MailFolder child : children) { @@ -451,6 +439,12 @@ return folders; } + public Map<Range, Long[]> computeQuantitiesByRange(MailFolder rootFolder) { + List<MailFolder> folders = getChildrenRecursively(rootFolder); + EmailTopiaDao emailDao = getPersistenceContext().getEmailDao(); + return emailDao.computeQuantitiesByRange(folders); + } + public Email addToHistory(String emailId, HistoryType type, FaxToMailUser user, Date date, String... fields) { EmailTopiaDao emailDao = getPersistenceContext().getEmailDao(); Email email = emailDao.findByTopiaId(emailId); Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ComputeQuantitiesByRangeAction.java 2014-07-01 06:34:20 UTC (rev 302) @@ -36,6 +36,7 @@ import org.apache.commons.logging.LogFactory; import java.awt.*; +import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -58,42 +59,37 @@ @Override public void doAction() throws Exception { - Map<Range, RangeRowModel> quantitiesByRange = new HashMap<Range, RangeRowModel>(); MailFolder folder = getModel().getRootFolder(); - List<Email> emails = getContext().getEmailService().getEmailForFolderAndSubfolders(folder); + Map<Range, Long[]> quantitiesByRange = getContext().getEmailService().computeQuantitiesByRange(folder); - for (Email email : emails) { - Collection<RangeRow> rangeRows = email.getRangeRow(); - if (rangeRows != null) { - for (RangeRow rangeRow : rangeRows) { - Range range = rangeRow.getRange(); - RangeRowModel row = quantitiesByRange.get(range); - if (row == null) { - row = new RangeRowModel(); - row.fromEntity(rangeRow); - quantitiesByRange.put(range, row); + List<RangeRowModel> rangeRows = new ArrayList<>(); + for (Range range : quantitiesByRange.keySet()) { + RangeRowModel row = new RangeRowModel(); + row.setRange(range); - } else { - Integer productQuantity = rangeRow.getProductQuantity(); - if (productQuantity != null) { - row.setProductQuantity(row.getProductQuantity() + productQuantity); - } + Long[] quantities = quantitiesByRange.get(range); - Integer savQuantity = rangeRow.getSavQuantity(); - if (savQuantity != null) { - row.setSavQuantity(row.getSavQuantity() + savQuantity); - } + Long productQuantity = quantities[0]; + if (productQuantity == null) { + productQuantity = 0L; + } + row.setProductQuantity(productQuantity.intValue()); - Integer quotationQuantity = rangeRow.getQuotationQuantity(); - if (quotationQuantity != null) { - row.setQuotationQuantity(row.getQuotationQuantity() + quotationQuantity); - } - } + Long savQuantity = quantities[1]; + if (savQuantity == null) { + savQuantity = 0L; + } + row.setSavQuantity(savQuantity.intValue()); - } + Long quotationQuantity = quantities[2]; + if (quotationQuantity == null) { + quotationQuantity = 0L; } + row.setQuotationQuantity(quotationQuantity.intValue()); + + rangeRows.add(row); } - getModel().setRangeRows(quantitiesByRange.values()); + getModel().setRangeRows(rangeRows); } @Override Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css 2014-07-01 06:34:20 UTC (rev 302) @@ -110,4 +110,34 @@ text: "faxtomail.demandeList.action.archive"; toolTipText: "faxtomail.demandeList.action.archive.tip"; enabled: { model.isArchiveEnabled() }; +} + +#totalDemandCountLabel { + text: "faxtomail.demandeList.totalCount"; +} + +#totalDemandCountValue { + text: { String.valueOf(model.getPaginationResult().getCount()) }; +} + +#pageNumberLabel { + text: "faxtomail.demandeList.pages"; +} + +#previousPageButton { + text: "faxtomail.demandeList.goToPreviousPage"; + enabled: { model.getPaginationResult().hasPreviousPage() }; +} + +#currentPageLabel { + text: { String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1) }; +} + +#totalPageNumberLabel { + text: { String.valueOf(getModel().getPaginationResult().getLastPage().getPageNumber() + 1) }; +} + +#nextPageButton { + text: "faxtomail.demandeList.goToNextPage"; + enabled: { model.getPaginationResult().hasNextPage() }; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx 2014-07-01 06:34:20 UTC (rev 302) @@ -86,23 +86,27 @@ <JLabel id="savNbLabel"/> <JLabel id="savNbField"/> </JPanel> + <JScrollPane constraints='BorderLayout.CENTER'> <JXTable id='dataTable' onMouseClicked='handler.autoSelectRowInTable(event, tablePopup)' onKeyPressed='handler.openRowMenu(event, tablePopup)'/> </JScrollPane> + <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}" constraints='BorderLayout.SOUTH'> - <JLabel text="faxtomail.demandeList.totalCount" /> - <JLabel text="{String.valueOf(model.getPaginationResult().getCount())}" /> + <JLabel id="totalDemandCountLabel" /> + <JLabel id="totalDemandCountValue" /> + <JLabel styleClass="horizontal-separator"/> - <JLabel text="faxtomail.demandeList.pages" /> - <JButton text="faxtomail.demandeList.goToPreviousPage" onActionPerformed="handler.goToPreviousPage()" - enabled="{model.getPaginationResult().hasPreviousPage()}" /> - <JLabel text="{String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1)}" /> + + <JLabel id="pageNumberLabel" /> + <JButton id="previousPageButton" + onActionPerformed="handler.goToPreviousPage()"/> + <JLabel id="currentPageLabel" /> <JLabel styleClass="page-separator"/> - <JLabel text="{String.valueOf(model.getPaginationResult().getLastPage().getPageNumber() + 1)}" /> - <JButton text="faxtomail.demandeList.goToNextPage" onActionPerformed="handler.goToNextPage()" - enabled="{model.getPaginationResult().hasNextPage()}" /> + <JLabel id="totalPageNumberLabel" /> + <JButton id="nextPageButton" + onActionPerformed="handler.goToNextPage()" /> </JPanel> </JPanel> </JSplitPane> Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-07-01 06:34:20 UTC (rev 302) @@ -130,29 +130,6 @@ Collection<MailFolder> folders = getContext().getMailFolderService().getRootMailFoldersWithReadingRights(getContext().getCurrentUser()); model.setFolders(new ArrayList<MailFolder>(folders)); - model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() { - @Override - public void propertyChange(PropertyChangeEvent evt) { - - // reset pagination when folder change - getModel().resetPaginationParameter(); - - MailFolder folder = (MailFolder) evt.getNewValue(); - while (folder.getAllowCreateDemandIntoFolder() == null - && folder.getParent() != null) { - folder = folder.getParent(); - } - DemandeListUIModel model = getModel(); - model.setComputeQuantitiesByRangeEnabled(true); - model.setNewDemandEnabled(folder != null && Boolean.TRUE.equals(folder.getAllowCreateDemandIntoFolder())); - - LoadFolderEmailsAction loadFolderEmailsAction = - getContext().getActionFactory().createLogicAction(DemandeListUIHandler.this, - LoadFolderEmailsAction.class); - getContext().getActionEngine().runAction(loadFolderEmailsAction); - } - }); - this.ui.setContextValue(model); } @@ -265,7 +242,7 @@ }); // init tree - Map<MailFolder, DefaultMutableTreeNode> nodesByFolder = + final Map<MailFolder, FolderTreeNode> nodesByFolder = FaxToMailUIUtil.initFolderTree(getContext(), ui.getNavigationTree(), model.getFolders(), true); ui.getNavigationTree().addTreeSelectionListener(new TreeSelectionListener() { @@ -290,6 +267,34 @@ } }); + model.addPropertyChangeListener(DemandeListUIModel.PROPERTY_SELECTED_FOLDER, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + + // reset pagination when folder change + getModel().resetPaginationParameter(); + + MailFolder folder = (MailFolder) evt.getNewValue(); + + FolderTreeNode folderNode = nodesByFolder.get(folder); + boolean readable = folderNode.isCanRead(); + + while (folder.getAllowCreateDemandIntoFolder() == null + && folder.getParent() != null) { + folder = folder.getParent(); + } + + DemandeListUIModel model = getModel(); + model.setComputeQuantitiesByRangeEnabled(readable); + model.setNewDemandEnabled(readable && folder != null && Boolean.TRUE.equals(folder.getAllowCreateDemandIntoFolder())); + + LoadFolderEmailsAction loadFolderEmailsAction = + getContext().getActionFactory().createLogicAction(DemandeListUIHandler.this, + LoadFolderEmailsAction.class); + getContext().getActionEngine().runAction(loadFolderEmailsAction); + } + }); + MailFolder currentMailFolder = getContext().getCurrentMailFolder(); DemandeUIModel currentEmail = getContext().getCurrentEmail(); @@ -323,7 +328,7 @@ public void initDemandeTable(final JXTable table, boolean sortable) { super.initDemandeTable(table, sortable); - HighlightPredicate testPredicate = new HighlightPredicate() { + HighlightPredicate reportNotTakenPredicate = new HighlightPredicate() { @Override public boolean isHighlighted(Component renderer, ComponentAdapter adapter) { int viewRow = adapter.row; @@ -341,7 +346,7 @@ } }; Color color = Color.ORANGE; - table.addHighlighter(new ColorHighlighter(testPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); + table.addHighlighter(new ColorHighlighter(reportNotTakenPredicate, color, Color.WHITE, color.darker(), Color.WHITE)); } @Override Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-07-01 06:34:20 UTC (rev 302) @@ -286,3 +286,34 @@ text: "faxtomail.searchToGroup.action.cancel"; toolTipText: "faxtomail.searchToGroup.action.cancel.tip"; } + + +#totalDemandCountLabel { + text: "faxtomail.demandeList.totalCount"; +} + +#totalDemandCountValue { + text: { String.valueOf(model.getPaginationResult().getCount()) }; +} + +#pageNumberLabel { + text: "faxtomail.demandeList.pages"; +} + +#previousPageButton { + text: "faxtomail.demandeList.goToPreviousPage"; + enabled: { model.getPaginationResult().hasPreviousPage() }; +} + +#currentPageLabel { + text: { String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1) }; +} + +#totalPageNumberLabel { + text: { String.valueOf(getModel().getPaginationResult().getLastPage().getPageNumber() + 1) }; +} + +#nextPageButton { + text: "faxtomail.demandeList.goToNextPage"; + enabled: { model.getPaginationResult().hasNextPage() }; +} \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.jaxx 2014-07-01 06:34:20 UTC (rev 302) @@ -345,17 +345,19 @@ <JXTable id='dataTable'/> </JScrollPane> <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}" constraints='BorderLayout.SOUTH'> - <JLabel text="faxtomail.demandeList.totalCount" /> - <JLabel text="{String.valueOf(model.getPaginationResult().getCount())}" /> + <JLabel id="totalDemandCountLabel" /> + <JLabel id="totalDemandCountValue" /> + <JLabel styleClass="horizontal-separator"/> - <JLabel text="faxtomail.demandeList.pages" /> - <JButton text="faxtomail.demandeList.goToPreviousPage" onActionPerformed="handler.goToPreviousPage()" - enabled="{model.getPaginationResult().hasPreviousPage()}" /> - <JLabel text="{String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1)}" /> + + <JLabel id="pageNumberLabel" /> + <JButton id="previousPageButton" + onActionPerformed="handler.goToPreviousPage()"/> + <JLabel id="currentPageLabel" /> <JLabel styleClass="page-separator"/> - <JLabel text="{String.valueOf(model.getPaginationResult().getLastPage().getPageNumber() + 1)}" /> - <JButton text="faxtomail.demandeList.goToNextPage" onActionPerformed="handler.goToNextPage()" - enabled="{model.getPaginationResult().hasNextPage()}" /> + <JLabel id="totalPageNumberLabel" /> + <JButton id="nextPageButton" + onActionPerformed="handler.goToNextPage()" /> </JPanel> </JPanel> Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-07-01 06:34:20 UTC (rev 302) @@ -312,4 +312,34 @@ #dataTable { editable: true; autoCreateRowSorter: true; +} + +#totalDemandCountLabel { + text: "faxtomail.demandeList.totalCount"; +} + +#totalDemandCountValue { + text: { String.valueOf(model.getPaginationResult().getCount()) }; +} + +#pageNumberLabel { + text: "faxtomail.demandeList.pages"; +} + +#previousPageButton { + text: "faxtomail.demandeList.goToPreviousPage"; + enabled: { model.getPaginationResult().hasPreviousPage() }; +} + +#currentPageLabel { + text: { String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1) }; +} + +#totalPageNumberLabel { + text: { String.valueOf(getModel().getPaginationResult().getLastPage().getPageNumber() + 1) }; +} + +#nextPageButton { + text: "faxtomail.demandeList.goToNextPage"; + enabled: { model.getPaginationResult().hasNextPage() }; } \ No newline at end of file Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.jaxx 2014-07-01 06:34:20 UTC (rev 302) @@ -365,17 +365,19 @@ onKeyPressed='handler.openRowMenu(event, tablePopup)'/> </JScrollPane> <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}" constraints='BorderLayout.SOUTH'> - <JLabel text="faxtomail.demandeList.totalCount" /> - <JLabel text="{String.valueOf(model.getPaginationResult().getCount())}" /> + <JLabel id="totalDemandCountLabel" /> + <JLabel id="totalDemandCountValue" /> + <JLabel styleClass="horizontal-separator"/> - <JLabel text="faxtomail.demandeList.pages" /> - <JButton text="faxtomail.demandeList.goToPreviousPage" onActionPerformed="handler.goToPreviousPage()" - enabled="{model.getPaginationResult().hasPreviousPage()}" /> - <JLabel text="{String.valueOf(getModel().getPaginationParameter().getPageNumber() + 1)}" /> + + <JLabel id="pageNumberLabel" /> + <JButton id="previousPageButton" + onActionPerformed="handler.goToPreviousPage()"/> + <JLabel id="currentPageLabel" /> <JLabel styleClass="page-separator"/> - <JLabel text="{String.valueOf(model.getPaginationResult().getLastPage().getPageNumber() + 1)}" /> - <JButton text="faxtomail.demandeList.goToNextPage" onActionPerformed="handler.goToNextPage()" - enabled="{model.getPaginationResult().hasNextPage()}" /> + <JLabel id="totalPageNumberLabel" /> + <JButton id="nextPageButton" + onActionPerformed="handler.goToNextPage()" /> </JPanel> </JPanel> Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java 2014-07-01 06:34:20 UTC (rev 302) @@ -73,7 +73,7 @@ getRootMailFoldersWithMoveRights(getContext().getCurrentUser()); JTree navigationTree = ui.getNavigationTree(); - Map<MailFolder, DefaultMutableTreeNode> nodesByFolder = + Map<MailFolder, FolderTreeNode> nodesByFolder = FaxToMailUIUtil.initFolderTree(getContext(), navigationTree, folders, false); MailFolder currentFolder = getModel().getMailFolder(); Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-06-30 16:35:30 UTC (rev 301) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-07-01 06:34:20 UTC (rev 302) @@ -119,22 +119,22 @@ setApplicationContext(ui, parentUI.getHandler().getContext()); } - public static Map<MailFolder, DefaultMutableTreeNode> initFolderTree(final FaxToMailUIContext context, + public static Map<MailFolder, FolderTreeNode> initFolderTree(final FaxToMailUIContext context, JTree navigationTree, Collection<MailFolder> folders, final boolean colorNotAffectedFolders) { DefaultMutableTreeNode root = new DefaultMutableTreeNode("root"); List<MailFolder> foldersToExpand = context.getExpandedFolders(); - Map<MailFolder, DefaultMutableTreeNode> nodesByFolder = new HashMap<MailFolder, DefaultMutableTreeNode>(); + Map<MailFolder, FolderTreeNode> nodesByFolder = new HashMap<MailFolder, FolderTreeNode>(); for (MailFolder folder : folders) { nodesByFolder.putAll(FaxToMailUIUtil.createFolderTree(root, folder)); - DefaultMutableTreeNode node = nodesByFolder.get(folder); + FolderTreeNode node = nodesByFolder.get(folder); MailFolder parent = folder.getParent(); while (parent != null) { - FolderTreeNode parentNode = (FolderTreeNode) nodesByFolder.get(parent); + FolderTreeNode parentNode = nodesByFolder.get(parent); if (parentNode == null) { parentNode = new FolderTreeNode(parent); parentNode.setCanRead(false); @@ -204,9 +204,9 @@ * @param folder the folder to add to the tree * @return the map of the nodes by folder */ - protected static Map<MailFolder, DefaultMutableTreeNode> createFolderTree(DefaultMutableTreeNode parent, + protected static Map<MailFolder, FolderTreeNode> createFolderTree(DefaultMutableTreeNode parent, MailFolder folder) { - Map<MailFolder, DefaultMutableTreeNode> result = new HashMap<MailFolder, DefaultMutableTreeNode>(); + Map<MailFolder, FolderTreeNode> result = new HashMap<MailFolder, FolderTreeNode>(); FolderTreeNode node = new FolderTreeNode(folder); node.setCanSelect(true);
participants (1)
-
kmorin@users.forge.codelutin.com