ItEr32S12CUAsignacionGrupoRecursosAPlanificacionItEr31S15: Adding support for hiding a menu button
This commit is contained in:
parent
2958015c2c
commit
2d6c7bee73
3 changed files with 15 additions and 0 deletions
|
|
@ -64,6 +64,12 @@ public class TabsRegistry {
|
|||
}
|
||||
}
|
||||
|
||||
public void toggleVisibilityTo(ITab tab, boolean visible) {
|
||||
if (fromTabToMenuKey.containsKey(tab)) {
|
||||
menu.toggleVisibilityTo(fromTabToMenuKey.get(tab), visible);
|
||||
}
|
||||
}
|
||||
|
||||
private void activateMenuIfRegistered(ITab tab) {
|
||||
if (fromTabToMenuKey.containsKey(tab)) {
|
||||
menu.activateMenuItem(fromTabToMenuKey.get(tab));
|
||||
|
|
|
|||
|
|
@ -32,4 +32,6 @@ public interface IMenuItemsRegister {
|
|||
|
||||
public void renameMenuItem(Object key, String name);
|
||||
|
||||
public void toggleVisibilityTo(Object key, boolean visible);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,6 +235,13 @@ public class CustomMenuController extends Div implements IMenuItemsRegister {
|
|||
button.setLabel(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toggleVisibilityTo(Object key, boolean visible) {
|
||||
Button button = (Button) key;
|
||||
button.setVisible(visible);
|
||||
button.getNextSibling().setVisible(visible);
|
||||
}
|
||||
|
||||
private void setSelectClass(final Button button) {
|
||||
button.setSclass("sub_menu_active");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue