widget.setWidgetPropertiesPanel(propertiesPanel);
}
ts.addTab(widget.getWidgetPropertiesPanel(), messages.getMessage("form.properties"));
}
if (widget.hasPermissions()) {
PermissionEditor permissionEditor = new PermissionEditor();
permissionEditor.setMargin(true);
permissionEditor.setProvider(new PermissionProvider() {
@Override
public Collection<Permission> getPermissions() {
return new LinkedHashSet<Permission>(widget.getPermissions());
}
@Override
public Collection<PermissionDefinition> getPermissionDefinitions() {
return widget.getPermissionDefinitions();
}
@Override
public boolean isNewPermissionDefinitionAllowed() {
return false;
}
@Override
public void addPermission(Permission permission) {
Set<Permission> newPermissions = new LinkedHashSet<Permission>(widget.getPermissions());
newPermissions.add(permission);
widget.setPermissions(new ArrayList<Permission>(newPermissions));
}
@Override
public void removePermission(Permission permission) {
Set<Permission> newPermissions = new LinkedHashSet<Permission>(widget.getPermissions());
newPermissions.remove(permission);
widget.setPermissions(new ArrayList<Permission>(newPermissions));
}
});
permissionEditor.loadData();
ts.addTab(permissionEditor, messages.getMessage("form.permissions"));
}
layout.addComponent(ts);
}