mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-30 12:25:35 +02:00
Merge "Bug 461520: Implement service for user authentication"
This commit is contained in:
commit
45072181ad
2 changed files with 19 additions and 1 deletions
|
@ -46,6 +46,11 @@
|
|||
factory="org.eclipse.remote.internal.jsch.ui.JSchUIFileService$Factory"
|
||||
service="org.eclipse.remote.ui.IRemoteUIFileService">
|
||||
</connectionTypeService>
|
||||
<connectionTypeService
|
||||
connectionTypeId="org.eclipse.remote.JSch"
|
||||
factory="org.eclipse.remote.internal.jsch.ui.JSchUserAuthenticator$Factory"
|
||||
service="org.eclipse.remote.core.IUserAuthenticatorService">
|
||||
</connectionTypeService>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2014 IBM Corporation and others.
|
||||
* Copyright (c) 2014, 2015 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -7,6 +7,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - Initial API and implementation
|
||||
* Bernd Hufmann - Implement IRemoteConnection.Service.Factory
|
||||
*******************************************************************************/
|
||||
package org.eclipse.remote.internal.jsch.ui;
|
||||
|
||||
|
@ -105,4 +106,16 @@ public class JSchUserAuthenticator implements IUserAuthenticatorService {
|
|||
}
|
||||
return display;
|
||||
}
|
||||
|
||||
public static class Factory implements IRemoteConnection.Service.Factory {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends IRemoteConnection.Service> T getService(IRemoteConnection connection, Class<T> service) {
|
||||
if (IUserAuthenticatorService.class.equals(service)) {
|
||||
return (T) new JSchUserAuthenticator(connection);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue