task_21363 #1
|
@ -1,8 +1,16 @@
|
||||||
package org.gcube.portlets.widgets.ckancontentmoderator.client;
|
package org.gcube.portlets.widgets.ckancontentmoderator.client;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.CheckBoxSelectIemsEvent;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.CheckBoxSelectIemsEventHandler;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ClickItemEvent;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ClickItemEvent;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ClickItemEventHandler;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ClickItemEventHandler;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ShowItemEvent;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ShowItemEventHandler;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.TableRangeViewChangedEvent;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.TableRangeViewChangedEventHandler;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.CkanFramePanel;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.CkanFramePanel;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.ContentModeratorPaginatedView;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.ContentModeratorPaginatedView;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.ContentModeratorToolbar;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.ContentModeratorToolbar;
|
||||||
|
@ -42,7 +50,7 @@ public class CkanContentModeratorWidgetController {
|
||||||
/**
|
/**
|
||||||
* Instantiates a new ckan content moderator widget.
|
* Instantiates a new ckan content moderator widget.
|
||||||
*
|
*
|
||||||
* @param status the status
|
* @param status the status
|
||||||
* @param displayFields the display fields
|
* @param displayFields the display fields
|
||||||
* @param sortByField the sort by field
|
* @param sortByField the sort by field
|
||||||
*/
|
*/
|
||||||
|
@ -66,14 +74,49 @@ public class CkanContentModeratorWidgetController {
|
||||||
@Override
|
@Override
|
||||||
public <T> void onClick(ClickItemEvent<T> clickItemEvent) {
|
public <T> void onClick(ClickItemEvent<T> clickItemEvent) {
|
||||||
|
|
||||||
if (clickItemEvent.getItem() instanceof CatalogueDataset) {
|
if (clickItemEvent.getSelectItems() != null) {
|
||||||
CatalogueDataset clickedDataset = (CatalogueDataset) clickItemEvent.getItem();
|
List<T> items = clickItemEvent.getSelectItems();
|
||||||
CkanFramePanel cfp = new CkanFramePanel(eventBus);
|
// if items selected are > 0 then shows button "Update status as.."
|
||||||
cfp.instanceFrame(clickedDataset.getUrl(), null);
|
howeView.setVisibleUpdateStatusAction(items.size() > 0);
|
||||||
mainTabPanel.addTab(clickedDataset.getName(), cfp);
|
|
||||||
// Window.open(clickedDataset.getUrl(), null, "_blank");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(ShowItemEvent.TYPE, new ShowItemEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void onShowItemClicked(ShowItemEvent<T> showItemEvent) {
|
||||||
|
|
||||||
|
if (showItemEvent.getSelectItems() != null) {
|
||||||
|
List<T> items = showItemEvent.getSelectItems();
|
||||||
|
|
||||||
|
for (T t : items) {
|
||||||
|
CatalogueDataset clickedDataset = (CatalogueDataset) t;
|
||||||
|
CkanFramePanel cfp = new CkanFramePanel(eventBus);
|
||||||
|
cfp.instanceFrame(clickedDataset.getUrl(), null);
|
||||||
|
mainTabPanel.addTab(clickedDataset.getTitle(), cfp);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(CheckBoxSelectIemsEvent.TYPE, new CheckBoxSelectIemsEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void onValueChanged(CheckBoxSelectIemsEvent<T> onValueChangedEvent) {
|
||||||
|
howeView.markItemsAsChecked(onValueChangedEvent.isChecked(), true);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
eventBus.addHandler(TableRangeViewChangedEvent.TYPE, new TableRangeViewChangedEventHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public <T> void onRangeChanged(TableRangeViewChangedEvent<T> tableRangeViewChangedEvent) {
|
||||||
|
howeView.setVisibleUpdateStatusAction(false);
|
||||||
|
howeView.setCheckedCheckboxSelectAll(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -93,7 +136,6 @@ public class CkanContentModeratorWidgetController {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check content moderator configuration.
|
* Check content moderator configuration.
|
||||||
*
|
*
|
||||||
|
@ -113,7 +155,7 @@ public class CkanContentModeratorWidgetController {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Boolean result) {
|
public void onSuccess(Boolean result) {
|
||||||
isContentModeratorEnabled = result;
|
isContentModeratorEnabled = result;
|
||||||
if(whenDone!=null)
|
if (whenDone != null)
|
||||||
whenDone.execute();
|
whenDone.execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,62 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class CheckBoxSelectIemsEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
* @param <T> the generic type
|
||||||
|
*/
|
||||||
|
public class CheckBoxSelectIemsEvent<T> extends GwtEvent<CheckBoxSelectIemsEventHandler> {
|
||||||
|
public static Type<CheckBoxSelectIemsEventHandler> TYPE = new Type<CheckBoxSelectIemsEventHandler>();
|
||||||
|
private boolean isChecked;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new click item event.
|
||||||
|
*
|
||||||
|
* @param selectItems the select items
|
||||||
|
*/
|
||||||
|
public CheckBoxSelectIemsEvent(boolean checkedValue) {
|
||||||
|
this.isChecked = checkedValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<CheckBoxSelectIemsEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
|
||||||
|
* EventHandler)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(CheckBoxSelectIemsEventHandler handler) {
|
||||||
|
handler.onValueChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isChecked() {
|
||||||
|
return isChecked;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface CheckBoxSelectIemsEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
|
public interface CheckBoxSelectIemsEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On value changed.
|
||||||
|
*
|
||||||
|
* @param <T> the generic type
|
||||||
|
* @param onValueChangedEvent the on value changed event
|
||||||
|
*/
|
||||||
|
<T> void onValueChanged(CheckBoxSelectIemsEvent<T> onValueChangedEvent);
|
||||||
|
}
|
|
@ -1,29 +1,38 @@
|
||||||
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
import com.google.gwt.event.shared.GwtEvent;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class ClickItemEvent.
|
* The Class ClickItemEvent.
|
||||||
*
|
*
|
||||||
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
* Jul 6, 2015
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
* @param <T> the generic type
|
||||||
*/
|
*/
|
||||||
public class ClickItemEvent<T> extends GwtEvent<ClickItemEventHandler> {
|
public class ClickItemEvent<T> extends GwtEvent<ClickItemEventHandler> {
|
||||||
public static Type<ClickItemEventHandler> TYPE = new Type<ClickItemEventHandler>();
|
public static Type<ClickItemEventHandler> TYPE = new Type<ClickItemEventHandler>();
|
||||||
private T item;
|
private List<T> selectItems;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new click item event.
|
* Instantiates a new click item event.
|
||||||
*
|
*
|
||||||
* @param item the item
|
* @param selectItems the select items
|
||||||
*/
|
*/
|
||||||
public ClickItemEvent(T item) {
|
public ClickItemEvent(List<T> selectItems) {
|
||||||
this.item = item;
|
this.selectItems = selectItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -31,8 +40,17 @@ public class ClickItemEvent<T> extends GwtEvent<ClickItemEventHandler> {
|
||||||
return TYPE;
|
return TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/**
|
||||||
* @see com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.EventHandler)
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
|
||||||
|
* EventHandler)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void dispatch(ClickItemEventHandler handler) {
|
protected void dispatch(ClickItemEventHandler handler) {
|
||||||
|
@ -40,11 +58,11 @@ public class ClickItemEvent<T> extends GwtEvent<ClickItemEventHandler> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the item.
|
* Gets the select items.
|
||||||
*
|
*
|
||||||
* @return the item
|
* @return the select items
|
||||||
*/
|
*/
|
||||||
public T getItem() {
|
public List<T> getSelectItems() {
|
||||||
return item;
|
return selectItems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,68 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class ShowItemEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
* @param <T> the generic type
|
||||||
|
*/
|
||||||
|
public class ShowItemEvent<T> extends GwtEvent<ShowItemEventHandler> {
|
||||||
|
public static Type<ShowItemEventHandler> TYPE = new Type<ShowItemEventHandler>();
|
||||||
|
private List<T> selectItems;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new click item event.
|
||||||
|
*
|
||||||
|
* @param selectItems the select items
|
||||||
|
*/
|
||||||
|
public ShowItemEvent(List<T> selectItems) {
|
||||||
|
this.selectItems = selectItems;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the associated type.
|
||||||
|
*
|
||||||
|
* @return the associated type
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Type<ShowItemEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dispatch.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see
|
||||||
|
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
|
||||||
|
* EventHandler)
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void dispatch(ShowItemEventHandler handler) {
|
||||||
|
handler.onShowItemClicked(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the select items.
|
||||||
|
*
|
||||||
|
* @return the select items
|
||||||
|
*/
|
||||||
|
public List<T> getSelectItems() {
|
||||||
|
return selectItems;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Auto-generated Javadoc
|
||||||
|
/**
|
||||||
|
* The Interface ShowItemEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
|
public interface ShowItemEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* On show item clicked.
|
||||||
|
*
|
||||||
|
* @param <T> the generic type
|
||||||
|
* @param showItemEvent the show item event
|
||||||
|
*/
|
||||||
|
<T> void onShowItemClicked(ShowItemEvent<T> showItemEvent);
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.GwtEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class TableRangeViewChangedEvent.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
* @param <T> the generic type
|
||||||
|
*/
|
||||||
|
public class TableRangeViewChangedEvent<T> extends GwtEvent<TableRangeViewChangedEventHandler> {
|
||||||
|
public static Type<TableRangeViewChangedEventHandler> TYPE = new Type<TableRangeViewChangedEventHandler>();
|
||||||
|
private int startIndex;
|
||||||
|
private int limitIndex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new click item event.
|
||||||
|
*
|
||||||
|
* @param handler the handler
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public TableRangeViewChangedEvent(int start, int limit) {
|
||||||
|
this.startIndex = start;
|
||||||
|
this.limitIndex = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type<TableRangeViewChangedEventHandler> getAssociatedType() {
|
||||||
|
return TYPE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void dispatch(TableRangeViewChangedEventHandler handler) {
|
||||||
|
handler.onRangeChanged(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStartIndex() {
|
||||||
|
return startIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLimitIndex() {
|
||||||
|
return limitIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.events;
|
||||||
|
|
||||||
|
import com.google.gwt.event.shared.EventHandler;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface TableRangeViewChangedEventHandler.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
|
public interface TableRangeViewChangedEventHandler extends EventHandler {
|
||||||
|
|
||||||
|
<T> void onRangeChanged(TableRangeViewChangedEvent<T> tableRangeViewChangedEvent);
|
||||||
|
|
||||||
|
}
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorWidgetController;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorWidgetController;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ContentModeratorWidgetConstants;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ContentModeratorWidgetConstants;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.TableRangeViewChangedEvent;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.SortedCellTable;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.SortedCellTable;
|
||||||
|
@ -48,6 +49,7 @@ public class ContentModeratorPaginatedView {
|
||||||
private LoadingPanel loadingPanel = new LoadingPanel(new HTML("Loading data..."));
|
private LoadingPanel loadingPanel = new LoadingPanel(new HTML("Loading data..."));
|
||||||
private ItemStatus itemStatus;
|
private ItemStatus itemStatus;
|
||||||
private int serverStartIndex;
|
private int serverStartIndex;
|
||||||
|
private HandlerManager eventBus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new content moderator paginated view.
|
* Instantiates a new content moderator paginated view.
|
||||||
|
@ -62,6 +64,7 @@ public class ContentModeratorPaginatedView {
|
||||||
DISPLAY_FIELD sortByField) {
|
DISPLAY_FIELD sortByField) {
|
||||||
this.itemStatus = theStatus;
|
this.itemStatus = theStatus;
|
||||||
this.newLoading = true;
|
this.newLoading = true;
|
||||||
|
this.eventBus = eventbus;
|
||||||
itemsTable = new ItemsTable<CatalogueDataset>(eventbus, displayFields, sortByField);
|
itemsTable = new ItemsTable<CatalogueDataset>(eventbus, displayFields, sortByField);
|
||||||
itemsTable.initTable(null, null, dataProvider);
|
itemsTable.initTable(null, null, dataProvider);
|
||||||
|
|
||||||
|
@ -216,8 +219,8 @@ public class ContentModeratorPaginatedView {
|
||||||
GWT.log("calling getDataForStatus with parameters [startIndex: " + offset + ", limit: " + limit
|
GWT.log("calling getDataForStatus with parameters [startIndex: " + offset + ", limit: " + limit
|
||||||
+ ", serverIndex:" + serverIndex + "]");
|
+ ", serverIndex:" + serverIndex + "]");
|
||||||
|
|
||||||
CkanContentModeratorWidgetController.contentModeratorService.getDataForStatus(status, offset, limit, serverIndex,
|
CkanContentModeratorWidgetController.contentModeratorService.getDataForStatus(status, offset, limit,
|
||||||
new AsyncCallback<SearchedData>() {
|
serverIndex, new AsyncCallback<SearchedData>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(SearchedData result) {
|
public void onSuccess(SearchedData result) {
|
||||||
|
@ -264,9 +267,20 @@ public class ContentModeratorPaginatedView {
|
||||||
|
|
||||||
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
|
GWT.log("Range changed: " + start + " " + length + " visible count: " + display.getVisibleItemCount());
|
||||||
loadNewPage(start, length, false);
|
loadNewPage(start, length, false);
|
||||||
|
eventBus.fireEvent(new TableRangeViewChangedEvent<T>(start, length));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void selectItems(boolean select, boolean limitToPage) {
|
||||||
|
SortedCellTable<CatalogueDataset> table = getCellTable();
|
||||||
|
int rowSize = table.getVisibleItemCount();
|
||||||
|
|
||||||
|
for (int i = 0; i < rowSize; i++) {
|
||||||
|
CatalogueDataset item = table.getVisibleItem(i);
|
||||||
|
itemsTable.getSelectionModel().setSelected(item, select);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,12 +4,17 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.CheckBoxSelectIemsEvent;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.CheckBox;
|
import com.github.gwtbootstrap.client.ui.CheckBox;
|
||||||
import com.github.gwtbootstrap.client.ui.Dropdown;
|
import com.github.gwtbootstrap.client.ui.Dropdown;
|
||||||
|
import com.github.gwtbootstrap.client.ui.Heading;
|
||||||
import com.github.gwtbootstrap.client.ui.NavLink;
|
import com.github.gwtbootstrap.client.ui.NavLink;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.event.logical.shared.ValueChangeEvent;
|
||||||
|
import com.google.gwt.event.logical.shared.ValueChangeHandler;
|
||||||
import com.google.gwt.event.shared.HandlerManager;
|
import com.google.gwt.event.shared.HandlerManager;
|
||||||
import com.google.gwt.uibinder.client.UiBinder;
|
import com.google.gwt.uibinder.client.UiBinder;
|
||||||
import com.google.gwt.uibinder.client.UiField;
|
import com.google.gwt.uibinder.client.UiField;
|
||||||
|
@ -17,6 +22,14 @@ import com.google.gwt.user.client.ui.Composite;
|
||||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||||
import com.google.gwt.user.client.ui.Widget;
|
import com.google.gwt.user.client.ui.Widget;
|
||||||
|
|
||||||
|
// TODO: Auto-generated Javadoc
|
||||||
|
/**
|
||||||
|
* The Class HomeView.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
public class HomeView extends Composite {
|
public class HomeView extends Composite {
|
||||||
|
|
||||||
private static HomeViewUiBinder uiBinder = GWT.create(HomeViewUiBinder.class);
|
private static HomeViewUiBinder uiBinder = GWT.create(HomeViewUiBinder.class);
|
||||||
|
@ -32,25 +45,52 @@ public class HomeView extends Composite {
|
||||||
@UiField
|
@UiField
|
||||||
Dropdown dropdownSetStatus;
|
Dropdown dropdownSetStatus;
|
||||||
|
|
||||||
|
@UiField
|
||||||
|
Heading pageHeader;
|
||||||
|
|
||||||
private List<NavLink> setStatusOptions = new ArrayList<>();
|
private List<NavLink> setStatusOptions = new ArrayList<>();
|
||||||
|
|
||||||
private ItemStatus displayingItemStatus;
|
private ItemStatus displayingItemStatus;
|
||||||
|
|
||||||
|
private HandlerManager eventBus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Interface HomeViewUiBinder.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
interface HomeViewUiBinder extends UiBinder<Widget, HomeView> {
|
interface HomeViewUiBinder extends UiBinder<Widget, HomeView> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new home view.
|
||||||
|
*
|
||||||
|
* @param eventBus the event bus
|
||||||
|
* @param status the status
|
||||||
|
* @param displayFields the display fields
|
||||||
|
* @param sortByField the sort by field
|
||||||
|
*/
|
||||||
public HomeView(HandlerManager eventBus, ItemStatus status, DISPLAY_FIELD[] displayFields,
|
public HomeView(HandlerManager eventBus, ItemStatus status, DISPLAY_FIELD[] displayFields,
|
||||||
DISPLAY_FIELD sortByField) {
|
DISPLAY_FIELD sortByField) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
this.displayingItemStatus = status;
|
this.displayingItemStatus = status;
|
||||||
|
this.eventBus = eventBus;
|
||||||
|
this.pageHeader.setSubtext(status.getLabel());
|
||||||
paginatedView = new ContentModeratorPaginatedView(eventBus, status, displayFields, sortByField);
|
paginatedView = new ContentModeratorPaginatedView(eventBus, status, displayFields, sortByField);
|
||||||
cmsPanel.addToCenter(paginatedView.getCellPanel());
|
cmsPanel.addToCenter(paginatedView.getCellPanel());
|
||||||
cmsPanel.addToBottom(paginatedView.getPagerPanel());
|
cmsPanel.addToBottom(paginatedView.getPagerPanel());
|
||||||
panelContainer.add(cmsPanel.getPanel());
|
panelContainer.add(cmsPanel.getPanel());
|
||||||
|
setVisibleUpdateStatusAction(false);
|
||||||
|
|
||||||
fillSetStatusOptions();
|
fillSetStatusOptions();
|
||||||
|
bindEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fill set status options.
|
||||||
|
*/
|
||||||
private void fillSetStatusOptions() {
|
private void fillSetStatusOptions() {
|
||||||
for (ItemStatus status : ItemStatus.values()) {
|
for (ItemStatus status : ItemStatus.values()) {
|
||||||
if (!status.equals(displayingItemStatus)) {
|
if (!status.equals(displayingItemStatus)) {
|
||||||
|
@ -62,8 +102,57 @@ public class HomeView extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bind events.
|
||||||
|
*/
|
||||||
|
public void bindEvents() {
|
||||||
|
|
||||||
|
cbSelectAll.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
||||||
|
GWT.log("Is checked: " + cbSelectAll.getValue());
|
||||||
|
eventBus.fireEvent(new CheckBoxSelectIemsEvent<CatalogueDataset>(cbSelectAll.getValue()));
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the panel.
|
||||||
|
*
|
||||||
|
* @return the panel
|
||||||
|
*/
|
||||||
public Composite getPanel() {
|
public Composite getPanel() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the visible update status action.
|
||||||
|
*
|
||||||
|
* @param bool the new visible update status action
|
||||||
|
*/
|
||||||
|
public void setVisibleUpdateStatusAction(boolean bool) {
|
||||||
|
dropdownSetStatus.setVisible(bool);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mark items as checked.
|
||||||
|
*
|
||||||
|
* @param select the select
|
||||||
|
* @param limitToPage the limit to page
|
||||||
|
*/
|
||||||
|
public void markItemsAsChecked(boolean select, boolean limitToPage) {
|
||||||
|
paginatedView.selectItems(select, limitToPage);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the checked checkbox select all.
|
||||||
|
*
|
||||||
|
* @param bool the new checked checkbox select all
|
||||||
|
*/
|
||||||
|
public void setCheckedCheckboxSelectAll(boolean bool) {
|
||||||
|
cbSelectAll.setValue(bool);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,15 +14,25 @@
|
||||||
.margin-left-5 {
|
.margin-left-5 {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headinghome {
|
||||||
|
margin-left: 5px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
|
.headinghome>small {
|
||||||
|
font-size: 16px !important;
|
||||||
|
}
|
||||||
</ui:style>
|
</ui:style>
|
||||||
<g:HTMLPanel>
|
<g:HTMLPanel>
|
||||||
|
<b:Heading ui:field="pageHeader" size="4"
|
||||||
|
addStyleNames="{style.headinghome}">Items with status: </b:Heading>
|
||||||
<g:HorizontalPanel
|
<g:HorizontalPanel
|
||||||
addStyleNames="{style.margin-left-5}">
|
addStyleNames="{style.margin-left-5}">
|
||||||
<b:CheckBox ui:field="cbSelectAll"></b:CheckBox>
|
<b:CheckBox ui:field="cbSelectAll"></b:CheckBox>
|
||||||
<b:Dropdown text="Set status as..."
|
<b:Dropdown text="Update status as..."
|
||||||
ui:field="dropdownSetStatus" addStyleNames="{style.margin-left-20}">
|
ui:field="dropdownSetStatus" addStyleNames="{style.margin-left-20}">
|
||||||
</b:Dropdown>
|
</b:Dropdown>
|
||||||
<!-- <b:SubmitButton addStyleNames="btn">Confirm</b:SubmitButton> -->
|
|
||||||
</g:HorizontalPanel>
|
</g:HorizontalPanel>
|
||||||
<g:HTMLPanel ui:field="panelContainer"></g:HTMLPanel>
|
<g:HTMLPanel ui:field="panelContainer"></g:HTMLPanel>
|
||||||
</g:HTMLPanel>
|
</g:HTMLPanel>
|
||||||
|
|
|
@ -3,8 +3,11 @@ package org.gcube.portlets.widgets.ckancontentmoderator.client.ui;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.util.UtilFunct;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Tab;
|
import com.github.gwtbootstrap.client.ui.Tab;
|
||||||
import com.github.gwtbootstrap.client.ui.TabPanel;
|
import com.github.gwtbootstrap.client.ui.TabPanel;
|
||||||
|
import com.github.gwtbootstrap.client.ui.constants.IconType;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.core.client.Scheduler;
|
import com.google.gwt.core.client.Scheduler;
|
||||||
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
||||||
|
@ -70,6 +73,7 @@ public class MainTabPanel extends Composite {
|
||||||
*/
|
*/
|
||||||
public Tab addTab(String heading, Widget w){
|
public Tab addTab(String heading, Widget w){
|
||||||
Tab tab = new Tab();
|
Tab tab = new Tab();
|
||||||
|
tab.setIcon(IconType.BOOK);
|
||||||
tab.addClickHandler(new ClickHandler() {
|
tab.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -78,7 +82,9 @@ public class MainTabPanel extends Composite {
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
tab.setHeading(heading);
|
String shortTitle = UtilFunct.ellipsis(heading, 20, false);
|
||||||
|
tab.asWidget().setTitle(heading);
|
||||||
|
tab.setHeading(shortTitle);
|
||||||
if(w!=null)
|
if(w!=null)
|
||||||
tab.add(w);
|
tab.add(w);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table;
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -92,11 +94,13 @@ public abstract class AbstractItemsCellTable<T> {
|
||||||
GWT.log("Clicked: " + selectedObject);
|
GWT.log("Clicked: " + selectedObject);
|
||||||
// selectedItem(selectedObject);
|
// selectedItem(selectedObject);
|
||||||
if (fireEventOnClick)
|
if (fireEventOnClick)
|
||||||
AbstractItemsCellTable.this.eventBus.fireEvent(new ClickItemEvent<T>(selectedObject));
|
AbstractItemsCellTable.this.eventBus.fireEvent(new ClickItemEvent<T>(Arrays.asList(selectedObject)));
|
||||||
}
|
}
|
||||||
}else if (theSelectionModel instanceof MultiSelectionModel) {
|
}else if (theSelectionModel instanceof MultiSelectionModel) {
|
||||||
Set<T> selected = ((MultiSelectionModel<T>) theSelectionModel).getSelectedSet();
|
Set<T> selected = ((MultiSelectionModel<T>) theSelectionModel).getSelectedSet();
|
||||||
GWT.log("Selected are:" +selected);
|
GWT.log("Selected are:" +selected);
|
||||||
|
if (fireEventOnClick)
|
||||||
|
AbstractItemsCellTable.this.eventBus.fireEvent(new ClickItemEvent<T>(new ArrayList<T>(selected)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -11,12 +11,14 @@ import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ContentModeratorWidgetConstants;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ContentModeratorWidgetConstants;
|
||||||
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.events.ShowItemEvent;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.resources.ContentModeratorWidgetResources;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.resources.ContentModeratorWidgetResources;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.SelectionItems;
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.SelectionItems;
|
||||||
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
|
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
|
||||||
|
|
||||||
import com.github.gwtbootstrap.client.ui.Pagination;
|
import com.github.gwtbootstrap.client.ui.Pagination;
|
||||||
import com.google.gwt.cell.client.ButtonCell;
|
import com.google.gwt.cell.client.ButtonCell;
|
||||||
|
import com.google.gwt.cell.client.Cell.Context;
|
||||||
import com.google.gwt.cell.client.CheckboxCell;
|
import com.google.gwt.cell.client.CheckboxCell;
|
||||||
import com.google.gwt.cell.client.DateCell;
|
import com.google.gwt.cell.client.DateCell;
|
||||||
import com.google.gwt.cell.client.FieldUpdater;
|
import com.google.gwt.cell.client.FieldUpdater;
|
||||||
|
@ -38,6 +40,7 @@ import com.google.gwt.user.client.ui.Label;
|
||||||
import com.google.gwt.view.client.AbstractDataProvider;
|
import com.google.gwt.view.client.AbstractDataProvider;
|
||||||
import com.google.gwt.view.client.ListDataProvider;
|
import com.google.gwt.view.client.ListDataProvider;
|
||||||
import com.google.gwt.view.client.MultiSelectionModel;
|
import com.google.gwt.view.client.MultiSelectionModel;
|
||||||
|
import com.google.gwt.view.client.SelectionModel;
|
||||||
import com.google.gwt.view.client.SingleSelectionModel;
|
import com.google.gwt.view.client.SingleSelectionModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,23 +89,6 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
setDisplayFields(fields);
|
setDisplayFields(fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /**
|
|
||||||
// * Update items.
|
|
||||||
// *
|
|
||||||
// * @param items the items
|
|
||||||
// * @param removeOldItems the remove old items
|
|
||||||
// */
|
|
||||||
// /*
|
|
||||||
// * (non-Javadoc)
|
|
||||||
// *
|
|
||||||
// * @see
|
|
||||||
// * org.gcube.portlets.widgets.wsexplorer.client.view.grid.AbstractItemsCellTable
|
|
||||||
// * #updateItems(java.util.List, boolean)
|
|
||||||
// */
|
|
||||||
// public void updateItems(List<T> items, boolean removeOldItems) {
|
|
||||||
// super.updateItems(items, removeOldItems);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the items.
|
* Adds the items.
|
||||||
*
|
*
|
||||||
|
@ -130,36 +116,42 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
this.isAsyncronusTable = dataProvider instanceof ListDataProvider ? false : true;
|
this.isAsyncronusTable = dataProvider instanceof ListDataProvider ? false : true;
|
||||||
setEmptyTableMessage(ContentModeratorWidgetConstants.NO_DATA);
|
setEmptyTableMessage(ContentModeratorWidgetConstants.NO_DATA);
|
||||||
|
|
||||||
// Checkbox column. This table will uses a checkbox column for selection.
|
final CheckboxCell cellCheckBox = new CheckboxCell(true, false);
|
||||||
// Alternatively, you can call cellTable.setSelectionEnabled(true) to enable
|
Column<T, Boolean> checkColumn = new Column<T, Boolean>(cellCheckBox) {
|
||||||
// mouse selection.
|
|
||||||
Column<T, Boolean> checkColumn = new Column<T, Boolean>(new CheckboxCell(true, false)) {
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean getValue(T object) {
|
public Boolean getValue(T object) {
|
||||||
// Get the value from the selection model.
|
// Get the value from the selection model.
|
||||||
return theSelectionModel.isSelected(object);
|
return theSelectionModel.isSelected(object);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(Context context, T object, SafeHtmlBuilder sb) {
|
||||||
|
super.render(context, object, sb);
|
||||||
|
GWT.log("added checkbox: " + cellCheckBox + " to object: " + object);
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sortedCellTable.addColumn(checkColumn, "", false);
|
sortedCellTable.addColumn(checkColumn, "", false);
|
||||||
sortedCellTable.setColumnWidth(checkColumn, 40, Unit.PX);
|
sortedCellTable.setColumnWidth(checkColumn, 40, Unit.PX);
|
||||||
|
|
||||||
ButtonCell previewButton = new ButtonCell();
|
ButtonCell previewButton = new ButtonCell();
|
||||||
Column<T,String> showdItemColumn = new Column<T,String>(previewButton) {
|
Column<T, String> showdItemColumn = new Column<T, String>(previewButton) {
|
||||||
public String getValue(T object) {
|
public String getValue(T object) {
|
||||||
return "Show";
|
return "Show";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
showdItemColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
showdItemColumn.setFieldUpdater(new FieldUpdater<T, String>() {
|
||||||
@Override
|
@Override
|
||||||
public void update(int index, T object, String value) {
|
public void update(int index, T object, String value) {
|
||||||
GWT.log("clicked");
|
GWT.log("clicked show");
|
||||||
}
|
eventBus.fireEvent(new ShowItemEvent<T>(Arrays.asList(object)));
|
||||||
});
|
}
|
||||||
|
});
|
||||||
sortedCellTable.addColumn(showdItemColumn);
|
sortedCellTable.addColumn(showdItemColumn);
|
||||||
sortedCellTable.setColumnWidth(showdItemColumn, 80, Unit.PX);
|
sortedCellTable.setColumnWidth(showdItemColumn, 80, Unit.PX);
|
||||||
|
|
||||||
|
|
||||||
if (this.displayFields.contains(DISPLAY_FIELD.NAME)) {
|
if (this.displayFields.contains(DISPLAY_FIELD.NAME)) {
|
||||||
|
|
||||||
// NAME
|
// NAME
|
||||||
|
@ -376,13 +368,6 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* final SingleSelectionModel<Item> selectionModel = new
|
|
||||||
* SingleSelectionModel<Item>(); selectionModel.addSelectionChangeHandler(new
|
|
||||||
* Handler() {
|
|
||||||
*
|
|
||||||
* @Override public void onSelectionChange(SelectionChangeEvent event) { } });
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -506,4 +491,14 @@ public class ItemsTable<T extends CatalogueDataset> extends AbstractItemsCellTab
|
||||||
if (sortedCellTable != null)
|
if (sortedCellTable != null)
|
||||||
sortedCellTable.setEmptyTableWidget(new Label(msg));
|
sortedCellTable.setEmptyTableWidget(new Label(msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the selection model.
|
||||||
|
*
|
||||||
|
* @return the selection model
|
||||||
|
*/
|
||||||
|
public SelectionModel<T> getSelectionModel() {
|
||||||
|
return theSelectionModel;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
package org.gcube.portlets.widgets.ckancontentmoderator.client.ui.util;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class UtilFunct.
|
||||||
|
*
|
||||||
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||||
|
*
|
||||||
|
* Jun 22, 2021
|
||||||
|
*/
|
||||||
|
public class UtilFunct {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ellipsis.
|
||||||
|
*
|
||||||
|
* @param value the value
|
||||||
|
* @param lenght the length
|
||||||
|
* @param left the left
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
|
public static String ellipsis(String value, int length, boolean left) {
|
||||||
|
if (value.length() < 3)
|
||||||
|
return value;
|
||||||
|
|
||||||
|
if (value.length() > length) {
|
||||||
|
if (left)
|
||||||
|
return "..." + value.substring(value.length() - length + 3);
|
||||||
|
else
|
||||||
|
return value.substring(0, length) + "...";
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue