| /******************************************************************************* |
| * Copyright (c) 2006, 2010 Soyatec (http://www.soyatec.com) and others. |
| * 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: |
| * Soyatec - initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.xwt.tools.ui.designer.jdt; |
| |
| import org.eclipse.core.runtime.CoreException; |
| import org.eclipse.core.runtime.IPath; |
| import org.eclipse.jdt.core.IClasspathContainer; |
| import org.eclipse.jdt.core.IJavaProject; |
| import org.eclipse.jdt.core.JavaCore; |
| |
| public class XWTClasspathContainerInitializer extends org.eclipse.jdt.core.ClasspathContainerInitializer { |
| |
| public XWTClasspathContainerInitializer() { |
| } |
| |
| @Override |
| public void initialize(IPath containerPath, IJavaProject project) throws CoreException { |
| int size = containerPath.segmentCount(); |
| if (size > 0) { |
| if (containerPath.segment(0).equals(IContainerConstants.LIB_CONTAINER)) { |
| ClasspathContainer container = ProjectHelper.createContainer(); |
| JavaCore.setClasspathContainer(containerPath, new IJavaProject[] { project }, new IClasspathContainer[] { container }, null); |
| } |
| } |
| } |
| } |