sysperfana/analyzetoolext/com.nokia.s60tools.analyzetool/src/com/nokia/s60tools/analyzetool/engine/ProjectResults.java
changeset 6 f65f740e69f9
parent 1 1050670c6980
child 15 0367d2db2c06
equal deleted inserted replaced
5:844b047e260d 6:f65f740e69f9
     1 /*
     1 /*
     2  * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2  * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3  * All rights reserved.
     3  * All rights reserved.
     4  * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5  * under the terms of "Eclipse Public License v1.0"
     5  * under the terms of "Eclipse Public License v1.0"
     6  * which accompanies this distribution, and is available
     6  * which accompanies this distribution, and is available
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    22 import java.util.Hashtable;
    22 import java.util.Hashtable;
    23 import java.util.Iterator;
    23 import java.util.Iterator;
    24 import java.util.Locale;
    24 import java.util.Locale;
    25 
    25 
    26 import org.eclipse.core.resources.IProject;
    26 import org.eclipse.core.resources.IProject;
    27 
    27 import org.eclipse.core.runtime.IStatus;
       
    28 
       
    29 import com.nokia.s60tools.analyzetool.Activator;
    28 import com.nokia.s60tools.analyzetool.global.Util;
    30 import com.nokia.s60tools.analyzetool.global.Util;
    29 
    31 
    30 /**
    32 /**
    31  * Stores project related memory analysis results.
    33  * Stores project related memory analysis results.
    32  *
    34  *
    85 			projectUnknownComp.remove(project);
    87 			projectUnknownComp.remove(project);
    86 		}
    88 		}
    87 	}
    89 	}
    88 
    90 
    89 	/**
    91 	/**
    90 	 * Check that contains given project some data.
    92 	 * Checks is there stored results available for the given project reference.
    91 	 *
    93 	 *
    92 	 * @param project
    94 	 * @param project
    93 	 *            Project reference
    95 	 *            Project reference
    94 	 * @return True if project contains data, otherwise False
    96 	 * @return True if project contains results, otherwise False
    95 	 */
    97 	 */
    96 	public final boolean contains(final IProject project) {
    98 	public final boolean contains(final IProject project) {
    97 		if (project == null) {
    99 		if (project == null) {
    98 			return false;
   100 			return false;
    99 		}
   101 		}
   290 	 * @param mmps Project mmp's
   292 	 * @param mmps Project mmp's
   291 	 * @param modules List of the modules.
   293 	 * @param modules List of the modules.
   292 	 */
   294 	 */
   293 	public void setProjectModules(IProject project, AbstractList<MMPInfo> mmps, AbstractList<String> modules)
   295 	public void setProjectModules(IProject project, AbstractList<MMPInfo> mmps, AbstractList<String> modules)
   294 	{
   296 	{
   295 		Iterator<String> iterModules = modules.iterator();
   297 		try{
   296 		AbstractList<String> unknownComponents = new ArrayList<String>();
   298 			if( modules.isEmpty() || mmps.isEmpty() ) {
   297 		while( iterModules.hasNext() ) {
   299 				return;
   298 			String moduleName = iterModules.next();
   300 			}
   299 			boolean build = Util.isModulePartOfProject(mmps, moduleName);
   301 			Iterator<String> iterModules = modules.iterator();
   300 			if( !build ) {
   302 			AbstractList<String> unknownComponents = new ArrayList<String>();
   301 				unknownComponents.add(moduleName);
   303 			while( iterModules.hasNext() ) {
   302 			}
   304 				String moduleName = iterModules.next();
   303 		}
   305 				boolean build = Util.isModulePartOfProject(mmps, moduleName);
   304 		setProjectUnknownModules(project, unknownComponents);
   306 				if( !build ) {
       
   307 					unknownComponents.add(moduleName);
       
   308 				}
       
   309 			}
       
   310 			setProjectUnknownModules(project, unknownComponents);
       
   311 		}
       
   312 		catch(Exception e)
       
   313 		{
       
   314 			Activator.getDefault().log(IStatus.ERROR, "Can not set project modules", e);
       
   315 		}
       
   316 		
       
   317 		
   305 	}
   318 	}
   306 
   319 
   307 	/**
   320 	/**
   308 	 * Stores project unknown modules.
   321 	 * Stores project unknown modules.
   309 	 * @param project Project reference
   322 	 * @param project Project reference