access column index by constant
authordadubrow
Thu, 16 Sep 2010 09:25:20 -0500
changeset 2029 fc0ca46d10e2
parent 2028 ff6b4aae1c1e
child 2030 e290bb67ac00
access column index by constant
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java
connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/DescriptionLabelProvider.java
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java	Thu Sep 16 09:17:01 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/ConnectionsView.java	Thu Sep 16 09:25:20 2010 -0500
@@ -125,6 +125,8 @@
 	private static final ImageDescriptor SERVICE_TEST_DISABLED_IMGDESC = RemoteConnectionsActivator.getImageDescriptor("icons/serviceTest_No.png"); //$NON-NLS-1$
 	private static final ImageDescriptor CONNECTION_REFRESH_IMGDESC = RemoteConnectionsActivator.getImageDescriptor("icons/connectionRefresh.png"); //$NON-NLS-1$
 
+	public static final int DESCRIPTION_COLUMN_INDEX = 3;
+	
 	private static final String NEW_ACTION = "ConnectionsView.new"; //$NON-NLS-1$
 	private static final String EDIT_ACTION = "ConnectionsView.edit"; //$NON-NLS-1$
 	private static final String RENAME_ACTION = "ConnectionsView.rename"; //$NON-NLS-1$
--- a/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/DescriptionLabelProvider.java	Thu Sep 16 09:17:01 2010 -0500
+++ b/connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/view/DescriptionLabelProvider.java	Thu Sep 16 09:25:20 2010 -0500
@@ -124,7 +124,7 @@
 				List<Element> elements = parseText(text);
 				if (elements.isEmpty())
 					return null;
-				int locMouseX = event.x - item.getTextBounds(3).x;
+				int locMouseX = event.x - item.getTextBounds(ConnectionsView.DESCRIPTION_COLUMN_INDEX).x;
 				GC gc = new GC(item.getDisplay());
 				try {
 					gc.setFont(item.getFont());