// When a panel is maximized in region, only show it.
for (int i = 0; i < allPanels.length; i++) {
Panel panel = allPanels[i];
PanelSession status = SessionManager.getPanelSession(panel);
if (status.isMaximizedInRegion()) {
PanelPermission viewPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_VIEW);
boolean canViewPanel = getUserStatus().hasPermission( viewPerm);
if (canViewPanel) {
panels.add(panel);
onlyOnePanel = true;
break;
}
}
}
if (!onlyOnePanel)
for (int i = 0; i < allPanels.length; i++) {
Panel panel = allPanels[i];
PanelPermission viewPerm = PanelPermission.newInstance(panel, PanelPermission.ACTION_VIEW);
boolean canViewPanel = getUserStatus().hasPermission( viewPerm);
if (canViewPanel) {
panels.add(panel);
}
}