blob: 2a8de067f08da911692fc5c71133800bcf284a70 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 QNX Software Systems 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
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* QNX Software Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.remote.internal.ui.services.local;
import org.eclipse.remote.core.IRemoteConnectionType;
import org.eclipse.remote.core.IRemoteConnectionType.Service;
import org.eclipse.remote.ui.AbstractRemoteUIConnectionService;
import org.eclipse.remote.ui.IRemoteUIConnectionService;
import org.eclipse.remote.ui.IRemoteUIConnectionWizard;
import org.eclipse.swt.widgets.Shell;
public class LocalUIConnectionService extends AbstractRemoteUIConnectionService {
private IRemoteConnectionType connectionType;
public LocalUIConnectionService(IRemoteConnectionType connectionType) {
this.connectionType = connectionType;
}
@Override
public IRemoteUIConnectionWizard getConnectionWizard(Shell shell) {
// we don't do this
return null;
}
public static class Factory implements IRemoteConnectionType.Service.Factory {
@SuppressWarnings("unchecked")
@Override
public <T extends Service> T getService(IRemoteConnectionType connectionType, Class<T> service) {
if (IRemoteUIConnectionService.class.equals(service)) {
return (T) new LocalUIConnectionService(connectionType);
}
return null;
}
}
@Override
public IRemoteConnectionType getConnectionType() {
return connectionType;
}
}