Creates a resource list panel.<p>

@param caption the caption to use
@param resourceInfo the resource-infos
@return the panel
322443
protected Panel createResourceListPanelDirectly(String caption, List<CmsResourceInfo> resourceInfo) {

        Panel result = new Panel(caption);
        result.addStyleName("v-scrollable");
        result.setSizeFull();
        VerticalLayout resourcePanel = new VerticalLayout();
        result.setContent(resourcePanel);
        resourcePanel.addStyleName(OpenCmsTheme.REDUCED_MARGIN);
        resourcePanel.addStyleName(OpenCmsTheme.REDUCED_SPACING);
        resourcePanel.setSpacing(true);
        resourcePanel.setMargin(true);
        for (CmsResourceInfo resource : resourceInfo) {
            resourcePanel.addComponent(resource);
        }
        return result;
    }
704564
public void setContentToDialog(String caption, Component component) {

        setContent(new Label());
        Window window = CmsBasicDialog.prepareWindow(DialogWidth.narrow);
        CmsBasicDialog dialog = new CmsBasicDialog();
        VerticalLayout result = new VerticalLayout();
        dialog.setContent(result);
        window.setContent(dialog);
        window.setCaption(caption);
        window.setClosable(false);
        addWindow(window);
        window.center();
        if (component instanceof I_CmsHasButtons) {
            I_CmsHasButtons hasButtons = (I_CmsHasButtons)component;
            for (Button button : hasButtons.getButtons()) {
                dialog.addButton(button);
            }

        }
        result.addComponent(component);

    }
803804
@Override
    public Object createResource(ResourceInfo info) throws Exception {
        Properties propertyNames = createPropertyNames();
        Properties props = createProperties(propertyNames);

        // The listOfPropMap is how the nested properties (name, value pairs) are
        // pulled from the Nester class. This iterates the map and stores them in the
        // props object
        if (listOfPropMap != null)
        {
            for (Map<String, Object> nestedProperties : listOfPropMap)
            {
                props.put(nestedProperties.get(NAME), nestedProperties.get(VALUE));
            }
        }

        Session session = createSession(props);

        return session;
    }
940713
public List<String> getResources() {

        List<String> res = new ArrayList<String>();
        for (I_CmsEditableGroupRow row : m_resourcesGroup.getRows()) {
            res.add(((CmsPathSelectField)row.getComponent()).getValue());
        }
        return res;
    }
988380
public void initContent(CmsResourceStatusBean status) {

        m_statusBean = status;
        m_panel.clear();
        m_scrollPanels.clear();

        // wrap list info item in another panel to achieve layout uniformity with other similar widgets
        SimplePanel infoBoxPanel = new SimplePanel();
        infoBoxPanel.getElement().getStyle().setMarginTop(2, Style.Unit.PX);
        CmsListItemWidget infoWidget = new CmsListItemWidget(status.getListInfo());
        infoWidget.addOpenHandler(new OpenHandler<CmsListItemWidget>() {

            public void onOpen(OpenEvent<CmsListItemWidget> event) {

                CmsDomUtil.resizeAncestor(getParent());
            }
        });
        infoWidget.addCloseHandler(new CloseHandler<CmsListItemWidget>() {

            public void onClose(CloseEvent<CmsListItemWidget> event) {

                CmsDomUtil.resizeAncestor(getParent());
            }
        });
        CmsContextMenuButton menuButton = new CmsContextMenuButton(
            status.getStructureId(),
            m_menuHandler,
            AdeContext.resourceinfo);
        menuButton.addStyleName(I_CmsLayoutBundle.INSTANCE.listItemWidgetCss().permaVisible());
        infoWidget.addButton(menuButton);
        m_panel.add(infoBoxPanel);
        infoBoxPanel.add(infoWidget);
        m_list = createList(getLegend());
        fill();
    }
857961
public CmsResource createFolder(CmsObject cms) throws CmsException {

        if (m_folder != null) {
            return m_folder;
        }
        return cms.createResource(
            m_path,
            OpenCms.getResourceManager().getResourceType(CmsResourceTypeFolder.RESOURCE_TYPE_NAME).getTypeId());
    }
802425
public static void showPreviewForResource(CmsPreviewInfo previewInfo) {

        if (previewInfo.isNewWindowRequired()) {
            CmsDomUtil.openWindow(previewInfo.getPreviewUrl(), CmsDomUtil.Target.BLANK.getRepresentation(), "");
        } else {

            CmsPreviewDialog dialog = createPreviewDialog(previewInfo);
            dialog.center();
        }
    }
19065
public ContextMenuItem addItem(String caption) {

        ContextMenuItemState itemState = getState().addChild(caption, getNextId());

        ContextMenuItem item = new ContextMenuItem(null, itemState);
        m_items.put(itemState.getId(), item);

        return item;
    }
81658
public static IndexedContainer buildContainerFromMap(String captionProperty, Map<String, String> map) {

        IndexedContainer container = new IndexedContainer();
        for (Map.Entry<String, String> entry : map.entrySet()) {
            container.addItem(entry.getKey()).getItemProperty(captionProperty).setValue(entry.getValue());
        }
        return container;
    }
1282180
public static CmsResourceInfo getJobInfo(String name, String className) {

        return new CmsResourceInfo(name, className, new CmsCssIcon(OpenCmsTheme.ICON_JOB));
    }
1280129
public static Resource getSitemapResourceIcon(CmsObject cms, CmsResource resource, IconMode iconMode) {

        CmsResource defaultFile = null;
        List<CmsResource> resourcesForType = Lists.newArrayList();
        resourcesForType.add(resource);
        boolean skipDefaultFile = (iconMode == IconMode.sitemapSelect)
            && OpenCms.getResourceManager().matchResourceType(
                CmsResourceTypeFolderSubSitemap.TYPE_SUBSITEMAP,
                resource.getTypeId());
        if (resource.isFolder() && !skipDefaultFile) {

            try {
                defaultFile = cms.readDefaultFile(resource, CmsResourceFilter.IGNORE_EXPIRATION);
                if (defaultFile != null) {
                    resourcesForType.add(0, defaultFile);
                }
            } catch (Exception e) {
                // Shouldn't normally happen - readDefaultFile returns null instead of throwing an exception when it doesn't find a default file
            }
        }
        if (CmsJspNavBuilder.isNavLevelFolder(cms, resource)) {
            return new CmsCssIcon(CmsExplorerTypeSettings.ICON_STYLE_NAV_LEVEL_BIG);
        }
        CmsResource maybePage = resourcesForType.get(0);
        if (CmsResourceTypeXmlContainerPage.isContainerPage(maybePage)) {
            CmsADEConfigData config = OpenCms.getADEManager().lookupConfiguration(cms, maybePage.getRootPath());
            for (CmsDetailPageInfo realInfo : config.getAllDetailPages(true)) {
                if (realInfo.getUri().equals(maybePage.getRootPath())
                    || realInfo.getUri().equals(CmsResource.getParentFolder(maybePage.getRootPath()))) {
                    CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                        realInfo.getIconType());
                    if (settings != null) {
                        return CmsResourceUtil.getBigIconResource(settings, resource.getName());
                    }
                }
            }
        }

        Resource result = null;
        for (CmsResource res : resourcesForType) {
            I_CmsResourceType type = OpenCms.getResourceManager().getResourceType(res);
            CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type.getTypeName());
            if (settings != null) {
                result = CmsResourceUtil.getBigIconResource(settings, res.getName());
                break;
            }
        }
        return result;
    }
424418
private IndexedContainer getStartViewContainer(String caption) {

        List<I_CmsWorkplaceAppConfiguration> apps = OpenCms.getWorkplaceAppManager().getDefaultQuickLaunchConfigurations();

        IndexedContainer res = new IndexedContainer();

        res.addContainerProperty(caption, String.class, "");

        for (I_CmsWorkplaceAppConfiguration app : apps) {
            if (hasRoleForApp(app)) {
                Item item = res.addItem(app.getId());
                item.getItemProperty(caption).setValue(app.getName(A_CmsUI.get().getLocale()));
            }
        }
        return res;
    }
869652
public java.util.List<CaptionFormat> getCaptionFormats() {
        if (captionFormats == null) {
            captionFormats = new com.amazonaws.internal.SdkInternalList<CaptionFormat>();
        }
        return captionFormats;
    }
1224135
@SuppressWarnings("deprecation")
    CmsResourceInfo formatResourceType(I_CmsResourceType type) {

        CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(type.getTypeName());
        Resource icon;
        String title;
        String subtitle;
        if (settings != null) {
            icon = CmsResourceUtil.getBigIconResource(settings, null);
            title = CmsVaadinUtils.getMessageText(settings.getKey());
            if (title.startsWith("???")) {
                title = type.getTypeName();
            }
            subtitle = type.getTypeName()
                + " (ID: "
                + type.getTypeId()
                + (settings.getReference() != null ? (", " + settings.getReference()) : "")
                + ")";
        } else {
            icon = CmsResourceUtil.getBigIconResource(
                OpenCms.getWorkplaceManager().getExplorerTypeSetting("unknown"),
                null);
            title = type.getTypeName();
            subtitle = type.getTypeName() + " (ID: " + type.getTypeId() + ")";
        }
        CmsResourceInfo info = new CmsResourceInfo(title, subtitle, icon);
        return info;
    }
1369101
public void loadResourceInfo(final String resourcePath) {

        CmsRpcAction<CmsResourceInfoBean> action = new CmsRpcAction<CmsResourceInfoBean>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                getService().getResourceInfo(resourcePath, getLocale(), this);
            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(CmsResourceInfoBean result) {

                showData(result);
            }
        };
        action.execute();
    }
580437
public static List<CmsContainerElementBean> loadInheritContainerElements(CmsObject cms, CmsResource resource) {

        CmsInheritanceReferenceParser parser = new CmsInheritanceReferenceParser(cms);
        try {
            parser.parse(resource);
            CmsInheritanceReference ref = parser.getReference(cms.getRequestContext().getLocale());
            if (ref != null) {
                String name = ref.getName();
                CmsADEManager adeManager = OpenCms.getADEManager();
                CmsInheritedContainerState result = adeManager.getInheritedContainerState(
                    cms,
                    cms.getRequestContext().getRootUri(),
                    name);
                return result.getElements(false);
            }
        } catch (CmsException e) {
            LOG.error(e.getLocalizedMessage(), e);
        }
        return Collections.emptyList();
    }
890933
protected void initContent(CmsLockReportInfo reportInfo) {

        FlowPanel content = new FlowPanel();

        m_resourceItem = new CmsListItemWidget(reportInfo.getResourceInfo());
        HeightHandler heightHandler = new HeightHandler();
        m_resourceItem.addOpenHandler(heightHandler);
        m_resourceItem.addCloseHandler(heightHandler);
        content.add(m_resourceItem);
        m_scrollPanel = new FlowPanel();
        m_scrollPanel.setStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().border());
        m_scrollPanel.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
        m_scrollPanel.addStyleName(I_CmsLayoutBundle.INSTANCE.dialogCss().logReportScrollPanel());
        CmsList<CmsListItem> list = null;
        CmsMessageWidget message = new CmsMessageWidget();
        m_scrollPanel.add(message);
        message.setMessageText(
            getMessageForLock(
                reportInfo.getResourceInfo().getLockIcon(),
                !reportInfo.getLockedResourceInfos().isEmpty()));
        if (!reportInfo.getLockedResourceInfos().isEmpty()
            || ((reportInfo.getResourceInfo().getLockIcon() != null)
                && (reportInfo.getResourceInfo().getLockIcon() != LockIcon.NONE))) {
            m_unlockButton.setVisible(true);
        }
        // only show the unlock button if the resource or a descending resource is locked
        if (!reportInfo.getLockedResourceInfos().isEmpty()) {
            m_unlockButton.setText(Messages.get().key(Messages.GUI_UNLOCK_ALL_0));
            list = new CmsList<CmsListItem>();
            for (CmsListInfoBean lockedInfo : reportInfo.getLockedResourceInfos()) {
                CmsListItemWidget listItemWidget = new CmsListItemWidget(lockedInfo);
                listItemWidget.addOpenHandler(heightHandler);
                listItemWidget.addCloseHandler(heightHandler);
                list.addItem(new CmsListItem(listItemWidget));
            }
            m_scrollPanel.add(list);
        }

        content.add(m_scrollPanel);
        setMainContent(content);
        if (isShowing()) {
            m_resourceItem.truncate(TEXT_METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 10);
            if (list != null) {
                list.truncate(TEXT_METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 10);
            }
            adjustHeight();
        }
    }