Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
OpenCms is an enterprise-ready, easy to use website content management system based on Java and XML technology. Offering a complete set of features, OpenCms helps content managers worldwide to create and maintain beautiful websites fast and efficiently.
/*
* This library is part of OpenCms -
* the Open Source Content Management System
*
* Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* For further information about Alkacon Software, please see the
* company website: http://www.alkacon.com
*
* For further information about OpenCms, please see the
* project website: http://www.opencms.org
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.opencms.ui.dataview;
import org.opencms.ui.CmsVaadinUtils;
import org.opencms.ui.components.OpenCmsTheme;
import org.opencms.ui.dataview.CmsPagingControls.I_PagingCallback;
import org.opencms.ui.util.CmsComponentField;
import org.opencms.widgets.dataview.CmsDataViewColumn;
import org.opencms.widgets.dataview.CmsDataViewFilter;
import org.opencms.widgets.dataview.CmsDataViewQuery;
import org.opencms.widgets.dataview.CmsDataViewResult;
import org.opencms.widgets.dataview.I_CmsDataView;
import org.opencms.widgets.dataview.I_CmsDataViewItem;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.vaadin.data.Item;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
/**
* Panel containing both the interface elements used to search the data source (query field, filter select boxes) as well
* as the paged list of search results.
*/
public class CmsDataViewPanel extends VerticalLayout {
/**
* Subclass of Table, which we need because we want to trigger a complete refresh when sorting instead of just sorting the in-memory data.
*/
public class PagedTable extends Table {
/** Serial version id. */
private static final long serialVersionUID = 1L;
/**
* Creates a new instance.
*
* @param container the data container
*/
public PagedTable(IndexedContainer container) {
super();
setContainerDataSource(container);
}
/**
* @see com.vaadin.ui.Table#sort(java.lang.Object[], boolean[])
*/
@Override
public void sort(Object[] propertyId, boolean[] ascending) throws UnsupportedOperationException {
m_sortCol = propertyId[0];
m_ascending = ascending[0];
refreshData(true, null);
}
}
/** Serial version id. */
private static final long serialVersionUID = 1L;
/** The ID column name. */
public static final Object ID_COLUMN = new Object();
/** The data view instance used to access the data. */
private I_CmsDataView m_dataView;
/** Search button. */
private Button m_searchButton;
/** The container used to store the current page of search results. */
private IndexedContainer m_container;
/** Widget used to move to different pages. */
private CmsPagingControls m_pagingControls;
/** The table container. */
private CssLayout m_tablePlaceholder;
/** The widget containing the filters. */
private HorizontalLayout m_filterContainer;
/** Query text field. */
private TextField m_fullTextSearch;
/** The sort column. */
protected Object m_sortCol;
/** The sort direction. */
protected boolean m_ascending;
/** The current list of filters. */
private List m_filters = Lists.newArrayList();
/** Map of check boxes. */
private Map