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

Merge changes.

Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2013-08-13 16:03:43 -04:00
parent ae0b0bf807
commit b635da471d
3 changed files with 28 additions and 16 deletions

View file

@ -56,6 +56,8 @@ public class Messages extends NLS {
public static String RemoteResourceBrowser_Show_hidden_files; public static String RemoteResourceBrowser_Show_hidden_files;
public static String RemoteResourceBrowser_UpOneLevel; public static String RemoteResourceBrowser_UpOneLevel;
public static String RemoteUIServices_Configuring_remote_services;
public static String RemoteUIServicesProxy_1; public static String RemoteUIServicesProxy_1;
public static String RemoteUIServicesProxy_2; public static String RemoteUIServicesProxy_2;

View file

@ -37,5 +37,6 @@ RemoteResourceBrowser_newConnection=New...
RemoteResourceBrowser_NewFolder=New folder RemoteResourceBrowser_NewFolder=New folder
RemoteResourceBrowser_Show_hidden_files=Show hidden files RemoteResourceBrowser_Show_hidden_files=Show hidden files
RemoteResourceBrowser_UpOneLevel=Up one level RemoteResourceBrowser_UpOneLevel=Up one level
RemoteUIServices_Configuring_remote_services=Configuring remote services...
RemoteUIServicesProxy_1=Missing {0} attribute RemoteUIServicesProxy_1=Missing {0} attribute
RemoteUIServicesProxy_2=Failed to instantiate factory: {0} in type: {1} in plugin: {2} RemoteUIServicesProxy_2=Failed to instantiate factory: {0} in type: {1} in plugin: {2}

View file

@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.internal.remote.ui.RemoteUIPlugin; import org.eclipse.internal.remote.ui.RemoteUIPlugin;
import org.eclipse.internal.remote.ui.RemoteUIServicesProxy; import org.eclipse.internal.remote.ui.RemoteUIServicesProxy;
import org.eclipse.internal.remote.ui.messages.Messages;
import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.remote.core.IRemoteServices; import org.eclipse.remote.core.IRemoteServices;
@ -37,6 +38,7 @@ public class RemoteUIServices {
private static final String EXTENSION_POINT_ID = "remoteUIServices"; //$NON-NLS-1$ private static final String EXTENSION_POINT_ID = "remoteUIServices"; //$NON-NLS-1$
private static Map<String, RemoteUIServicesProxy> fRemoteUIServices = null; private static Map<String, RemoteUIServicesProxy> fRemoteUIServices = null;
private static Map<String, IRemoteServices> fRemoteServices = new HashMap<String, IRemoteServices>();
/** /**
* Look up a remote service provider and ensure it is initialized. The method will use the supplied container's progress * Look up a remote service provider and ensure it is initialized. The method will use the supplied container's progress
@ -50,9 +52,12 @@ public class RemoteUIServices {
* @since 5.0 * @since 5.0
*/ */
public static IRemoteServices getRemoteServices(final String id, IRunnableContext context) { public static IRemoteServices getRemoteServices(final String id, IRunnableContext context) {
IRemoteServices service = fRemoteServices.get(id);
if (service == null) {
final IRemoteServices[] remoteService = new IRemoteServices[1]; final IRemoteServices[] remoteService = new IRemoteServices[1];
IRunnableWithProgress runnable = new IRunnableWithProgress() { IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask(Messages.RemoteUIServices_Configuring_remote_services, 10);
remoteService[0] = RemoteServices.getRemoteServices(id, monitor); remoteService[0] = RemoteServices.getRemoteServices(id, monitor);
} }
}; };
@ -67,8 +72,12 @@ public class RemoteUIServices {
} catch (InterruptedException e) { } catch (InterruptedException e) {
// cancelled // cancelled
} }
service = remoteService[0];
return remoteService[0]; if (service != null) {
fRemoteServices.put(id, service);
}
}
return service;
} }
/** /**