This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Copyright (c) 2014 Michael Vorburger 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: Michael Vorburger - Initial API and implementation | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch.vorburger.xtext.utils; | |
import java.io.File; | |
import java.util.Collection; | |
import org.apache.commons.io.FileUtils; | |
import org.eclipse.emf.common.util.URI; | |
import org.eclipse.emf.ecore.resource.Resource; | |
import org.eclipse.emf.ecore.resource.ResourceSet; | |
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vorburger@yoko:~/git/org.eclipse.xtext$ git push origin | |
Counting objects: 21, done. | |
Delta compression using up to 8 threads. | |
Compressing objects: 100% (8/8), done. | |
Writing objects: 100% (11/11), 1.01 KiB | 0 bytes/s, done. | |
Total 11 (delta 6), reused 0 (delta 0) | |
remote: Resolving deltas: 100% (6/6) | |
remote: Processing changes: new: 1, refs: 1, done | |
remote: ---------- | |
remote: Reviewing commit: commit 04b2c6347d0ae4b20ff3a3749120568a9f772322 1391876867 ----sp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO This probably already exists somewhere? | |
public Optional<IJavaProject> getJavaProject(IProject project) { | |
try { | |
if (project.hasNature(JavaCore.NATURE_ID)) { | |
IJavaProject javaProject = JavaCore.create(project); | |
return Optional.of(javaProject); | |
} else { | |
return Optional.absent(); | |
} | |
} catch (CoreException e) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO Such an Optional for instanceof cast should be available more generically, somewhere? | |
@SuppressWarnings("unchecked") | |
protected <S, T extends S> Optional<T> getOptionalSubclass(S project, Class<T> desiredSubclass) { | |
if (desiredSubclass.isInstance(project)) | |
return Optional.of((T) project); | |
else | |
return Optional.absent(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Delivered-To: mi...@gmail.com | |
Received: by 10.112.182.1 with SMTP id ea1csp1097818lbc; | |
Sun, 19 Apr 2015 15:17:27 -0700 (PDT) | |
X-Received: by 10.42.88.206 with SMTP id d14mr15378148icm.40.1429481846161; | |
Sun, 19 Apr 2015 15:17:26 -0700 (PDT) | |
Return-Path: <bugzilla-daemon@eclipse.org> | |
Received: from pmta1.delivery9.ore.mailhop.org (pmta1.delivery9.ore.mailhop.org. [54.186.172.23]) | |
by mx.google.com with ESMTPS id j197si14363280ioj.18.2015.04.19.15.17.25 | |
for <mi...@gmail.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2016 Red Hat, Inc. 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 | |
*/ | |
package org.opendaylight.netvirt.aclservice.tests.utils.inject; | |
import static java.lang.annotation.ElementType.TYPE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2016 Red Hat, Inc. 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 | |
*/ | |
package org.opendaylight.netvirt.aclservice.tests.utils.inject; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2016 Red Hat, Inc. 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 | |
*/ | |
package org.opendaylight.netvirt.aclservice.tests.utils.inject; | |
import java.lang.reflect.Method; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (c) 2016 Red Hat, Inc. 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 | |
*/ | |
package org.opendaylight.netvirt.aclservice.tests.utils.inject; | |
import org.junit.runners.BlockJUnit4ClassRunner; |