Commit 012262b4 authored by Stefan Michel's avatar Stefan Michel

- methoden mit parametern werden im contextmenu auf disable gesetzt

- methoden mit Invisible annotation werden nicht im Contextmenu angezeigt
parent eb24344a
......@@ -109,11 +109,9 @@ public class MainViewCreationFX extends VBox {
}
private void setUpContextMenu(Class<?> hamsterClass) {
// lade klasse
List<Method> methods = new ArrayList(Arrays.asList(hamsterClass.getDeclaredMethods()));
// hamsterContextMenu
methods.forEach(method -> {
if (method.getAnnotation(Invisible.class) == null) {
String returnType = method.getReturnType().getSimpleName();
......@@ -130,8 +128,10 @@ public class MainViewCreationFX extends VBox {
}
result.append(")");
contextMenu.getItems().add(new MenuItem(result.toString()));
MenuItem menuItem = new MenuItem(result.toString());
if (method.getParameterCount() > 0)
menuItem.setDisable(true);
contextMenu.getItems().add(menuItem);
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment