2014-03-17 18:59:08 +01:00
|
|
|
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;
|
2014-03-19 12:52:51 +01:00
|
|
|
import org.gcube.portlets.user.td.columnwidget.client.custom.ActionButtonCell;
|
|
|
|
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
2014-03-18 18:22:39 +01:00
|
|
|
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
|
|
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
2014-03-17 18:59:08 +01:00
|
|
|
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;
|
2014-03-18 18:22:39 +01:00
|
|
|
import com.google.gwt.cell.client.Cell.Context;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.google.gwt.core.client.GWT;
|
|
|
|
import com.google.gwt.core.client.Scheduler;
|
|
|
|
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
|
2014-03-19 12:52:51 +01:00
|
|
|
import com.google.gwt.dom.client.Style.Unit;
|
|
|
|
import com.google.gwt.safecss.shared.SafeStylesBuilder;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
2014-03-19 15:22:35 +01:00
|
|
|
import com.google.gwt.user.client.ui.HTML;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.google.web.bindery.event.shared.EventBus;
|
2014-03-19 16:48:15 +01:00
|
|
|
import com.sencha.gxt.cell.core.client.ButtonCell.IconAlign;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.sencha.gxt.core.client.IdentityValueProvider;
|
|
|
|
import com.sencha.gxt.core.client.Style.SelectionMode;
|
2014-03-19 15:22:35 +01:00
|
|
|
import com.sencha.gxt.core.client.resources.ThemeStyles;
|
2014-03-18 18:22:39 +01:00
|
|
|
import com.sencha.gxt.core.client.util.Format;
|
|
|
|
import com.sencha.gxt.core.client.util.Margins;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.sencha.gxt.data.client.loader.RpcProxy;
|
|
|
|
import com.sencha.gxt.data.shared.ListStore;
|
2014-03-19 15:22:35 +01:00
|
|
|
import com.sencha.gxt.data.shared.event.StoreDataChangeEvent;
|
|
|
|
import com.sencha.gxt.data.shared.event.StoreDataChangeEvent.StoreDataChangeHandler;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
2014-03-18 18:22:39 +01:00
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
2014-03-17 18:59:08 +01:00
|
|
|
import com.sencha.gxt.data.shared.loader.ListLoader;
|
|
|
|
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
|
|
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
2014-03-19 16:48:15 +01:00
|
|
|
import com.sencha.gxt.widget.core.client.button.TextButton;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutPack;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
|
|
|
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer.HBoxLayoutAlign;
|
2014-03-18 18:22:39 +01:00
|
|
|
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.SelectEvent;
|
|
|
|
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
2014-03-17 18:59:08 +01:00
|
|
|
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;
|
2014-03-19 15:22:35 +01:00
|
|
|
import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-17 19:03:29 +01:00
|
|
|
/**
|
|
|
|
*
|
2014-03-18 18:22:39 +01:00
|
|
|
* @author "Giancarlo Panichi" <a
|
|
|
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
|
|
|
*
|
2014-03-17 19:03:29 +01:00
|
|
|
*/
|
2014-03-19 16:28:52 +01:00
|
|
|
public class BatchReplacePanel extends FramedPanel {
|
2014-03-19 15:22:35 +01:00
|
|
|
protected String WIDTH = "560px";
|
2014-03-17 18:59:08 +01:00
|
|
|
protected String HEIGHT = "520px";
|
|
|
|
protected EventBus eventBus;
|
|
|
|
protected ChangeColumnTypeDialog parent;
|
|
|
|
protected TextField label = null;
|
|
|
|
protected TRId trId;
|
|
|
|
protected String columnName;
|
2014-03-18 18:22:39 +01:00
|
|
|
protected ColumnData column;
|
2014-03-19 16:48:15 +01:00
|
|
|
protected BatchReplaceDialog batchReplaceDialog;
|
|
|
|
|
2014-03-19 12:52:51 +01:00
|
|
|
protected static final String DON_T_REPLACE = "Don't replace";
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-19 16:48:15 +01:00
|
|
|
private TextButton btnApply;
|
|
|
|
private TextButton btnClose;
|
|
|
|
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
protected ListLoader<ListLoadConfig, ListLoadResult<ReplaceEntry>> loader;
|
|
|
|
protected Grid<ReplaceEntry> grid;
|
|
|
|
protected ListStore<ReplaceEntry> store;
|
2014-03-19 15:22:35 +01:00
|
|
|
protected HTML info;
|
2014-03-18 18:22:39 +01:00
|
|
|
|
2014-03-19 16:48:15 +01:00
|
|
|
public BatchReplacePanel(BatchReplaceDialog batchReplaceDialog, TRId trId, String columnName, EventBus eventBus) {
|
|
|
|
this.batchReplaceDialog=batchReplaceDialog;
|
2014-03-18 18:22:39 +01:00
|
|
|
Log.debug("BatchReplacePanel:["+trId+", columnName:"+columnName+"]");
|
2014-03-17 18:59:08 +01:00
|
|
|
setWidth(WIDTH);
|
|
|
|
setHeight(HEIGHT);
|
|
|
|
setHeaderVisible(false);
|
|
|
|
setBodyBorder(false);
|
|
|
|
this.trId = trId;
|
|
|
|
this.columnName = columnName;
|
|
|
|
this.eventBus = eventBus;
|
2014-03-18 18:22:39 +01:00
|
|
|
Log.debug("Create BatchReplacePanel(): [" + trId.toString()
|
|
|
|
+ " , columnName:" + columnName + "]");
|
2014-03-19 12:52:51 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
retrieveColumn();
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
protected void create() {
|
|
|
|
|
|
|
|
IdentityValueProvider<ReplaceEntry> identity = new IdentityValueProvider<ReplaceEntry>();
|
|
|
|
CheckBoxSelectionModel<ReplaceEntry> sm = new CheckBoxSelectionModel<ReplaceEntry>(
|
2014-03-17 18:59:08 +01:00
|
|
|
identity);
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
RowNumberer<ReplaceEntry> number = new RowNumberer<ReplaceEntry>(identity);
|
2014-03-19 12:52:51 +01:00
|
|
|
//number.setFixed(false);
|
|
|
|
//number.setResizable(false);
|
|
|
|
number.setWidth(50);
|
|
|
|
number.setColumnClassSuffix("");
|
|
|
|
number.setHeader("N.");
|
|
|
|
SafeStylesBuilder styleBuilder=new SafeStylesBuilder();
|
|
|
|
styleBuilder.width(50, Unit.PX);
|
|
|
|
number.setColumnStyle(styleBuilder.toSafeStyles());
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
ReplaceEntryProperties props = GWT.create(ReplaceEntryProperties.class);
|
2014-03-19 12:52:51 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
ColumnConfig<ReplaceEntry, String> valueCol = new ColumnConfig<ReplaceEntry, String>(
|
2014-03-19 12:52:51 +01:00
|
|
|
props.value(), 130, "Values");
|
2014-03-18 18:22:39 +01:00
|
|
|
ColumnConfig<ReplaceEntry, Integer> numberCol = new ColumnConfig<ReplaceEntry, Integer>(
|
2014-03-19 12:52:51 +01:00
|
|
|
props.number(), 100,"Occurences");
|
2014-03-18 18:22:39 +01:00
|
|
|
ColumnConfig<ReplaceEntry, String> replacementValueCol = new ColumnConfig<ReplaceEntry, String>(
|
2014-03-19 12:52:51 +01:00
|
|
|
props.replacementValue(),130,"Replacement");
|
2014-03-18 18:22:39 +01:00
|
|
|
/*ColumnConfig<ReplaceEntry, String> replacementIdCol = new ColumnConfig<ReplaceEntry, String>(
|
|
|
|
props.replacementId());
|
|
|
|
*/
|
|
|
|
ColumnConfig<ReplaceEntry, String> changeColumn = new ColumnConfig<ReplaceEntry, String>(
|
2014-03-19 12:52:51 +01:00
|
|
|
props.value(),24);
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-19 12:52:51 +01:00
|
|
|
ActionButtonCell button = new ActionButtonCell();
|
|
|
|
button.setIcon(ResourceBundle.INSTANCE.magnifier());
|
|
|
|
button.setTitle("Change");
|
2014-03-18 18:22:39 +01:00
|
|
|
button.addSelectHandler(new SelectHandler() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onSelect(SelectEvent event) {
|
|
|
|
Context c = event.getContext();
|
|
|
|
int row = c.getIndex();
|
|
|
|
ReplaceEntry re = store.get(row);
|
|
|
|
Log.debug("ReplaceEntry " + re.toString() + " was clicked.");
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
changeColumn.setCell(button);
|
|
|
|
|
|
|
|
List<ColumnConfig<ReplaceEntry, ?>> l = new ArrayList<ColumnConfig<ReplaceEntry, ?>>();
|
2014-03-17 18:59:08 +01:00
|
|
|
l.add(number);
|
|
|
|
l.add(valueCol);
|
|
|
|
l.add(numberCol);
|
2014-03-18 18:22:39 +01:00
|
|
|
l.add(replacementValueCol);
|
|
|
|
//l.add(replacementIdCol);
|
|
|
|
l.add(changeColumn);
|
|
|
|
ColumnModel<ReplaceEntry> cm = new ColumnModel<ReplaceEntry>(l);
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
store = new ListStore<ReplaceEntry>(props.id());
|
2014-03-19 15:22:35 +01:00
|
|
|
|
|
|
|
store.addStoreDataChangeHandler(new StoreDataChangeHandler<ReplaceEntry>() {
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-19 15:22:35 +01:00
|
|
|
@Override
|
|
|
|
public void onDataChange(StoreDataChangeEvent<ReplaceEntry> event) {
|
|
|
|
updateInfo();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
RpcProxy<ListLoadConfig, ListLoadResult<ReplaceEntry>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ReplaceEntry>>() {
|
2014-03-17 18:59:08 +01:00
|
|
|
|
|
|
|
public void load(ListLoadConfig loadConfig,
|
2014-03-18 18:22:39 +01:00
|
|
|
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
|
2014-03-17 18:59:08 +01:00
|
|
|
loadData(loadConfig, callback);
|
|
|
|
}
|
|
|
|
};
|
2014-03-18 18:22:39 +01:00
|
|
|
loader = new ListLoader<ListLoadConfig, ListLoadResult<ReplaceEntry>>(
|
2014-03-17 18:59:08 +01:00
|
|
|
proxy);
|
|
|
|
|
|
|
|
loader.setRemoteSort(false);
|
2014-03-18 18:22:39 +01:00
|
|
|
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, ReplaceEntry, ListLoadResult<ReplaceEntry>>(
|
2014-03-17 18:59:08 +01:00
|
|
|
store) {
|
|
|
|
});
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
grid = new Grid<ReplaceEntry>(store, cm) {
|
2014-03-17 18:59:08 +01:00
|
|
|
@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);
|
2014-03-18 18:22:39 +01:00
|
|
|
number.initPlugin(grid);
|
|
|
|
// grid.getView().setAutoExpandColumn(labelCol);
|
|
|
|
// grid.setHeight(360);
|
2014-03-19 16:48:15 +01:00
|
|
|
grid.setHeight("418px");
|
2014-03-17 18:59:08 +01:00
|
|
|
grid.getView().setStripeRows(true);
|
|
|
|
grid.getView().setColumnLines(true);
|
2014-03-18 18:22:39 +01:00
|
|
|
grid.getView().setAutoFill(true);
|
2014-03-17 18:59:08 +01:00
|
|
|
grid.setBorders(false);
|
|
|
|
grid.setLoadMask(true);
|
|
|
|
grid.setColumnReordering(true);
|
2014-03-19 12:52:51 +01:00
|
|
|
grid.setColumnResize(true);
|
|
|
|
grid.getView().setAutoExpandColumn(valueCol);
|
|
|
|
|
2014-03-19 15:22:35 +01:00
|
|
|
info=new HTML("No info");
|
|
|
|
|
|
|
|
ToolBar toolBar = new ToolBar();
|
|
|
|
toolBar.add(info);
|
|
|
|
toolBar.addStyleName(ThemeStyles.getStyle().borderTop());
|
|
|
|
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-19 16:48:15 +01:00
|
|
|
btnApply = new TextButton("Save");
|
|
|
|
btnApply.setIcon(ResourceBundle.INSTANCE.save());
|
|
|
|
btnApply.setIconAlign(IconAlign.RIGHT);
|
|
|
|
btnApply.setTitle("Apply Filter");
|
|
|
|
btnApply.addSelectHandler(new SelectHandler() {
|
|
|
|
|
|
|
|
public void onSelect(SelectEvent event) {
|
|
|
|
Log.debug("Pressed Apply");
|
|
|
|
save();
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
btnClose = new TextButton("Close");
|
|
|
|
btnClose.setIcon(ResourceBundle.INSTANCE.close());
|
|
|
|
btnClose.setIconAlign(IconAlign.RIGHT);
|
|
|
|
btnClose.setTitle("Cancel filter");
|
|
|
|
btnClose.addSelectHandler(new SelectHandler() {
|
|
|
|
|
|
|
|
public void onSelect(SelectEvent event) {
|
|
|
|
Log.debug("Pressed Close");
|
|
|
|
close();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
|
|
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
|
|
|
flowButton.setPack(BoxLayoutPack.CENTER);
|
|
|
|
|
|
|
|
flowButton
|
|
|
|
.add(btnApply, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
|
|
|
flowButton
|
|
|
|
.add(btnClose, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
|
|
|
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
|
|
|
v.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
2014-03-19 15:22:35 +01:00
|
|
|
v.add(toolBar,new VerticalLayoutData(1, 25, new Margins(0)));
|
2014-03-19 16:48:15 +01:00
|
|
|
v.add(flowButton, new VerticalLayoutData(-1, 36, new Margins(
|
|
|
|
5, 2, 5, 2)));
|
2014-03-18 18:22:39 +01:00
|
|
|
add(v);
|
2014-03-17 18:59:08 +01:00
|
|
|
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
}
|
2014-03-17 18:59:08 +01:00
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
|
|
|
|
protected void retrieveColumn(){
|
|
|
|
TDGWTServiceAsync.INSTANCE.getColumn(trId, columnName,
|
|
|
|
new AsyncCallback<ColumnData>() {
|
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
Log.error("load column failure:"
|
|
|
|
+ caught.getLocalizedMessage());
|
|
|
|
UtilsGXT3.alert("Error retrieving column",
|
|
|
|
"Error retrieving column");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
public void onSuccess(ColumnData result) {
|
|
|
|
Log.debug("Column: "+result);
|
|
|
|
column=result;
|
|
|
|
create();
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2014-03-17 18:59:08 +01:00
|
|
|
protected void loadData(ListLoadConfig loadConfig,
|
2014-03-18 18:22:39 +01:00
|
|
|
final AsyncCallback<ListLoadResult<ReplaceEntry>> callback) {
|
|
|
|
|
|
|
|
TDGWTServiceAsync.INSTANCE.getOccurencesForBatchReplace(column,
|
2014-03-17 18:59:08 +01:00
|
|
|
new AsyncCallback<ArrayList<Occurences>>() {
|
|
|
|
|
|
|
|
public void onFailure(Throwable caught) {
|
|
|
|
Log.error("load columns failure:"
|
|
|
|
+ caught.getLocalizedMessage());
|
2014-03-18 18:22:39 +01:00
|
|
|
UtilsGXT3.alert("Error retrieving columns",
|
2014-03-17 18:59:08 +01:00
|
|
|
"Error retrieving columns");
|
|
|
|
callback.onFailure(caught);
|
|
|
|
}
|
|
|
|
|
2014-03-18 18:22:39 +01:00
|
|
|
public void onSuccess(ArrayList<Occurences> result) {
|
|
|
|
Log.trace("loaded " + result.size() + " Occurences");
|
|
|
|
callback.onSuccess(new ListLoadResultBean<ReplaceEntry>(
|
|
|
|
getRecord(result)));
|
2014-03-19 15:22:35 +01:00
|
|
|
|
2014-03-17 18:59:08 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
2014-03-18 18:22:39 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void updateInfo() {
|
|
|
|
Log.trace("updating the info bar");
|
|
|
|
int total = store.size();
|
|
|
|
int totalErrors = 0;
|
|
|
|
int assignedErrors = 0;
|
|
|
|
int assigned = 0;
|
|
|
|
for (ReplaceEntry record : store.getAll()) {
|
|
|
|
int errors = record.getNumber();
|
|
|
|
totalErrors += errors;
|
2014-03-19 15:22:35 +01:00
|
|
|
if (record.getReplacementValue() != null && record.getReplacementValue().compareTo(DON_T_REPLACE)!=0) {
|
2014-03-18 18:22:39 +01:00
|
|
|
assigned++;
|
|
|
|
assignedErrors += errors;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
String text = Format
|
2014-03-19 16:28:52 +01:00
|
|
|
.substitute("Assigned {0} ({1} occurences) of {2} ({3} occurences)",
|
2014-03-18 18:22:39 +01:00
|
|
|
String.valueOf(assigned),
|
|
|
|
String.valueOf(assignedErrors), String.valueOf(total),
|
|
|
|
String.valueOf(totalErrors));
|
2014-03-19 15:22:35 +01:00
|
|
|
info.setText(text);
|
2014-03-18 18:22:39 +01:00
|
|
|
Log.debug(text);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*public ArrayList<ReplaceEntry> getReplaceEntries() {
|
|
|
|
ArrayList<ReplaceEntry> entries = new ArrayList<ReplaceEntry>();
|
|
|
|
for (ReplaceEntry record : store.getAll() {
|
|
|
|
if (record.getAsString(REPLACE_ID_FIELD) != null) {
|
|
|
|
ReplaceEntry entry = new ReplaceEntry(
|
|
|
|
record.getAsString(ERROR_VALUE_FIELD),
|
|
|
|
record.getAsString(REPLACE_VALUE_FIELD),
|
|
|
|
record.getAsString(REPLACE_ID_FIELD));
|
|
|
|
entries.add(entry);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return entries;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void updateEntries(ArrayList<Occurences> entries) {
|
|
|
|
store.clear();
|
|
|
|
ArrayList<ReplaceEntry> records = getRecord(entries);
|
|
|
|
store.addAll(records);
|
|
|
|
store.commitChanges();
|
|
|
|
}*/
|
|
|
|
|
|
|
|
protected ArrayList<ReplaceEntry> getRecord(ArrayList<Occurences> entries) {
|
|
|
|
ArrayList<ReplaceEntry> records = new ArrayList<ReplaceEntry>();
|
|
|
|
for (Occurences entry : entries)
|
|
|
|
records.add(getRecord(entry));
|
|
|
|
return records;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected ReplaceEntry getRecord(Occurences entry) {
|
|
|
|
ReplaceEntry data = new ReplaceEntry(entry.getValue(), entry.getNumber(),
|
|
|
|
DON_T_REPLACE, null);
|
|
|
|
return data;
|
2014-03-17 18:59:08 +01:00
|
|
|
}
|
|
|
|
|
2014-03-19 16:48:15 +01:00
|
|
|
protected void save(){
|
|
|
|
|
|
|
|
}
|
2014-03-19 16:28:52 +01:00
|
|
|
|
2014-03-19 16:48:15 +01:00
|
|
|
protected void close(){
|
|
|
|
batchReplaceDialog.close();
|
|
|
|
}
|
2014-03-18 18:22:39 +01:00
|
|
|
|
|
|
|
|
2014-03-17 18:59:08 +01:00
|
|
|
}
|