sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.util/src/com/nokia/carbide/cpp/pi/util/BinaryColorPalette.java
changeset 2 b9ab3b238396
equal deleted inserted replaced
1:1050670c6980 2:b9ab3b238396
       
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.carbide.cpp.pi.util;
       
    19 
       
    20 import org.eclipse.core.runtime.Path;
       
    21 import org.eclipse.swt.graphics.RGB;
       
    22 
       
    23 public class BinaryColorPalette extends TableColorPalette {
       
    24 
       
    25 	@Override
       
    26 	public RGB getConstantRGB(Object entry) {
       
    27 		assert (entry instanceof String);
       
    28 		String bin_name = new Path((String)entry).lastSegment().toLowerCase();
       
    29 
       
    30 		// EKA1 kernel
       
    31 		// Gray out Symbian kernel so user can look at their apps without Idle
       
    32 		if (bin_name.equals("ekern") || bin_name.equals("ekern.exe")) { //$NON-NLS-1$ //$NON-NLS-2$
       
    33 	    	return new RGB(192, 192, 192); // AWT Color.lightGray
       
    34 		}
       
    35 
       
    36 		// EKA2 kernel
       
    37 		// Gray out Symbian ekern so user can look at their apps without Idle
       
    38 		if (bin_name.startsWith("_reka2_")) { //$NON-NLS-1$
       
    39 			return new RGB(192, 192, 192); // AWT Color.lightGray
       
    40 		}
       
    41 
       
    42 		// CarbideProf
       
    43 		// Gray out Profiler so user can look at their apps without Idle
       
    44 		if (bin_name.startsWith("carbideprof")) { //$NON-NLS-1$
       
    45 			return new RGB(192, 192, 192); // AWT Color.lightGray
       
    46 		}
       
    47 
       
    48 		// CarbidePI
       
    49 		// Gray out Profiler so user can look at their apps without Idle
       
    50 		if (bin_name.startsWith("carbidepi")) { //$NON-NLS-1$
       
    51 			return new RGB(192, 192, 192); // AWT Color.lightGray
       
    52 		}
       
    53 
       
    54 		// default binary not found
       
    55 		if (bin_name.startsWith("binary not found")) { //$NON-NLS-1$
       
    56 			return new RGB(64, 64, 64);	// AWT Color.darkGray
       
    57 		}
       
    58 
       
    59 		return null;
       
    60 	}
       
    61 
       
    62 }