ModuleCreationBaseHandler.java 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. ///////////////////////////////////////////////////////////////////////////
  2. // Copyright (c) 2018 Intel Corporation. //
  3. // //
  4. // All rights reserved. This program and the accompanying materials //
  5. // are made available under the terms of the Eclipse Public License v1.0 //
  6. // which accompanies this distribution, and is available at //
  7. // http://www.eclipse.org/legal/epl-v10.html //
  8. // //
  9. // Contributors: //
  10. // Intel Corporation - initial implementation and documentation //
  11. ///////////////////////////////////////////////////////////////////////////
  12. package com.intel.sgx.handlers;
  13. import org.eclipse.core.resources.IProject;
  14. import org.eclipse.core.resources.IProjectDescription;
  15. import org.eclipse.core.runtime.CoreException;
  16. public class ModuleCreationBaseHandler {
  17. public boolean isCPProject(IProject project)
  18. {
  19. boolean isCPProject = false;
  20. IProjectDescription description;
  21. try {
  22. description = project.getDescription();
  23. String[] natures = description.getNatureIds();
  24. for(String nature: natures){
  25. if(nature.equals("org.eclipse.cdt.core.ccnature"))
  26. isCPProject = true;
  27. }
  28. } catch (CoreException e) {
  29. // TODO Auto-generated catch block
  30. e.printStackTrace();
  31. }
  32. return isCPProject;
  33. }
  34. }