From 8dd4683f5ad834ccd824dcc864262be78748b237 Mon Sep 17 00:00:00 2001 From: robekras Date: Thu, 29 Dec 2011 17:40:58 +0000 Subject: [PATCH] 1) Fixed issue #751: Pathmap 'Edit' button enable/disable handling. --- .../xdebug/ui/php/launching/PHPPathMapTab.java | 22 ++++++++++++------- 1 files changed, 14 insertions(+), 8 deletions(-) diff --git a/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/php/launching/PHPPathMapTab.java b/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/php/launching/PHPPathMapTab.java index 1df8c64..64fdb10 100644 --- a/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/php/launching/PHPPathMapTab.java +++ b/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/php/launching/PHPPathMapTab.java @@ -283,16 +283,22 @@ public class PHPPathMapTab extends AbstractLaunchConfigurationTab { * @param event the selection change event */ protected void handleTableSelectionChanged(SelectionChangedEvent event) { - int size = ((IStructuredSelection)event.getSelection()).size(); - int idx = fPathMapTable.getTable().getSelectionIndex(); - int count = fPathMapTable.getTable().getItemCount(); - if (size==1) { - fEditButton.setEnabled(idx>0); - fUpButton.setEnabled(idx>0); - fDownButton.setEnabled((idx>=0)&&(idx= 0); // Enable 'Edit' button if a pathmap entry is selected + fUpButton.setEnabled (idx > 0); // Enable 'Up' button only if the selected entry is not the very first one + fDownButton.setEnabled ((idx >= 0) && (idx < count-1)); // Enable 'Down' button only if the selected entry is not the very last one + } + else { // If nothing selected, or more than one entry selected + fEditButton.setEnabled (false); // Disable 'Edit' button + fUpButton.setEnabled (false); // Disable 'Up' button + fDownButton.setEnabled (false); // Disable 'Down' button } - fRemoveButton.setEnabled(size > 0); + fRemoveButton.setEnabled (size > 0); // Enable 'Remove' if at least on entry is selected } /** -- 1.7.1