Minor Updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@92329 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-02-26 14:33:39 +00:00
parent c8ee161196
commit 295b1c318e
6 changed files with 487 additions and 79 deletions

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/tabular-data-column-widget-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/tabular-data-column-widget-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/tabular-data-column-widget-1.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<classpathentry excluding="**" kind="src" output="target/tabular-data-column-widget-1.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
@ -44,5 +44,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/tabular-data-column-widget-1.0.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/tabular-data-column-widget-1.1.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -896,3 +896,329 @@ Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 12.07 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 14.59 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 8.63 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
60% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 14.69 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 14.81 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
40% complete (ETR: 6 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 15.49 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
10% complete (ETR: 34 seconds)
10% complete (ETR: 34 seconds)
20% complete (ETR: 24 seconds)
30% complete (ETR: 17 seconds)
40% complete (ETR: 13 seconds)
50% complete (ETR: 10 seconds)
60% complete (ETR: 8 seconds)
70% complete (ETR: 5 seconds)
80% complete (ETR: 3 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 16.42 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
50% complete (ETR: 4 seconds)
60% complete (ETR: 3 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 11.28 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 10.22 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
40% complete (ETR: 7 seconds)
50% complete (ETR: 5 seconds)
60% complete (ETR: 4 seconds)
70% complete (ETR: 3 seconds)
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
70% complete (ETR: 2 seconds)
80% complete (ETR: 1 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 8.03 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes
Public resources found in...
Translatable source found in...
Found 2719 cached/archived units. Used 2719 / 2719 units from cache.
Compiling...
Compilation completed in 0.00 seconds
Removing invalidated units
Finding entry point classes

View File

@ -13,7 +13,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>tabular-data-column-widget</artifactId>
<version>1.0.0-SNAPSHOT</version>
<version>1.1.0-SNAPSHOT</version>
<name>tabular-data-column-widget</name>

View File

@ -2,16 +2,19 @@ package org.gcube.portlets.user.td.columnwidget.client;
import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.dimension.DialogCodelistSelection;
import org.gcube.portlets.user.td.columnwidget.client.progress.ChangeColumnTypeProgressDialog;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataTypeProperties;
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnTypeCodeProperties;
import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProperties;
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeElement;
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnDataTypeStore;
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnTypeCodeElement;
import org.gcube.portlets.user.td.columnwidget.client.store.ColumnTypeCodeStore;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
@ -41,6 +44,8 @@ import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.BeforeShowContextMenuEvent;
import com.sencha.gxt.widget.core.client.event.BeforeShowContextMenuEvent.BeforeShowContextMenuHandler;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
@ -55,9 +60,9 @@ import com.sencha.gxt.widget.core.client.info.Info;
* ChangeColumnTypePanel is the panel for change column type
*
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChangeColumnTypePanel extends FramedPanel {
protected String WIDTH = "640px";
@ -74,6 +79,9 @@ public class ChangeColumnTypePanel extends FramedPanel {
protected FieldLabel comboMeasureTypeLabel;
protected ComboBox<ColumnDataTypeElement> comboAttributeType = null;
protected FieldLabel comboAttributeTypeLabel;
protected ComboBox<TabResource> comboDimensionType = null;
protected FieldLabel comboDimensionTypeLabel;
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
protected TextButton change;
@ -207,6 +215,36 @@ public class ChangeColumnTypePanel extends FramedPanel {
"Attribute Type");
comboAttributeTypeLabel.setVisible(false);
// comboMeasureType
TabResourceProperties propsDimensionType = GWT
.create(TabResourceProperties.class);
ListStore<TabResource> storeComboDimensionType = new ListStore<TabResource>(
propsDimensionType.id());
comboDimensionType = new ComboBox<TabResource>(storeComboDimensionType,
propsDimensionType.label());
Log.trace("ComboDimensionType created");
comboDimensionType.setEmptyText("Select a Dimension...");
comboDimensionType.setWidth(150);
comboDimensionType.setTypeAhead(true);
comboDimensionType.setTriggerAction(TriggerAction.ALL);
comboDimensionType
.addBeforeShowContextMenuHandler(new BeforeShowContextMenuHandler() {
public void onBeforeShowContextMenu(
BeforeShowContextMenuEvent event) {
callDialogCodelistSelection();
comboDimensionType.collapse();
}
});
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
comboDimensionTypeLabel.setVisible(false);
// Change
change = new TextButton("Change");
SelectHandler changeHandler = new SelectHandler() {
@ -322,13 +360,22 @@ public class ChangeColumnTypePanel extends FramedPanel {
if (type == ColumnTypeCode.MEASURE) {
comboMeasureTypeLabel.setVisible(true);
comboAttributeTypeLabel.setVisible(false);
comboDimensionTypeLabel.setVisible(false);
} else {
if (type == ColumnTypeCode.ATTRIBUTE) {
comboMeasureTypeLabel.setVisible(false);
comboAttributeTypeLabel.setVisible(true);
comboDimensionTypeLabel.setVisible(false);
} else {
comboMeasureTypeLabel.setVisible(false);
comboAttributeTypeLabel.setVisible(false);
if (type == ColumnTypeCode.DIMENSION) {
comboMeasureTypeLabel.setVisible(false);
comboAttributeTypeLabel.setVisible(false);
comboDimensionTypeLabel.setVisible(true);
} else {
comboMeasureTypeLabel.setVisible(false);
comboAttributeTypeLabel.setVisible(false);
comboDimensionTypeLabel.setVisible(false);
}
}
}
@ -523,7 +570,8 @@ public class ChangeColumnTypePanel extends FramedPanel {
}
public void onSuccess(Void result) {
changeColumnTypeProgressDialog= new ChangeColumnTypeProgressDialog(changeColumnTypeSession, eventBus);
changeColumnTypeProgressDialog = new ChangeColumnTypeProgressDialog(
changeColumnTypeSession, eventBus);
}
});
@ -542,4 +590,10 @@ public class ChangeColumnTypePanel extends FramedPanel {
}
protected void callDialogCodelistSelection() {
DialogCodelistSelection dialogCodelistSelection = new DialogCodelistSelection(
eventBus);
dialogCodelistSelection.show();
}
}

View File

@ -6,8 +6,12 @@ import java.util.Iterator;
import java.util.List;
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.util.OrderInfo;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadConfig;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadResult;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.Direction;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.OrderInfo;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
@ -33,9 +37,12 @@ import com.sencha.gxt.data.shared.loader.PagingLoadResultBean;
import com.sencha.gxt.data.shared.loader.PagingLoader;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
import com.sencha.gxt.widget.core.client.event.HideEvent;
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.TextField;
@ -47,12 +54,14 @@ import com.sencha.gxt.widget.core.client.grid.LiveGridView;
import com.sencha.gxt.widget.core.client.grid.LiveToolItem;
import com.sencha.gxt.widget.core.client.toolbar.LabelToolItem;
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
import com.google.web.bindery.event.shared.EventBus;
public class DialogCodelistSelection extends Window {
protected static final int WIDTH = 550;
protected static final int HEIGHT = 520;
protected static final int CACHE_SIZE = 200;
private static final TabResourcesProperties properties = GWT
.create(TabResourcesProperties.class);
@ -62,14 +71,17 @@ public class DialogCodelistSelection extends Window {
properties.agency(), 50, "Agency");
protected static final ColumnConfig<TabResource, String> dateColumn = new ColumnConfig<TabResource, String>(
properties.date(), 50, "Date");
protected EventBus eventBus;
protected Grid<TabResource> grid;
protected ExtendedLiveGridView liveGridView;
protected PagingLoader<PagingLoadConfig, PagingLoadResult<TabResource>> loader;
protected String filter;
protected ResourceBundle res;
public DialogCodelistSelection() {
public DialogCodelistSelection(EventBus eventBus) {
this.eventBus=eventBus;
Log.info("Dialog CodelistSelection");
setWidth(WIDTH);
setHeight(HEIGHT);
@ -113,7 +125,10 @@ public class DialogCodelistSelection extends Window {
public void onKeyUp(KeyUpEvent event) {
Log.trace("searchTerm: " + searchField.getCurrentValue());
// store.applyFilters();
filter=searchField.getCurrentValue();
if(filter!=null&& !filter.isEmpty()){
loader.load(0, liveGridView.getCacheSize());
}
}
});
@ -122,10 +137,10 @@ public class DialogCodelistSelection extends Window {
public void load(PagingLoadConfig loadConfig,
final AsyncCallback<PagingLoadResult<TabResource>> callback) {
loadData(loadConfig, callback);
}
};
loader = new PagingLoader<PagingLoadConfig, PagingLoadResult<TabResource>>(
loader = new PagingLoader<PagingLoadConfig, PagingLoadResult<TabResource>>(
proxy);
loader.setRemoteSort(true);
@ -158,7 +173,6 @@ public class DialogCodelistSelection extends Window {
grid.setLoadMask(true);
grid.setColumnReordering(true);
SelectHandler sh = new SelectHandler() {
public void onSelect(SelectEvent event) {
loader.load();
@ -185,74 +199,51 @@ public class DialogCodelistSelection extends Window {
protected void loadData(PagingLoadConfig loadConfig,
final AsyncCallback<PagingLoadResult<TabResource>> callback) {
/*
* TDGWTServiceAsync.INSTANCE.getTabularResources(new
* AsyncCallback<ArrayList<TabResource>>() {
*
* public void onFailure(Throwable caught) {
* Log.error("load combo failure:" + caught.getLocalizedMessage());
* callback.onFailure(caught); }
*
* public void onSuccess(ArrayList<TabResource> result) {
* Log.trace("loaded " + result.size() + " ColumnData"); /*if
* (columnName != null) { for (ColumnData cd : result) { if
* (cd.getName().compareTo(columnName) == 0) { comboColumn.setValue(cd);
* labelColumn.setValue(cd.getLabel());
* comboColumnTypeCode.select(ColumnTypeCodeStore
* .selected(cd.getTypeCode())); } } } callback.onSuccess(new
* ListLoadResultBean<TabResource>( result));
*
* }
*
*
* });
*/
ArrayList<TabResource> trs = new ArrayList<TabResource>(1000);
List<? extends SortInfo> sortInfo=loadConfig.getSortInfo();
Iterator<? extends SortInfo> iterator=sortInfo.iterator();
ArrayList<OrderInfo> listOrderInfo=new ArrayList<OrderInfo>();
while(iterator.hasNext()){
SortInfo info=iterator.next();
OrderInfo ord=new OrderInfo();
SortDir sd=info.getSortDir();
if(sd.compareTo(SortDir.ASC)==0){
ord.setDirection("ASC");
List<? extends SortInfo> sortInfo = loadConfig.getSortInfo();
Iterator<? extends SortInfo> iterator = sortInfo.iterator();
ArrayList<OrderInfo> listOrderInfo = new ArrayList<OrderInfo>();
while (iterator.hasNext()) {
SortInfo info = iterator.next();
OrderInfo ord = new OrderInfo();
SortDir sd = info.getSortDir();
if (sd.compareTo(SortDir.ASC) == 0) {
ord.setDirection(Direction.ASC);
} else {
ord.setDirection("DESC");
ord.setDirection(Direction.DESC);
}
ord.setField(info.getSortField());
listOrderInfo.add(ord);
}
int totalLength = loadConfig.getOffset() + loadConfig.getLimit();
int offset = loadConfig.getOffset();
Log.debug("Offset: " + offset);
Log.debug("Limit:" + loadConfig.getLimit());
Log.debug("TotalLength:" + totalLength);
int cur = 0;
for (int i = offset; i < totalLength; i++) {
try {
cur = i + 1;
TabResource tr = new TabResource();
tr.setId(String.valueOf(i));
tr.setName("Number" + cur);
tr.setAgency("Agency" + cur);
tr.setDate("2013/11/01");
trs.add(tr);
CodelistPagingLoadConfig codelistPagingLoadConfig = new CodelistPagingLoadConfig(
loadConfig.getOffset(), loadConfig.getLimit(), listOrderInfo,
filter);
} catch (IndexOutOfBoundsException e) {
Log.debug("OutOfBounds size:" + trs.size() + " index: " + i
+ " Error:" + e.getMessage() + "\n");
}
}
TDGWTServiceAsync.INSTANCE.getCodelistsPagingLoader(
codelistPagingLoadConfig,
new AsyncCallback<CodelistPagingLoadResult>() {
callback.onSuccess(new PagingLoadResultBean<TabResource>(trs, 1000,
offset));
@Override
public void onFailure(Throwable caught) {
Log.debug("Error Retrieving Codelist",
caught.getMessage());
caught.printStackTrace();
alert("Error Retrieving Codelist",
"Error retrieving codelist on server");
}
@Override
public void onSuccess(CodelistPagingLoadResult result) {
callback.onSuccess(new PagingLoadResultBean<TabResource>(
result.getLtr(), result.getTotalLenght(),
result.getOffset()));
}
});
}
protected HandlerRegistration addSelectionHandler(
@ -282,4 +273,16 @@ public class DialogCodelistSelection extends Window {
}
};
private void alert(String title, String message) {
final AlertMessageBox d = new AlertMessageBox(title, message);
d.addHideHandler(new HideHandler() {
public void onHide(HideEvent event) {
}
});
d.show();
}
}

View File

@ -0,0 +1,25 @@
package org.gcube.portlets.user.td.columnwidget.client.properties;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.data.shared.LabelProvider;
import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface TabResourceProperties extends
PropertyAccess<TabResource> {
@Path("id")
ModelKeyProvider<TabResource> id();
@Path("name")
LabelProvider<TabResource> label();
}