From 220f17bc9243eeb64152500577426db882d50bad Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Mon, 26 May 2008 14:38:09 +0000 Subject: [PATCH] [233057][remotecdt]Fix button enablement (Apply patch from Johann Draschwandtner) --- .../internal/remotecdt/RemoteCMainTab.java | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java index 0e90af08519..0bb26bb2b04 100644 --- a/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java +++ b/rse/examples/org.eclipse.rse.remotecdt/src/org/eclipse/rse/internal/remotecdt/RemoteCMainTab.java @@ -12,6 +12,7 @@ * Yu-Fen Kuo (MontaVista) - [190613] Fix NPE in Remotecdt when RSEUIPlugin has not been loaded * Martin Oberhuber (Wind River) - [cleanup] Avoid using SystemStartHere in production code * Johann Draschwandtner (Wind River) - [231827][remotecdt]Auto-compute default for Remote path + * Johann Draschwandtner (Wind River) - [233057][remotecdt]Fix button enablement *******************************************************************************/ package org.eclipse.rse.internal.remotecdt; @@ -176,9 +177,9 @@ public class RemoteCMainTab extends CMainTab { setDirty(true); updateLaunchConfigurationDialog(); useDefaultsFromConnection(); + updatePropertiesButton(); } }); - updateConnectionPulldown(); newRemoteConnectionButton = createPushButton(projComp, Messages.RemoteCMainTab_New, null); newRemoteConnectionButton.addSelectionListener(new SelectionAdapter() { @@ -198,6 +199,7 @@ public class RemoteCMainTab extends CMainTab { } }); + updateConnectionPulldown(); } /* @@ -307,6 +309,7 @@ public class RemoteCMainTab extends CMainTab { updateTargetProgFromConfig(config); updateSkipDownloadFromConfig(config); + updatePropertiesButton(); } protected void handleNewRemoteConnectionSelected() { @@ -413,7 +416,6 @@ public class RemoteCMainTab extends CMainTab { } super.buttonPressed(buttonId); } - } IHost currentConnectionSelected = getCurrentConnection(); RemoteConnectionPropertyDialog dlg = new RemoteConnectionPropertyDialog(getControl().getShell(), @@ -481,11 +483,28 @@ public class RemoteCMainTab extends CMainTab { } } - if(connections.length > 0) + if(connections.length > 0) { connectionCombo.select(connections.length - 1); + } + updatePropertiesButton(); } } + private void updatePropertiesButton() { + if((remoteConnectionPropertiesButton == null) || remoteConnectionPropertiesButton.isDisposed()) { + return; + } + boolean bEnableProperties = false; + IHost currentConnectionSelected = getCurrentConnection(); + if(currentConnectionSelected != null) { + IRSESystemType sysType = currentConnectionSelected.getSystemType(); + if (sysType != null && sysType.isEnabled() && !sysType.isLocal()) { + bEnableProperties = true; + } + } + remoteConnectionPropertiesButton.setEnabled(bEnableProperties); + } + protected void updateTargetProgFromConfig(ILaunchConfiguration config) { String targetPath = null; try {