use of com.haulmont.cuba.gui.screen.Install in project cuba by cuba-platform.
the class UiControllerReflectionInspector method getAnnotatedInstallMethodsNotCached.
protected List<AnnotatedMethod<Install>> getAnnotatedInstallMethodsNotCached(@SuppressWarnings("unused") Class<?> clazz, Method[] uniqueDeclaredMethods) {
MethodHandles.Lookup lookup = MethodHandles.lookup();
List<AnnotatedMethod<Install>> annotatedMethods = new ArrayList<>();
for (Method m : uniqueDeclaredMethods) {
Install installAnnotation = findMergedAnnotation(m, Install.class);
if (installAnnotation != null) {
if (!m.isAccessible()) {
m.setAccessible(true);
}
MethodHandle methodHandle;
try {
methodHandle = lookup.unreflect(m);
} catch (IllegalAccessException e) {
throw new RuntimeException("unable to get method handle " + m);
}
annotatedMethods.add(new AnnotatedMethod<>(installAnnotation, m, methodHandle));
}
}
return ImmutableList.copyOf(annotatedMethods);
}
use of com.haulmont.cuba.gui.screen.Install in project cuba by cuba-platform.
the class SourceCodeEditorScreenTest method sourceCodeEditorSuggester.
@Install(to = "sourceCodeEditor", subject = "suggester")
private List<Suggestion> sourceCodeEditorSuggester(AutoCompleteSupport source, String text, int cursorPosition) {
List<String> options = Arrays.asList("___");
List<Suggestion> suggestions = new ArrayList<>();
for (String item : options) {
suggestions.add(new Suggestion(source, item, item, null, startPosition, endPosition));
}
return suggestions;
}
Aggregations