Пример #1
0
 private void addBind(Name moduleName, Class<?> event, String id) {
   List<Input> defaultInputs = Lists.newArrayList();
   for (Annotation annotation : event.getAnnotationsByType(DefaultBinding.class)) {
     DefaultBinding defaultBinding = (DefaultBinding) annotation;
     Input input = defaultBinding.type().getInput(defaultBinding.id());
     if (!data.values().contains(input)) {
       defaultInputs.add(input);
     }
   }
   SimpleUri bindUri = new SimpleUri(moduleName, id);
   setBinds(bindUri, defaultInputs);
 }
Пример #2
0
 private void addBind(Name moduleName, Class<?> buttonEvent, RegisterBindButton info) {
   List<Input> defaultInputs = Lists.newArrayList();
   for (Annotation annotation : buttonEvent.getAnnotations()) {
     if (annotation instanceof DefaultBinding) {
       DefaultBinding defaultBinding = (DefaultBinding) annotation;
       Input input = defaultBinding.type().getInput(defaultBinding.id());
       if (!data.values().contains(input)) {
         defaultInputs.add(input);
       }
     }
   }
   SimpleUri bindUri = new SimpleUri(moduleName, info.id());
   setBinds(bindUri, defaultInputs.toArray(new Input[defaultInputs.size()]));
 }