connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/ui/ConnectionUIUtils.java
author Ed Swartz <ed.swartz@nokia.com>
Fri, 18 Dec 2009 09:54:29 -0600
changeset 709 c92b05bdc957
parent 706 bba29393db80
child 710 47bb893ba749
permissions -rw-r--r--
Update for IConnectionStatus changes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     1
/*
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     8
*
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    11
*
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    12
* Contributors:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    13
*
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    14
* Description: 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    15
*
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    16
*/
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    17
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    18
package com.nokia.carbide.remoteconnections.internal.ui;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    19
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    20
import java.util.Collection;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    21
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    22
import org.eclipse.jface.resource.ImageDescriptor;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    23
import org.eclipse.swt.graphics.Color;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    24
import org.eclipse.swt.graphics.Image;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    25
import org.eclipse.swt.widgets.Display;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    26
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    27
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    28
import com.nokia.carbide.remoteconnections.interfaces.IConnectedService;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    29
import com.nokia.carbide.remoteconnections.interfaces.IConnection;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    30
import com.nokia.carbide.remoteconnections.internal.api.IConnection2;
709
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
    31
import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus;
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
    32
import com.nokia.carbide.remoteconnections.internal.api.IConnection2.IConnectionStatus.EConnectionStatus;
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    33
import com.nokia.carbide.remoteconnections.internal.registry.Registry;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    34
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    35
/**
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    36
 * 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    37
 */
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    38
public class ConnectionUIUtils {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    39
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    40
	public static IConnectedService.IStatus getFirstInUseStatus(IConnection connection) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    41
		Collection<IConnectedService> connectedServices = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    42
			Registry.instance().getConnectedServices(connection);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    43
		// if any service is in-use, then connection is in-use
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    44
		for (IConnectedService connectedService : connectedServices) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    45
			IConnectedService.IStatus status = connectedService.getStatus();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    46
			if (status.getEStatus().equals(IConnectedService.IStatus.EStatus.IN_USE))
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    47
				return status;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    48
		}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    49
		
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    50
		return null;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    51
	}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    52
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    53
	public static boolean isConnectionInUse(IConnection connection) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    54
		return getFirstInUseStatus(connection) != null;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    55
	}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    56
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    57
	private static final ImageDescriptor STATUS_AVAIL_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    58
	RemoteConnectionsActivator.getImageDescriptor("icons/statusAvailable.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    59
	private static final ImageDescriptor STATUS_UNAVAIL_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    60
	RemoteConnectionsActivator.getImageDescriptor("icons/statusUnavailable.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    61
	private static final ImageDescriptor STATUS_UNK_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    62
	RemoteConnectionsActivator.getImageDescriptor("icons/statusUnknown.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    63
	private static final ImageDescriptor STATUS_INUSE_IMGDESC =
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    64
		RemoteConnectionsActivator.getImageDescriptor("icons/statusInUse.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    65
	
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    66
	private static final ImageDescriptor CONNECTION_READY_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    67
		RemoteConnectionsActivator.getImageDescriptor("icons/connectionStatusReady.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    68
	private static final ImageDescriptor CONNECTION_IN_USE_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    69
		RemoteConnectionsActivator.getImageDescriptor("icons/connectionStatusInUse.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    70
	private static final ImageDescriptor CONNECTION_NOT_READY_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    71
		RemoteConnectionsActivator.getImageDescriptor("icons/connectionStatusNotReady.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    72
	private static final ImageDescriptor CONNECTION_IN_USE_DISCONNECTED_IMGDESC =
709
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
    73
		RemoteConnectionsActivator.getImageDescriptor("icons/connectionStatusInUseDisconnected.png"); //$NON-NLS-1$
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    74
	
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    75
	private static final ImageDescriptor CONNECTION_IMGDESC = 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    76
		RemoteConnectionsActivator.getImageDescriptor("icons/connection.png"); //$NON-NLS-1$
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    77
	
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    78
	private static final Image STATUS_AVAIL_IMG = STATUS_AVAIL_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    79
	private static final Image STATUS_UNAVAIL_IMG = STATUS_UNAVAIL_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    80
	private static final Image STATUS_INUSE_IMG = STATUS_INUSE_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    81
	private static final Image STATUS_UNK_IMG = STATUS_UNK_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    82
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    83
	private static final Image CONNECTION_READY_IMG = CONNECTION_READY_IMGDESC.createImage(); 
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    84
	private static final Image CONNECTION_IN_USE_IMG =  CONNECTION_IN_USE_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    85
	private static final Image CONNECTION_NOT_READY_IMG = CONNECTION_NOT_READY_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    86
	private static final Image CONNECTION_IN_USE_DISCONNECTED_IMG = CONNECTION_IN_USE_DISCONNECTED_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    87
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    88
	private static final Image CONNECTION_IMG = CONNECTION_IMGDESC.createImage();
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    89
	
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    90
	public static final Color COLOR_RED = new Color(Display.getDefault(), 192, 0, 0);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    91
	public static final Color COLOR_GREEN = new Color(Display.getDefault(), 0, 128, 0);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    92
	public static final Color COLOR_ELECTRIC = new Color(Display.getDefault(), 0, 0, 255);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    93
	public static final Color COLOR_GREY = new Color(Display.getDefault(), 96, 96, 96);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    94
	
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    95
	/**
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    96
	 * Get the image representing the connection status.
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    97
	 * @param connection
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    98
	 * @return Image, not to be disposed
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    99
	 */
709
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
   100
	public static Image getConnectionStatusImage(IConnectionStatus status) {
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   101
		if (status != null) {
709
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
   102
			EConnectionStatus severity = status.getEConnectionStatus();
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   103
			
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   104
			switch (severity) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   105
			case READY:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   106
				return CONNECTION_READY_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   107
			case IN_USE:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   108
				return CONNECTION_IN_USE_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   109
			case NOT_READY:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   110
				return CONNECTION_NOT_READY_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   111
			case IN_USE_DISCONNECTED:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   112
				return CONNECTION_IN_USE_DISCONNECTED_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   113
			}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   114
		}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   115
		return ConnectionUIUtils.CONNECTION_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   116
	}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   117
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   118
	/**
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   119
	 * Get the image representing the connection status.
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   120
	 * @param connection
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   121
	 * @return Image, not to be disposed
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   122
	 */
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   123
	public static Image getConnectionImage(IConnection connection) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   124
		if (connection instanceof IConnection2) {
709
c92b05bdc957 Update for IConnectionStatus changes
Ed Swartz <ed.swartz@nokia.com>
parents: 706
diff changeset
   125
			IConnectionStatus status = ((IConnection2) connection).getStatus();
706
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   126
			return getConnectionStatusImage(status);
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   127
		}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   128
		if (isConnectionInUse(connection)) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   129
			return ConnectionUIUtils.STATUS_INUSE_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   130
		}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   131
		return ConnectionUIUtils.CONNECTION_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   132
	}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   133
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   134
	/**
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   135
	 * @param status
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   136
	 * @return
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   137
	 */
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   138
	public static Image getConnectedServiceStatusImage(IConnectedService.IStatus.EStatus status) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   139
		switch (status) {
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   140
		case DOWN:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   141
			return ConnectionUIUtils.STATUS_UNAVAIL_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   142
		case UP:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   143
			return ConnectionUIUtils.STATUS_AVAIL_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   144
		case IN_USE:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   145
			return ConnectionUIUtils.CONNECTION_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   146
		case UNKNOWN:
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   147
			return ConnectionUIUtils.STATUS_UNK_IMG;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   148
		}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   149
		return null;
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   150
	}
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   151
bba29393db80 Checkpoint commit
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   152
}