Search in sources :

Example 1 with File

use of org.openide.filesystems.annotations.LayerBuilder.File in project blue by kunstmusik.

the class ScoreMouseListenerPluginProcessor method handleProcess.

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

Example 2 with File

use of org.openide.filesystems.annotations.LayerBuilder.File in project blue by kunstmusik.

the class InstrumentEditorPluginProcessor method handleProcess.

@Override
protected boolean handleProcess(Set<? extends TypeElement> set, RoundEnvironment env) throws LayerGenerationException {
    Elements elements = processingEnv.getElementUtils();
    for (Element e : env.getElementsAnnotatedWith(InstrumentEditorPlugin.class)) {
        TypeElement clazz = (TypeElement) e;
        InstrumentEditorPlugin instrumentEditorPlugin = clazz.getAnnotation(InstrumentEditorPlugin.class);
        String teName = elements.getBinaryName(clazz).toString();
        File f = layer(e).file("blue/instrumentEditors/" + teName.replace('.', '-') + ".instance");
        TypeMirror tm = null;
        try {
            instrumentEditorPlugin.instrumentType();
        } catch (MirroredTypeException mte) {
            tm = mte.getTypeMirror();
        }
        f.stringvalue("instrumentType", tm.toString());
        f.write();
    }
    return true;
}
Also used : MirroredTypeException(javax.lang.model.type.MirroredTypeException) InstrumentEditorPlugin(blue.plugin.InstrumentEditorPlugin) TypeMirror(javax.lang.model.type.TypeMirror) TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) File(org.openide.filesystems.annotations.LayerBuilder.File)

Example 3 with File

use of org.openide.filesystems.annotations.LayerBuilder.File in project blue by kunstmusik.

the class NoteProcessorPluginProcessor method handleProcess.

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

Example 4 with File

use of org.openide.filesystems.annotations.LayerBuilder.File in project blue by kunstmusik.

the class ScoreObjectEditorPluginProcessor method handleProcess.

@Override
protected boolean handleProcess(Set<? extends TypeElement> set, RoundEnvironment env) throws LayerGenerationException {
    Elements elements = processingEnv.getElementUtils();
    for (Element e : env.getElementsAnnotatedWith(ScoreObjectEditorPlugin.class)) {
        TypeElement clazz = (TypeElement) e;
        String teName = elements.getBinaryName(clazz).toString();
        ScoreObjectEditorPlugin instrumentEditorPlugin = clazz.getAnnotation(ScoreObjectEditorPlugin.class);
        File f = layer(e).file("blue/score/objectEditors/" + teName.replace('.', '-') + ".instance");
        TypeMirror tm = null;
        try {
            instrumentEditorPlugin.scoreObjectType();
        } catch (MirroredTypeException mte) {
            tm = mte.getTypeMirror();
        }
        f.stringvalue("scoreObjectType", tm.toString());
        f.write();
    }
    return true;
}
Also used : MirroredTypeException(javax.lang.model.type.MirroredTypeException) TypeMirror(javax.lang.model.type.TypeMirror) TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) ScoreObjectEditorPlugin(blue.plugin.ScoreObjectEditorPlugin) File(org.openide.filesystems.annotations.LayerBuilder.File)

Example 5 with File

use of org.openide.filesystems.annotations.LayerBuilder.File in project blue by kunstmusik.

the class BarRendererPluginProcessor method handleProcess.

@Override
protected boolean handleProcess(Set<? extends TypeElement> set, RoundEnvironment env) throws LayerGenerationException {
    Elements elements = processingEnv.getElementUtils();
    for (Element e : env.getElementsAnnotatedWith(BarRendererPlugin.class)) {
        TypeElement clazz = (TypeElement) e;
        String teName = elements.getBinaryName(clazz).toString();
        BarRendererPlugin barRendererPlugin = clazz.getAnnotation(BarRendererPlugin.class);
        File f = layer(e).file("blue/score/barRenderers/" + teName.replace('.', '-') + ".instance");
        TypeMirror tm = null;
        try {
            barRendererPlugin.scoreObjectType();
        } catch (MirroredTypeException mte) {
            tm = mte.getTypeMirror();
        }
        f.stringvalue("scoreObjectType", tm.toString());
        f.write();
    }
    return true;
}
Also used : BarRendererPlugin(blue.plugin.BarRendererPlugin) MirroredTypeException(javax.lang.model.type.MirroredTypeException) TypeMirror(javax.lang.model.type.TypeMirror) TypeElement(javax.lang.model.element.TypeElement) Element(javax.lang.model.element.Element) TypeElement(javax.lang.model.element.TypeElement) Elements(javax.lang.model.util.Elements) File(org.openide.filesystems.annotations.LayerBuilder.File)

Aggregations

Element (javax.lang.model.element.Element)9 TypeElement (javax.lang.model.element.TypeElement)9 Elements (javax.lang.model.util.Elements)9 File (org.openide.filesystems.annotations.LayerBuilder.File)9 MirroredTypeException (javax.lang.model.type.MirroredTypeException)3 TypeMirror (javax.lang.model.type.TypeMirror)3 BarRendererPlugin (blue.plugin.BarRendererPlugin)1 InstrumentEditorPlugin (blue.plugin.InstrumentEditorPlugin)1 InstrumentPlugin (blue.plugin.InstrumentPlugin)1 NoteProcessorPlugin (blue.plugin.NoteProcessorPlugin)1 ProjectPluginEditorItem (blue.plugin.ProjectPluginEditorItem)1 ProjectPluginItem (blue.plugin.ProjectPluginItem)1 ScoreMouseListenerPlugin (blue.plugin.ScoreMouseListenerPlugin)1 ScoreObjectEditorPlugin (blue.plugin.ScoreObjectEditorPlugin)1 SoundObjectPlugin (blue.plugin.SoundObjectPlugin)1