Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@93242 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-03-17 17:59:08 +00:00
parent 51f8c0cd40
commit 65f5fd85d5
5 changed files with 325 additions and 1 deletions

View File

@ -1638,3 +1638,99 @@ Compiling...
Compilation completed in 0.00 seconds Compilation completed in 0.00 seconds
Removing invalidated units Removing invalidated units
Finding entry point classes Finding entry point classes
Public resources found in...
Translatable source found in...
Found 0 cached/archived units. Used 0 / 2719 units from cache.
Compiling...
30% complete (ETR: 9 seconds)
30% complete (ETR: 9 seconds)
30% complete (ETR: 9 seconds)
30% complete (ETR: 9 seconds)
40% complete (ETR: 9 seconds)
50% complete (ETR: 6 seconds)
60% complete (ETR: 5 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.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: 6 seconds)
60% complete (ETR: 5 seconds)
70% complete (ETR: 3 seconds)
80% complete (ETR: 2 seconds)
90% complete (ETR: 1 seconds)
100% complete (ETR: 0 seconds)
Compilation completed in 17.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 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...
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
30% complete (ETR: 8 seconds)
40% complete (ETR: 8 seconds)
50% complete (ETR: 6 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.88 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

@ -20,7 +20,6 @@ public class ChangeColumnTypeDialog extends Window {
protected TRId trId; protected TRId trId;
protected String columnName=null; protected String columnName=null;
protected ColumnData column=null;
protected ComboBox<ColumnData> combo=null; protected ComboBox<ColumnData> combo=null;
public ChangeColumnTypeDialog(TRId trId, EventBus eventBus) { public ChangeColumnTypeDialog(TRId trId, EventBus eventBus) {

View File

@ -0,0 +1,28 @@
package org.gcube.portlets.user.td.columnwidget.client.batch;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
public class BatchReplaceDialog extends Window {
protected String WIDTH = "650px";
protected String HEIGHT = "530px";
protected TRId trId;
protected String columnName=null;
public BatchReplaceDialog(TRId trId, String columnName, EventBus eventBus) {
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Change Column Type");
//getHeader().setIcon(Resources.IMAGES.side_list());
this.trId=trId;
this.columnName=columnName;
BatchReplacePanel batchRepalcePanel= new BatchReplacePanel(trId,columnName,eventBus);
add(batchRepalcePanel);
}
}

View File

@ -0,0 +1,174 @@
package org.gcube.portlets.user.td.columnwidget.client.batch;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.columnwidget.client.ChangeColumnTypeDialog;
import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectionListener;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurences;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.core.client.IdentityValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
import com.sencha.gxt.data.client.loader.RpcProxy;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
import com.sencha.gxt.data.shared.loader.ListLoadResult;
import com.sencha.gxt.data.shared.loader.ListLoader;
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.form.TextField;
import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
import com.sencha.gxt.widget.core.client.grid.RowNumberer;
public class BatchReplacePanel extends FramedPanel implements
CodelistSelectionListener {
protected String WIDTH = "640px";
protected String HEIGHT = "520px";
protected EventBus eventBus;
protected ChangeColumnTypeDialog parent;
protected TextField label = null;
protected TRId trId;
protected String columnName;
protected ListLoader<ListLoadConfig, ListLoadResult<Occurences>> loader;
protected Grid<Occurences> grid;
public BatchReplacePanel(TRId trId, String columnName, EventBus eventBus) {
setWidth(WIDTH);
setHeight(HEIGHT);
setHeaderVisible(false);
setBodyBorder(false);
this.trId = trId;
this.columnName = columnName;
this.eventBus = eventBus;
Log.debug("Create BatchReplacePanel(): [" + trId.toString()+" , columnName:"+columnName + "]");
create();
}
protected void create(){
IdentityValueProvider<Occurences> identity=new IdentityValueProvider<Occurences>();
CheckBoxSelectionModel<Occurences> sm = new CheckBoxSelectionModel<Occurences>(
identity);
RowNumberer<Occurences> number = new RowNumberer<Occurences>(identity);
OccurencesProperties props = GWT.create(OccurencesProperties.class);
ColumnConfig<Occurences, String> valueCol = new ColumnConfig<Occurences, String>(
props.value());
ColumnConfig<Occurences, Integer> numberCol = new ColumnConfig<Occurences, Integer>(
props.number());
List<ColumnConfig<Occurences, ?>> l = new ArrayList<ColumnConfig<Occurences, ?>>();
l.add(number);
l.add(valueCol);
l.add(numberCol);
ColumnModel<Occurences> cm = new ColumnModel<Occurences>(l);
ListStore<Occurences> store = new ListStore<Occurences>(props.id());
RpcProxy<ListLoadConfig, ListLoadResult<Occurences>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<Occurences>>() {
public void load(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<Occurences>> callback) {
loadData(loadConfig, callback);
}
};
loader = new ListLoader<ListLoadConfig, ListLoadResult<Occurences>>(
proxy);
loader.setRemoteSort(false);
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, Occurences, ListLoadResult<Occurences>>(
store) {
});
grid = new Grid<Occurences>(store, cm) {
@Override
protected void onAfterFirstAttach() {
super.onAfterFirstAttach();
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
loader.load();
}
});
}
};
sm.setSelectionMode(SelectionMode.MULTI);
grid.setLoader(loader);
grid.setSelectionModel(sm);
//grid.getView().setAutoExpandColumn(labelCol);
//grid.setHeight(360);
grid.getView().setStripeRows(true);
grid.getView().setColumnLines(true);
grid.getView().setAutoFill(true);
grid.setBorders(false);
grid.setLoadMask(true);
grid.setColumnReordering(true);
grid.setColumnResize(false);
}
protected void loadData(ListLoadConfig loadConfig,
final AsyncCallback<ListLoadResult<Occurences>> callback) {
/*TDGWTServiceAsync.INSTANCE.getColumns(trId,
new AsyncCallback<ArrayList<Occurences>>() {
public void onFailure(Throwable caught) {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
alert("Error retrieving columns",
"Error retrieving columns");
callback.onFailure(caught);
}
public void onSuccess(ArrayList<ColumnData> result) {
Log.trace("loaded " + result.size() + " ColumnData");
callback.onSuccess(new ListLoadResultBean<ColumnData>(
result));
}
});
*/
}
@Override
public void selected(TabResource tabResource) {
// TODO Auto-generated method stub
}
@Override
public void aborted() {
// TODO Auto-generated method stub
}
@Override
public void failed(String reason, String detail) {
// TODO Auto-generated method stub
}
}

View File

@ -0,0 +1,27 @@
/**
*
*/
package org.gcube.portlets.user.td.columnwidget.client.batch;
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurences;
import com.google.gwt.editor.client.Editor.Path;
import com.sencha.gxt.core.client.ValueProvider;
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 OccurencesProperties extends PropertyAccess<Occurences> {
@Path("value")
ModelKeyProvider<Occurences> id();
ValueProvider<Occurences, String> value();
ValueProvider<Occurences, Integer> number();
}