Merge "Issue #2232 - Fix index out of bounds exception in Sub Manager Table" into development

Former-commit-id: 6698d5d65f [formerly 5d32fd30df] [formerly a42d4bb0cc] [formerly 6698d5d65f [formerly 5d32fd30df] [formerly a42d4bb0cc] [formerly 30baa25afa [formerly a42d4bb0cc [formerly d49617f4acec37ddbaa0ec1d91306687a35531b0]]]]
Former-commit-id: 30baa25afa
Former-commit-id: d340bb792b [formerly 8f3b40e732] [formerly 04d138d3d113b1e2230601f125d0cb7b9687aa4a [formerly 2af73d09f9]]
Former-commit-id: a9c94e9db39deb852033d497b7611835ff464ad4 [formerly d4c75a38fd]
Former-commit-id: 7fe76ccf80
This commit is contained in:
Lee Venable 2013-07-29 11:52:16 -05:00 committed by Gerrit Code Review
commit 685ca5ce2f

View file

@ -103,6 +103,7 @@ import com.raytheon.uf.viz.datadelivery.utils.DataDeliveryUtils.TABLE_TYPE;
* May 23, 2013 2020 mpduff Call updateControls();
* May 28, 2013 1650 djohnson More information when failing to schedule subscriptions.
* Jun 14, 2013 2064 mpduff Null check for sorted column.
* Jul 29, 2013 2232 mpduff IndexOutOfBoundsException check.
*
* </pre>
*
@ -701,15 +702,17 @@ public class SubscriptionTableComp extends TableComp implements IGroupAction {
*/
@Override
protected void handleTableSelection(SelectionEvent e) {
TableItem item = table.getSelection()[0];
TableColumn[] columns = table.getColumns();
if (table.getSelectionIndex() > -1) {
TableItem item = table.getSelection()[0];
TableColumn[] columns = table.getColumns();
for (int i = 0; i < columns.length; i++) {
if (columns[i].getText().equals("Active")) {
if (item.getText(i).equalsIgnoreCase("T")) {
subActionCallback.activateButtonUpdate("Deactivate");
} else {
subActionCallback.activateButtonUpdate("Activate");
for (int i = 0; i < columns.length; i++) {
if (columns[i].getText().equals("Active")) {
if (item.getText(i).equalsIgnoreCase("T")) {
subActionCallback.activateButtonUpdate("Deactivate");
} else {
subActionCallback.activateButtonUpdate("Activate");
}
}
}
}