class PropertyEditorHelper {

    static void createCategory(final PropertyEditorWidget propertyEditorWidget,
                               final PanelGroup propertyMenu,
                               final PropertyEditorCategory category,
                               final String propertyNameFilter) {

        Panel panel = GWT.create(Panel.class);
        PanelCollapse panelCollapse = createPanelCollapse(propertyEditorWidget,
                                                          category);
        PanelHeader headerPanel = createPanelHeader(category,
                                                    propertyMenu,
                                                    panelCollapse);
        PanelBody panelBody = createPanelBody();
        Form form = createPanelContent(panelBody);

        boolean categoryHasActiveChilds = false;
        for (final PropertyEditorFieldInfo field : category.getFields()) {
            if (isAMatchOfFilter(propertyNameFilter,
                                 field)) {
                categoryHasActiveChilds = true;
                form.add(createItemsWidget(field,
                                           category,
                                           form));
            }
        }
        if (categoryHasActiveChilds) {
            panelCollapse.add(panelBody);
            panel.add(headerPanel);
            panel.add(panelCollapse);
            propertyMenu.add(panel);
        }
    }

}