Search in sources :

Example 1 with InstrumentPlugin

use of blue.plugin.InstrumentPlugin in project blue by kunstmusik.

the class InstrumentPluginProcessor method handleProcess.

@Override
protected boolean handleProcess(Set<? extends TypeElement> set, RoundEnvironment env) throws LayerGenerationException {
    Elements elements = processingEnv.getElementUtils();
    for (Element e : env.getElementsAnnotatedWith(InstrumentPlugin.class)) {
        TypeElement clazz = (TypeElement) e;
        InstrumentPlugin noteProcessorPlugin = clazz.getAnnotation(InstrumentPlugin.class);
        String teName = elements.getBinaryName(clazz).toString();
        File f = layer(e).file("blue/instruments/" + teName.replace('.', '-') + ".instance").intvalue("position", noteProcessorPlugin.position()).bundlevalue("displayName", noteProcessorPlugin.displayName());
        f.write();
    }
    return true;
}
Also used : TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) InstrumentPlugin(blue.plugin.InstrumentPlugin) File(org.openide.filesystems.annotations.LayerBuilder.File)

Aggregations

InstrumentPlugin (blue.plugin.InstrumentPlugin)1 Element (javax.lang.model.element.Element)1 TypeElement (javax.lang.model.element.TypeElement)1 Elements (javax.lang.model.util.Elements)1 File (org.openide.filesystems.annotations.LayerBuilder.File)1