-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from eclipse-passage/561553
561553
- Loading branch information
Showing
24 changed files
with
606 additions
and
39 deletions.
There are no files selected for viewing
19 changes: 12 additions & 7 deletions
19
bundles/org.eclipse.passage.ldc.pde.ui.templates/META-INF/MANIFEST.MF
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
Manifest-Version: 1.0 | ||
Automatic-Module-Name: org.eclipse.passage.ldc.pde.ui.templates | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: %Bundle-Name | ||
Bundle-SymbolicName: org.eclipse.passage.ldc.pde.ui.templates;singleton:=true | ||
Bundle-Version: 0.5.200.qualifier | ||
Bundle-Name: %Bundle-Name | ||
Bundle-Vendor: %Bundle-Vendor | ||
Bundle-Copyright: %Bundle-Copyright | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Export-Package: org.eclipse.passage.ldc.internal.pde.ui.templates;x-internal:=true, | ||
org.eclipse.passage.ldc.internal.pde.ui.templates.i18n;x-internal:=true | ||
Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0", | ||
org.eclipse.core.resources;bundle-version="0.0.0", | ||
org.eclipse.jface;bundle-version="0.0.0", | ||
org.eclipse.pde.ui;bundle-version="0.0.0", | ||
org.eclipse.pde.ui.templates;bundle-version="0.0.0", | ||
org.eclipse.passage.lic.equinox;bundle-version="0.0.0" | ||
Export-Package: org.eclipse.passage.ldc.internal.pde.ui.templates;x-internal:=true, | ||
org.eclipse.passage.ldc.internal.pde.ui.templates.i18n;x-internal:=true | ||
org.eclipse.passage.lic.equinox;bundle-version="0.0.0", | ||
org.eclipse.e4.core.contexts;bundle-version="0.0.0", | ||
org.eclipse.e4.core.di;bundle-version="0.0.0" | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-Copyright: %Bundle-Copyright | ||
Automatic-Module-Name: org.eclipse.passage.ldc.pde.ui.templates | ||
Import-Package: javax.annotation;version="1.0.0";resolution:=optional, | ||
javax.inject;version="1.0.0" | ||
Bundle-ActivationPolicy: lazy |
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
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
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
8 changes: 8 additions & 0 deletions
8
...emplates/templates/LicensedE4FullFeatherProduct/OSGI-INF/$packageName$.magic.Universe.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="$packageName$.magic.Universe"> | ||
<service> | ||
<provide interface="$packageName$.magic.Creatures"/> | ||
<provide interface="$packageName$.magic.service.MagicForces"/> | ||
</service> | ||
<implementation class="$packageName$.magic.Universe"/> | ||
</scr:component> |
13 changes: 13 additions & 0 deletions
13
...templates/LicensedE4FullFeatherProduct/OSGI-INF/$packageName$.magic.service.EvilWitch.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="$packageName$.magic.service.EvilWitch"> | ||
<property name="licensing.feature.identifier" value="EvilWitch"/> | ||
<property name="licensing.feature.name" value="Evil Witch"/> | ||
<property name="licensing.restriction.level" value="info"/> | ||
<property name="licensing.feature.version" value="13.4.1"/> | ||
<property name="licensing.feature.provider" value="Universe"/> | ||
<service> | ||
<provide interface="$packageName$.magic.service.PrinceToFrogMagic"/> | ||
</service> | ||
<reference bind="contractWithMagicForces" interface="$packageName$.magic.service.MagicForces" name="contractWithMagicForces"/> | ||
<implementation class="$packageName$.magic.service.EvilWitch"/> | ||
</scr:component> |
10 changes: 10 additions & 0 deletions
10
...templates/LicensedE4FullFeatherProduct/OSGI-INF/$packageName$.magic.service.GoodWitch.xml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="$packageName$.magic.service.GoodWitch"> | ||
<property name="licensing.feature.identifier" value="GoodWitch"/> | ||
<property name="licensing.restriction.level" value="fatal"/> | ||
<service> | ||
<provide interface="$packageName$.magic.service.FrogToPrinceMagic"/> | ||
</service> | ||
<reference bind="contractWithForces" interface="$packageName$.magic.service.MagicForces" name="contractWithForces"/> | ||
<implementation class="$packageName$.magic.service.GoodWitch"/> | ||
</scr:component> |
11 changes: 10 additions & 1 deletion
11
...4FullFeatherProduct/bin/Application.e4xmi → ...ullFeatherProduct/e4xmi/Application.e4xmi
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
40 changes: 40 additions & 0 deletions
40
...c.pde.ui.templates/templates/LicensedE4FullFeatherProduct/java/CreatureLabelProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package $packageName$; | ||
|
||
import org.eclipse.jface.viewers.ILabelProvider; | ||
import org.eclipse.jface.viewers.ILabelProviderListener; | ||
import $packageName$.magic.service.Creature; | ||
import org.eclipse.swt.graphics.Image; | ||
|
||
final class CreatureLabelProvider implements ILabelProvider { | ||
|
||
@Override | ||
public void addListener(ILabelProviderListener listener) { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public void removeListener(ILabelProviderListener listener) { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public void dispose() { | ||
// do nothing | ||
} | ||
|
||
@Override | ||
public boolean isLabelProperty(Object element, String property) { | ||
return false; // do nothing | ||
} | ||
|
||
@Override | ||
public Image getImage(Object element) { | ||
return null; // FIXME: ! | ||
} | ||
|
||
@Override | ||
public String getText(Object element) { | ||
return ((Creature) element).name(); | ||
} | ||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...de.ui.templates/templates/LicensedE4FullFeatherProduct/java/CreaturesContentProvider.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package $packageName$; | ||
|
||
import java.util.Comparator; | ||
import java.util.function.Predicate; | ||
import java.util.stream.Collectors; | ||
|
||
import org.eclipse.jface.viewers.IStructuredContentProvider; | ||
import $packageName$.magic.Creatures; | ||
import $packageName$.magic.service.Creature; | ||
import $packageName$.magic.service.Shape; | ||
|
||
final class CreaturesContentProvider implements IStructuredContentProvider { | ||
|
||
private final Predicate<Creature> shape; | ||
private final Comparator<Creature> comparator; | ||
|
||
CreaturesContentProvider(Shape shape) { | ||
this.shape = new Shape.Of(shape); | ||
this.comparator = (first, second) -> first.name().compareTo(second.name()); | ||
} | ||
|
||
@Override | ||
public Object[] getElements(Object input) { | ||
return ((Creatures) input).creatures().stream() // | ||
.filter(shape) // | ||
.sorted(comparator) // | ||
.collect(Collectors.toList()) // | ||
.toArray(); | ||
} | ||
|
||
} |
Oops, something went wrong.