Package de.innovationgate.eclipse.wgadesigner.utils

Source Code of de.innovationgate.eclipse.wgadesigner.utils.JDTUtils

/*******************************************************************************
* Copyright (c) 2009, 2010 Innovation Gate GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
*     Innovation Gate GmbH - initial API and implementation
******************************************************************************/
package de.innovationgate.eclipse.wgadesigner.utils;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException;

public class JDTUtils {
 
  public static void addNature(IProject project, String natureId) throws CoreException {
    IProjectDescription description = project.getDescription();
    String[] natures = description.getNatureIds();
      String[] newNatures = new String[natures.length + 1];
      System.arraycopy(natures, 0, newNatures, 0, natures.length);
      newNatures[natures.length] = natureId;
      description.setNatureIds(newNatures);
    project.setDescription(description, null);
  }

}
TOP

Related Classes of de.innovationgate.eclipse.wgadesigner.utils.JDTUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.