1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-09 02:36:01 +02:00

Bug 462709: Display host and user in Remote Connections preference page

Change-Id: I940b7bd27c09d12cd47487007686787f2d19b571
Signed-off-by: Bernd Hufmann <Bernd.Hufmann@ericsson.com>
This commit is contained in:
Bernd Hufmann 2015-03-20 13:19:17 -04:00
parent 62dcd2bc81
commit fab592345d

View file

@ -8,6 +8,7 @@
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Patrick Tasse - [462499] set viewer comparator * Patrick Tasse - [462499] set viewer comparator
* Bernd Hufmann - [462709] Display Host and User per connection
*******************************************************************************/ *******************************************************************************/
package org.eclipse.remote.internal.ui.preferences; package org.eclipse.remote.internal.ui.preferences;
@ -32,6 +33,7 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator; import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.remote.core.IRemoteConnection; import org.eclipse.remote.core.IRemoteConnection;
import org.eclipse.remote.core.IRemoteConnectionControlService; import org.eclipse.remote.core.IRemoteConnectionControlService;
import org.eclipse.remote.core.IRemoteConnectionHostService;
import org.eclipse.remote.core.IRemoteConnectionType; import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteConnectionWorkingCopy; import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
import org.eclipse.remote.core.IRemotePreferenceConstants; import org.eclipse.remote.core.IRemotePreferenceConstants;
@ -113,10 +115,16 @@ public class ConnectionsPreferencePage extends PreferencePage implements IWorkbe
return connection.isOpen() ? Messages.ConnectionsPreferencePage_open : Messages.ConnectionsPreferencePage_closed; return connection.isOpen() ? Messages.ConnectionsPreferencePage_open : Messages.ConnectionsPreferencePage_closed;
case 1: case 1:
return connection.getName(); return connection.getName();
// case 2: case 2:
// return connection.getAttribute(IRemoteConnection.ADDRESS_ATTR); if (connection.hasService(IRemoteConnectionHostService.class)) {
// case 3: return connection.getService(IRemoteConnectionHostService.class).getHostname();
// return connection.getAttribute(IRemoteConnection.USERNAME_ATTR); }
break;
case 3:
if (connection.hasService(IRemoteConnectionHostService.class)) {
return connection.getService(IRemoteConnectionHostService.class).getUsername();
}
break;
} }
return null; return null;
} }