diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/ITableFind.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/ITableFind.java index 532163e1ba..4098875b6c 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/ITableFind.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/common/ui/ITableFind.java @@ -28,8 +28,8 @@ package com.raytheon.uf.viz.datadelivery.common.ui; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * May 7, 2012 jpiatt Initial creation. - * + * May 7, 2012 jpiatt Initial creation. + * Sep 26, 2013 2417 mpduff Add clearSelection method. * * * @author jpiatt @@ -40,17 +40,24 @@ public interface ITableFind { /** * handleFind call */ - public void handlePageSelection(); - + void handlePageSelection(); + /** * handleFind call - * @param index + * + * @param index */ - public void selectIndex(int index); - + void selectIndex(int index); + /** * handleFind call - * @param indices + * + * @param indices */ - public void selectIndices(int[] indices); + void selectIndices(int[] indices); + + /** + * Clear any table selections. + */ + void clearSelections(); } diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/FindDlg.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/FindDlg.java index 1ff9d1b8e8..dabeb4cc30 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/FindDlg.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/FindDlg.java @@ -30,9 +30,11 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Layout; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; @@ -56,6 +58,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialog; * Jun 07, 2012 687 lvenable Table data refactor. * Dec 12. 2012 1418 mpduff Change label. * Aug 30, 2013 2314 mpduff Fixed find, filter, and various other bugs. + * Sep 26, 2013 2417 mpduff Reset the highlight all indices on close. * * * @@ -182,6 +185,12 @@ public class FindDlg extends CaveSWTDialog { */ @Override protected void initializeComponents(Shell shell) { + shell.addListener(SWT.Close, new Listener() { + @Override + public void handleEvent(Event event) { + callback.selectIndices(null); + } + }); createFindLayout(); createBottomButtons(); } @@ -305,6 +314,7 @@ public class FindDlg extends CaveSWTDialog { closeBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { + callback.selectIndices(null); close(); } }); @@ -490,6 +500,7 @@ public class FindDlg extends CaveSWTDialog { mb.setMessage("No item matching your search was found."); mb.open(); tableIndex = 0; + callback.clearSelections(); } } diff --git a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java index 0994b29a2d..80e7893ca8 100644 --- a/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java +++ b/cave/com.raytheon.uf.viz.datadelivery/src/com/raytheon/uf/viz/datadelivery/notification/NotificationTableComp.java @@ -80,6 +80,7 @@ import com.raytheon.uf.viz.datadelivery.utils.NotificationHandler; * Apr 25, 2013 1820 mpduff Get the column list every time. * Aug 30, 2013 2314 mpduff Sort the table data on load. * Sep 16, 2013 2375 mpduff Removed initial sorting. + * Sep 26, 2013 2417 mpduff Fix the find all row selection. * * * @author lvenable @@ -1150,7 +1151,7 @@ public class NotificationTableComp extends TableComp implements ITableFind { if (startIndex == 0) { highlightIndex = index; } else if (selectedPage > 0) { - int extra = (selectedPage * pageConfig); + int extra = ((selectedPage - 1) * pageConfig); highlightIndex = index - extra; } else { highlightIndex = index - pageConfig; @@ -1311,10 +1312,11 @@ public class NotificationTableComp extends TableComp implements ITableFind { @Override public void selectIndices(int[] indices) { this.indices = indices; - - // highlight table rows - table.select(indices); - handlePageSelection(); + if (indices != null && indices.length > 0) { + // highlight table rows + table.select(indices); + handlePageSelection(); + } } /** @@ -1345,4 +1347,9 @@ public class NotificationTableComp extends TableComp implements ITableFind { public boolean isLocked() { return pauseButton.getSelection(); } + + @Override + public void clearSelections() { + table.deselectAll(); + } }