sysperfana/perfinvestigator/com.nokia.carbide.cpp.pi.perfcounters/src/com/nokia/carbide/cpp/pi/perfcounters/PecPlugin.java
changeset 12 ae255c9aa552
parent 5 844b047e260d
equal deleted inserted replaced
11:5b9d4d8641ce 12:ae255c9aa552
    54 	public static final String PECTRACE_DRAWMODE_SHOW_ALL = "ShowAll";//$NON-NLS-1$
    54 	public static final String PECTRACE_DRAWMODE_SHOW_ALL = "ShowAll";//$NON-NLS-1$
    55 
    55 
    56 	// The shared instance
    56 	// The shared instance
    57 	private static PecPlugin plugin;
    57 	private static PecPlugin plugin;
    58 	
    58 	
    59 	private static final Map<Integer, PecGuiManager> guiManagerMap = new HashMap<Integer, PecGuiManager>();
    59 	private static final Map<Integer, PecGuiManager> GUI_MANAGER_MAP = new HashMap<Integer, PecGuiManager>();
    60 
    60 
    61 	/**
    61 	/**
    62 	 * The constructor
    62 	 * The constructor
    63 	 */
    63 	 */
    64 	public PecPlugin() {
    64 	public PecPlugin() {
   120 		
   120 		
   121 		NpiInstanceRepository.getInstance().activeUidAddTrace(PLUGIN_ID, trace);
   121 		NpiInstanceRepository.getInstance().activeUidAddTrace(PLUGIN_ID, trace);
   122 		
   122 		
   123 		//create the GUI class which manages the graphs
   123 		//create the GUI class which manages the graphs
   124 		int uid = NpiInstanceRepository.getInstance().activeUid();
   124 		int uid = NpiInstanceRepository.getInstance().activeUid();
   125 		guiManagerMap.put(uid, new PecGuiManager(uid, parsedTrace, GRAPH_COUNT, Messages.PecPlugin_0));
   125 		GUI_MANAGER_MAP.put(uid, new PecGuiManager(uid, parsedTrace, GRAPH_COUNT, Messages.PecPlugin_0));
   126 	}
   126 	}
   127 
   127 
   128 	/* (non-Javadoc)
   128 	/* (non-Javadoc)
   129 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceName()
   129 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceName()
   130 	 */
   130 	 */
   243 	/* (non-Javadoc)
   243 	/* (non-Javadoc)
   244 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IVisualizable#getTraceGraph(int)
   244 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IVisualizable#getTraceGraph(int)
   245 	 */
   245 	 */
   246 	public IGenericTraceGraph getTraceGraph(int graphIndex) {
   246 	public IGenericTraceGraph getTraceGraph(int graphIndex) {
   247 		int uid = NpiInstanceRepository.getInstance().activeUid();
   247 		int uid = NpiInstanceRepository.getInstance().activeUid();
   248 		PecGuiManager guiManager = guiManagerMap.get(uid);
   248 		PecGuiManager guiManager = GUI_MANAGER_MAP.get(uid);
   249 		
   249 		
   250 		if (guiManager != null){
   250 		if (guiManager != null){
   251 			return guiManager.getTraceGraph(graphIndex, HELP_CONTEXT_ID_MAIN_PAGE);			
   251 			return guiManager.getTraceGraph(graphIndex, HELP_CONTEXT_ID_MAIN_PAGE);			
   252 		}
   252 		}
   253 		
   253 		
   292 	public void runOnDispose() {
   292 	public void runOnDispose() {
   293 		// called when editor closes
   293 		// called when editor closes
   294 		
   294 		
   295 		// Do any cleanup work here when the editor closes
   295 		// Do any cleanup work here when the editor closes
   296 		int uid = NpiInstanceRepository.getInstance().activeUid();
   296 		int uid = NpiInstanceRepository.getInstance().activeUid();
   297 		guiManagerMap.remove(uid);
   297 		GUI_MANAGER_MAP.remove(uid);
   298 	}
   298 	}
   299 
   299 
   300 	/* (non-Javadoc)
   300 	/* (non-Javadoc)
   301 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IFinalizeTrace#runOnPartOpened()
   301 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.IFinalizeTrace#runOnPartOpened()
   302 	 */
   302 	 */
   313 		} else if (className.startsWith("com.nokia.carbide.cpp.pi.internal.perfcounters.PecSample")){//$NON-NLS-1$
   313 		} else if (className.startsWith("com.nokia.carbide.cpp.pi.internal.perfcounters.PecSample")){//$NON-NLS-1$
   314 			return PecSample.class;
   314 			return PecSample.class;
   315 		}
   315 		}
   316 		return null;
   316 		return null;
   317 	}
   317 	}
   318 
   318 	
       
   319 	/*
       
   320 	 * (non-Javadoc)
       
   321 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#isMandatory()
       
   322 	 */
       
   323 	public boolean isMandatory() {
       
   324 		return false;
       
   325 	}
       
   326 
       
   327 	/*
       
   328 	 * (non-Javadoc)
       
   329 	 * @see com.nokia.carbide.cpp.internal.pi.plugin.model.ITrace#getTraceDescription()
       
   330 	 */
       
   331 	public String getTraceDescription() {
       
   332 		return getTraceTitle();
       
   333 	}
   319 }
   334 }