Issue #2232 - Fix index out of bounds exception in Sub Manager Table

Change-Id: Id61f6c2ddccb965a236bf9a99412e6f6cca8cae0

Former-commit-id: 83c79750af [formerly 974d5a05b2] [formerly 83c79750af [formerly 974d5a05b2] [formerly 3ab275aea4 [formerly baa8d402efb4aeff839e06fd180a73a857fd0766]]]
Former-commit-id: 3ab275aea4
Former-commit-id: df83cf2ffe [formerly 579daeaebb]
Former-commit-id: 6683a5c949
This commit is contained in:
Mike Duff 2013-07-29 09:50:55 -05:00
parent b49ba6b44b
commit e01702f842

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");
}
}
}
}