Update Batch Replace
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@94505 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
41eb61a1ee
commit
a48a941312
|
@ -2472,3 +2472,35 @@ 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: 22 seconds)
|
||||
10% complete (ETR: 22 seconds)
|
||||
20% complete (ETR: 21 seconds)
|
||||
30% complete (ETR: 15 seconds)
|
||||
40% complete (ETR: 11 seconds)
|
||||
50% complete (ETR: 8 seconds)
|
||||
60% complete (ETR: 6 seconds)
|
||||
70% complete (ETR: 4 seconds)
|
||||
80% complete (ETR: 3 seconds)
|
||||
90% complete (ETR: 1 seconds)
|
||||
100% complete (ETR: 0 seconds)
|
||||
Compilation completed in 21.06 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
|
||||
|
|
|
@ -15,8 +15,10 @@ 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.DimensionRow;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForReplaceBatchColumnSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceEntry;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ShowOccurrencesType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
|
@ -62,7 +64,6 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
|
|||
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.ComboBox;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
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;
|
||||
|
@ -89,6 +90,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
protected String columnName;
|
||||
protected ColumnData column;
|
||||
protected boolean hasValidationColumns;
|
||||
protected ShowOccurrencesType showOccurencesType;
|
||||
|
||||
protected ReplaceBatchDialog parent;
|
||||
private ReplaceEntry currentReplaceEntry;
|
||||
|
@ -99,7 +101,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
private TextButton btnSave;
|
||||
private TextButton btnClose;
|
||||
private ComboBox<ShowOccurrencesTypeElement> comboShowOccurrencesType = null;
|
||||
private FieldLabel comboShowOccurencesTypeLabel;
|
||||
|
||||
|
||||
protected ListLoader<ListLoadConfig, ListLoadResult<ReplaceEntry>> loader;
|
||||
protected Grid<ReplaceEntry> grid;
|
||||
|
@ -128,10 +130,11 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
}
|
||||
|
||||
protected void create() {
|
||||
showOccurencesType = ShowOccurrencesType.ONLYERRORS;
|
||||
|
||||
ToolBar toolBarHead = new ToolBar();
|
||||
toolBarHead.add(new LabelToolItem("Show: "));
|
||||
|
||||
|
||||
// Create Combo Show
|
||||
ShowOccurrencesTypeProperties propsShowOccurrencesType = GWT
|
||||
.create(ShowOccurrencesTypeProperties.class);
|
||||
|
@ -141,24 +144,21 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
.getShowOccurrencesType());
|
||||
|
||||
comboShowOccurrencesType = new ComboBox<ShowOccurrencesTypeElement>(
|
||||
storeShowOccurrencesType, propsShowOccurrencesType.type());
|
||||
storeShowOccurrencesType, propsShowOccurrencesType.label());
|
||||
Log.trace("ComboMeasureType created");
|
||||
|
||||
addHandlersForShowOccurrencesType(propsShowOccurrencesType.type());
|
||||
addHandlersForShowOccurrencesType(propsShowOccurrencesType.label());
|
||||
|
||||
comboShowOccurrencesType.setEmptyText("Select a show type...");
|
||||
comboShowOccurrencesType.setWidth(100);
|
||||
comboShowOccurrencesType.setTypeAhead(true);
|
||||
comboShowOccurrencesType.setEditable(false);
|
||||
comboShowOccurrencesType.setTriggerAction(TriggerAction.ALL);
|
||||
comboShowOccurrencesType.setValue(ShowOccurrencesTypeStore.onlyErrorsElement);
|
||||
comboShowOccurrencesType
|
||||
.setValue(ShowOccurrencesTypeStore.onlyErrorsElement);
|
||||
|
||||
toolBarHead.add(comboShowOccurrencesType);
|
||||
|
||||
/*comboShowOccurencesTypeLabel = new FieldLabel(comboShowOccurrencesType,
|
||||
"Show");
|
||||
*/
|
||||
|
||||
|
||||
// Create Grid
|
||||
IdentityValueProvider<ReplaceEntry> identity = new IdentityValueProvider<ReplaceEntry>();
|
||||
|
@ -226,7 +226,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
l.add(valueCol);
|
||||
l.add(numberCol);
|
||||
l.add(replacementValueCol);
|
||||
// l.add(replacementIdCol);
|
||||
l.add(changeColumn);
|
||||
ColumnModel<ReplaceEntry> cm = new ColumnModel<ReplaceEntry>(l);
|
||||
|
||||
|
@ -274,8 +273,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
grid.setLoader(loader);
|
||||
grid.setSelectionModel(sm);
|
||||
number.initPlugin(grid);
|
||||
// grid.getView().setAutoExpandColumn(labelCol);
|
||||
// grid.setHeight(360);
|
||||
grid.setHeight("388px");
|
||||
grid.getView().setStripeRows(true);
|
||||
grid.getView().setColumnLines(true);
|
||||
|
@ -327,8 +324,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
flowButton.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||
|
||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||
//v.add(comboShowOccurencesTypeLabel,new VerticalLayoutData(-1, -1, new Margins(0,0,2,0)));
|
||||
v.add(toolBarHead,new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(toolBarHead, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||
v.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||
v.add(toolBar, new VerticalLayoutData(1, 25, new Margins(0)));
|
||||
v.add(flowButton, new VerticalLayoutData(-1, 36,
|
||||
|
@ -389,7 +385,6 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
protected void addHandlersForShowOccurrencesType(
|
||||
final LabelProvider<ShowOccurrencesTypeElement> labelProvider) {
|
||||
comboShowOccurrencesType
|
||||
|
@ -407,21 +402,25 @@ public class ReplaceBatchPanel extends FramedPanel implements
|
|||
+ event.getSelectedItem());
|
||||
ShowOccurrencesTypeElement showType = event
|
||||
.getSelectedItem();
|
||||
updateShowType(showType.getType());
|
||||
updateShowType(showType);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
protected void updateShowType(String type){
|
||||
|
||||
protected void updateShowType(ShowOccurrencesTypeElement showType) {
|
||||
showOccurencesType = showType.getType();
|
||||
loader.load();
|
||||
}
|
||||
|
||||
|
||||
protected void loadData(ListLoadConfig loadConfig,
|
||||
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace(column,
|
||||
OccurrencesForReplaceBatchColumnSession occurrencesSession = new OccurrencesForReplaceBatchColumnSession(
|
||||
column, showOccurencesType);
|
||||
|
||||
TDGWTServiceAsync.INSTANCE.getOccurrencesForBatchReplace(
|
||||
occurrencesSession,
|
||||
new AsyncCallback<ArrayList<Occurrences>>() {
|
||||
|
||||
public void onFailure(Throwable caught) {
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.properties;
|
||||
|
||||
import org.gcube.portlets.user.td.columnwidget.client.store.ShowOccurrencesTypeElement;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||
|
||||
import com.google.gwt.editor.client.Editor.Path;
|
||||
import com.sencha.gxt.data.shared.LabelProvider;
|
||||
|
@ -20,7 +19,7 @@ public interface ShowOccurrencesTypeProperties extends
|
|||
@Path("id")
|
||||
ModelKeyProvider<ShowOccurrencesTypeElement> id();
|
||||
|
||||
LabelProvider<ShowOccurrencesTypeElement> type();
|
||||
LabelProvider<ShowOccurrencesTypeElement> label();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,53 +1,49 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.store;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ShowOccurrencesType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @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 ShowOccurrencesTypeElement {
|
||||
|
||||
protected int id; // For insert in table only
|
||||
protected String type;
|
||||
protected ShowOccurrencesType type;
|
||||
|
||||
|
||||
public ShowOccurrencesTypeElement(int id,String type){
|
||||
this.id=id;
|
||||
this.type=type;
|
||||
public ShowOccurrencesTypeElement() {
|
||||
}
|
||||
|
||||
public ShowOccurrencesTypeElement(int id, ShowOccurrencesType type) {
|
||||
this.id = id;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
public String getType() {
|
||||
public ShowOccurrencesType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
public String getLabel() {
|
||||
return type.toString();
|
||||
}
|
||||
|
||||
public void setType(ShowOccurrencesType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ShowOccurrencesTypeElement [id=" + id + ", type=" + type + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package org.gcube.portlets.user.td.columnwidget.client.store;
|
|||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ShowOccurrencesType;
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -15,13 +17,11 @@ import java.util.ArrayList;
|
|||
public class ShowOccurrencesTypeStore implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1908324094430432681L;
|
||||
private final static String ONLYERRORS="Only Errors";
|
||||
private final static String ALL="All";
|
||||
|
||||
protected static ArrayList<ShowOccurrencesTypeElement> store;
|
||||
|
||||
public static ShowOccurrencesTypeElement onlyErrorsElement=new ShowOccurrencesTypeElement(1,ONLYERRORS);
|
||||
public static ShowOccurrencesTypeElement allElement=new ShowOccurrencesTypeElement(2,ALL);
|
||||
public static ShowOccurrencesTypeElement onlyErrorsElement=new ShowOccurrencesTypeElement(1,ShowOccurrencesType.ONLYERRORS);
|
||||
public static ShowOccurrencesTypeElement allElement=new ShowOccurrencesTypeElement(2,ShowOccurrencesType.ALL);
|
||||
|
||||
|
||||
public static ArrayList<ShowOccurrencesTypeElement> getShowOccurrencesType(){
|
||||
|
@ -33,10 +33,10 @@ public class ShowOccurrencesTypeStore implements Serializable {
|
|||
|
||||
public static int selectedShowOccurrencesTypePosition(String selected){
|
||||
int position=0;
|
||||
if(selected.compareTo(ONLYERRORS)==0){
|
||||
if(selected.compareTo(ShowOccurrencesType.ONLYERRORS.toString())==0){
|
||||
position=1;
|
||||
} else {
|
||||
if(selected.compareTo(ALL)==0){
|
||||
if(selected.compareTo(ShowOccurrencesType.ALL.toString())==0){
|
||||
position=2;
|
||||
} else {
|
||||
}
|
||||
|
@ -46,11 +46,11 @@ public class ShowOccurrencesTypeStore implements Serializable {
|
|||
|
||||
|
||||
public static String selectedShowOccurrencesType(String selected){
|
||||
if(selected.compareTo(ONLYERRORS)==0){
|
||||
return ONLYERRORS;
|
||||
if(selected.compareTo(ShowOccurrencesType.ONLYERRORS.toString())==0){
|
||||
return ShowOccurrencesType.ONLYERRORS.toString();
|
||||
} else {
|
||||
if(selected.compareTo(ALL)==0){
|
||||
return ALL;
|
||||
if(selected.compareTo(ShowOccurrencesType.ALL.toString())==0){
|
||||
return ShowOccurrencesType.ALL.toString();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -58,10 +58,10 @@ public class ShowOccurrencesTypeStore implements Serializable {
|
|||
}
|
||||
|
||||
public static ShowOccurrencesTypeElement selectedShowOccurrencesTypeElement(String selected){
|
||||
if(selected.compareTo(ONLYERRORS)==0){
|
||||
if(selected.compareTo(ShowOccurrencesType.ONLYERRORS.toString())==0){
|
||||
return onlyErrorsElement;
|
||||
} else {
|
||||
if(selected.compareTo(ALL)==0){
|
||||
if(selected.compareTo(ShowOccurrencesType.ALL.toString())==0){
|
||||
return allElement;
|
||||
} else {
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue