protected Panel createGeneralConfigPanel() {
final Checkbox isControllingPortletCheckbox = new Checkbox("Set as controlling portlet (the controlling portlet sets the selection for the entire tab)");
isControllingPortletCheckbox.setChecked(isControllingPortlet());
Panel generalPanel = new AbstractValidatableTab() {
@Override
public void onSave() {
if (isControllingPortletCheckbox.getValue()) { //true - is checked
setAsControllingPortlet();
}
else {
if (isControllingPortlet()) {
AbstractTab tab = getTab();
if (tab == null) {
return;
}
tab.setControllingPortlet(null);
}
}
}
@Override
public boolean isValid() {
return true;
}
};
generalPanel.setTitle("General");
generalPanel.setPaddings(10);
generalPanel.add(isControllingPortletCheckbox, new AnchorLayoutData("100%"));
return generalPanel;
}