30 lines
777 B
Java
30 lines
777 B
Java
|
package io.gitlab.jfronny.inceptum.gtk.menu;
|
||
|
|
||
|
import org.gtk.gio.*;
|
||
|
import org.jetbrains.annotations.NotNull;
|
||
|
import org.jetbrains.annotations.Nullable;
|
||
|
|
||
|
import java.util.Objects;
|
||
|
|
||
|
public abstract class BuiltMenuItem {
|
||
|
protected final SimpleAction action;
|
||
|
protected final MenuItem menuItem;
|
||
|
|
||
|
protected BuiltMenuItem(@NotNull SimpleAction action, @Nullable MenuItem menuItem) {
|
||
|
this.action = Objects.requireNonNull(action);
|
||
|
this.menuItem = menuItem;
|
||
|
}
|
||
|
|
||
|
public boolean getEnabled() {
|
||
|
return action.getEnabled();
|
||
|
}
|
||
|
|
||
|
public void setEnabled(boolean enabled) {
|
||
|
action.enabled = enabled;
|
||
|
}
|
||
|
|
||
|
public void setIconName(String iconName) {
|
||
|
Objects.requireNonNull(menuItem).icon = new ThemedIcon(iconName);
|
||
|
}
|
||
|
}
|