use of com.kotcrab.vis.ui.widget.tabbedpane.TabbedPaneAdapter in project Eidolons by IDemiurge.
the class OptionsWindow method init.
private Table init() {
tabs = new Array<>();
TabbedPane optionsPane = new TabbedPane();
// tabs
add(optionsPane.getTable()).expandX().fillX().row();
// tab content
final Table content = new Table();
optionsPane.addListener(new TabbedPaneAdapter() {
@Override
public void switchedTab(Tab tab) {
content.clear();
content.add(tab.getContentTable()).expand().top().left();
}
});
for (OPTIONS_GROUP group : optionsMap.keySet()) {
OptionsTab tab = new OptionsTab(group);
tabs.add(tab);
optionsPane.add(tab);
}
optionsPane.switchTab(0);
Table bottomMenu = new Table();
bottomMenu.defaults().pad(4);
add(bottomMenu).expandX().left();
{
VisTextButton button = new VisTextButton("Ok");
addClickListener(button, this::ok);
bottomMenu.add(button);
}
{
VisTextButton button = new VisTextButton("Save");
addClickListener(button, this::save);
bottomMenu.add(button);
}
{
VisTextButton button = new VisTextButton("Apply");
addClickListener(button, this::apply);
bottomMenu.add(button);
}
{
VisTextButton button = new VisTextButton("Cancel");
addClickListener(button, this::cancel);
bottomMenu.add(button);
}
{
VisTextButton button = new VisTextButton("Defaults");
addClickListener(button, this::toDefaults);
bottomMenu.add(button);
}
return content;
}
Aggregations