package org.gcube.portlets.widgets.ckancontentmoderator.client; import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.MainPanel; import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.util.ExtModal; import com.github.gwtbootstrap.client.ui.Modal; import com.google.gwt.user.client.ui.Composite; /** * The Class CkanContentModeratorWidget. * * @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it * * Apr 7, 2022 */ public class CkanContentModeratorWidget { // private VerticalPanel baseVP = new VerticalPanel(); private MainPanel mainPanel = new MainPanel(); private CheckConfigsUxController ccux; /** * Instantiates a new ckan content moderator widget. */ public CkanContentModeratorWidget() { mainPanel.setWidth("100%"); ccux = new CheckConfigsUxController(mainPanel, null); boolean iamModerator = false; try { iamModerator = ccux.getModeratorCheckConfig().isModeratorRoleAssigned(); } catch (Exception e) { } if (iamModerator) { mainPanel.setLoggedLabelText("Logged in as Moderator"); } } /** * Show as modal. */ public void showAsModal(String modalTitle) { final Modal modal = new ExtModal(true, true); modalTitle = modalTitle == null || modalTitle.isEmpty() ? "Manage Items" : modalTitle; modal.setTitle(modalTitle); modal.setWidth(1200); modal.getElement().addClassName("modal-content-moderator"); // modal.getElement().getStyle().setProperty("min-height", "500px"); modal.add(mainPanel); modal.setCloseVisible(true); modal.show(); } /** * Gets the panel. * * @return the panel */ public Composite getPanel() { return mainPanel; } public CkanContentModeratorCheckConfigs getCongifs() { return ccux.getModeratorCheckConfig(); } }