Speeded up the open
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-open-widget@93530 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
eac20f7808
commit
12a91b9740
|
@ -24,5 +24,6 @@ public interface TabResourcesProperties extends PropertyAccess<TabResource> {
|
|||
ValueProvider<TabResource, String> name();
|
||||
ValueProvider<TabResource, String> agency();
|
||||
ValueProvider<TabResource, String> date();
|
||||
ValueProvider<TabResource, String> tabularResourceType();
|
||||
|
||||
}
|
||||
|
|
|
@ -63,9 +63,10 @@ public class TabResourcesSelectionPanel extends ContentPanel implements HasSelec
|
|||
|
||||
private static final TabResourcesProperties properties = GWT.create(TabResourcesProperties.class);
|
||||
|
||||
protected static final ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(properties.name(), 50, "Name");
|
||||
protected static final ColumnConfig<TabResource, String> agencyColumn = new ColumnConfig<TabResource, String>(properties.agency(), 50, "Agency");
|
||||
protected static final ColumnConfig<TabResource, String> dateColumn = new ColumnConfig<TabResource, String>(properties.date(), 50, "Date");
|
||||
protected static final ColumnConfig<TabResource, String> nameColumn = new ColumnConfig<TabResource, String>(properties.name(), 90, "Name");
|
||||
protected static final ColumnConfig<TabResource, String> typeColumn = new ColumnConfig<TabResource, String>(properties.tabularResourceType(), 30, "Type");
|
||||
protected static final ColumnConfig<TabResource, String> agencyColumn = new ColumnConfig<TabResource, String>(properties.agency(), 60, "Agency");
|
||||
protected static final ColumnConfig<TabResource, String> dateColumn = new ColumnConfig<TabResource, String>(properties.date(), 40, "Date");
|
||||
|
||||
|
||||
|
||||
|
@ -73,13 +74,13 @@ public class TabResourcesSelectionPanel extends ContentPanel implements HasSelec
|
|||
protected ResourceBundle res;
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
public TabResourcesSelectionPanel(ResourceBundle res)
|
||||
{
|
||||
this.res=res;
|
||||
setHeaderVisible(false);
|
||||
new Resizable(this, Dir.E, Dir.SE, Dir.S);
|
||||
buildPanel(properties.id(), Arrays.<ColumnConfig<TabResource, ?>>asList(nameColumn, agencyColumn, dateColumn), nameColumn);
|
||||
buildPanel(properties.id(), Arrays.<ColumnConfig<TabResource, ?>>asList(nameColumn, typeColumn, agencyColumn, dateColumn), nameColumn);
|
||||
}
|
||||
|
||||
|
||||
|
@ -178,6 +179,7 @@ public class TabResourcesSelectionPanel extends ContentPanel implements HasSelec
|
|||
|
||||
protected boolean select(TabResource item, String searchTerm) {
|
||||
if (item.getName()!=null && item.getName().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getTabularResourceType()!=null &&item.getTabularResourceType().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getAgency()!=null &&item.getAgency().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
if (item.getDate()!=null && item.getDate().toLowerCase().contains(searchTerm.toLowerCase())) return true;
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue