Fixed Delete Column Panel
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@95340 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
28b8e7b5c9
commit
ae1528cbc1
|
@ -3048,3 +3048,53 @@ 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...
|
||||||
|
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: 3 seconds)
|
||||||
|
80% complete (ETR: 2 seconds)
|
||||||
|
90% complete (ETR: 1 seconds)
|
||||||
|
100% complete (ETR: 0 seconds)
|
||||||
|
Compilation completed in 13.53 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...
|
||||||
|
0% complete (ETR: 54 seconds)
|
||||||
|
10% complete (ETR: 48 seconds)
|
||||||
|
20% complete (ETR: 27 seconds)
|
||||||
|
30% complete (ETR: 17 seconds)
|
||||||
|
40% complete (ETR: 12 seconds)
|
||||||
|
50% complete (ETR: 9 seconds)
|
||||||
|
60% complete (ETR: 7 seconds)
|
||||||
|
70% complete (ETR: 4 seconds)
|
||||||
|
80% complete (ETR: 3 seconds)
|
||||||
|
90% complete (ETR: 1 seconds)
|
||||||
|
100% complete (ETR: 0 seconds)
|
||||||
|
Compilation completed in 18.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
|
||||||
|
|
|
@ -5,7 +5,7 @@ import java.util.ArrayList;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectionDialog;
|
import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectionDialog;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectionListener;
|
import org.gcube.portlets.user.td.columnwidget.client.dimension.CodelistSelectionListener;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.progress.ChangeColumnTypeProgressDialog;
|
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.ColumnDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataTypeProperties;
|
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.ColumnTypeCodeProperties;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.LocaleTypeProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.LocaleTypeProperties;
|
||||||
|
@ -126,8 +126,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
+ " columnName: " + columnName + "]");
|
+ " columnName: " + columnName + "]");
|
||||||
|
|
||||||
// Column Data
|
// Column Data
|
||||||
ColumnDataProperties propsColumnData = GWT
|
ColumnDataPropertiesCombo propsColumnData = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
||||||
propsColumnData.id());
|
propsColumnData.id());
|
||||||
|
|
||||||
|
@ -287,8 +287,8 @@ public class ChangeColumnTypePanel extends FramedPanel implements
|
||||||
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
|
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
|
||||||
|
|
||||||
// ColumnReferenceType
|
// ColumnReferenceType
|
||||||
ColumnDataProperties propsColumnReferenceType = GWT
|
ColumnDataPropertiesCombo propsColumnReferenceType = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
storeComboColumnReferenceType = new ListStore<ColumnData>(
|
storeComboColumnReferenceType = new ListStore<ColumnData>(
|
||||||
propsColumnReferenceType.id());
|
propsColumnReferenceType.id());
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.portlets.user.td.columnwidget.client;
|
package org.gcube.portlets.user.td.columnwidget.client;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.progress.DeleteColumnProgressDialog;
|
import org.gcube.portlets.user.td.columnwidget.client.progress.DeleteColumnProgressDialog;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
|
||||||
|
@ -14,34 +15,35 @@ import com.allen_sauer.gwt.log.client.Log;
|
||||||
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;
|
||||||
import com.google.gwt.event.logical.shared.SelectionEvent;
|
|
||||||
import com.google.gwt.event.logical.shared.SelectionHandler;
|
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
import com.google.web.bindery.event.shared.EventBus;
|
import com.google.web.bindery.event.shared.EventBus;
|
||||||
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
|
import com.sencha.gxt.core.client.IdentityValueProvider;
|
||||||
|
import com.sencha.gxt.core.client.Style.SelectionMode;
|
||||||
|
import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
||||||
import com.sencha.gxt.core.client.util.Margins;
|
import com.sencha.gxt.core.client.util.Margins;
|
||||||
import com.sencha.gxt.data.client.loader.RpcProxy;
|
import com.sencha.gxt.data.client.loader.RpcProxy;
|
||||||
import com.sencha.gxt.data.shared.LabelProvider;
|
|
||||||
import com.sencha.gxt.data.shared.ListStore;
|
import com.sencha.gxt.data.shared.ListStore;
|
||||||
|
import com.sencha.gxt.data.shared.event.StoreDataChangeEvent;
|
||||||
|
import com.sencha.gxt.data.shared.event.StoreDataChangeEvent.StoreDataChangeHandler;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
import com.sencha.gxt.data.shared.loader.ListLoadConfig;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadConfigBean;
|
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
import com.sencha.gxt.data.shared.loader.ListLoadResult;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
||||||
import com.sencha.gxt.data.shared.loader.ListLoader;
|
import com.sencha.gxt.data.shared.loader.ListLoader;
|
||||||
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
||||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||||
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.button.TextButton;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||||
|
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
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.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;
|
||||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
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.FieldLabel;
|
||||||
import com.sencha.gxt.widget.core.client.form.TextField;
|
import com.sencha.gxt.widget.core.client.form.TextField;
|
||||||
import com.sencha.gxt.widget.core.client.info.Info;
|
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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -61,13 +63,17 @@ public class DeleteColumnPanel extends FramedPanel {
|
||||||
protected TRId trId;
|
protected TRId trId;
|
||||||
protected String columnName;
|
protected String columnName;
|
||||||
protected ColumnData column;
|
protected ColumnData column;
|
||||||
protected ComboBox<ColumnData> comboColumn = null;
|
|
||||||
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
|
||||||
|
|
||||||
protected TextButton delete;
|
protected TextButton delete;
|
||||||
|
|
||||||
|
protected ListLoader<ListLoadConfig, ListLoadResult<ColumnData>> loader;
|
||||||
|
protected Grid<ColumnData> grid;
|
||||||
|
protected CheckBoxSelectionModel<ColumnData> sm;
|
||||||
|
protected FieldLabel columnsSelectLabel;
|
||||||
|
|
||||||
protected DeleteColumnSession deleteColumnSession;
|
protected DeleteColumnSession deleteColumnSession;
|
||||||
protected DeleteColumnProgressDialog deleteColumnProgressDialog;
|
protected DeleteColumnProgressDialog deleteColumnProgressDialog;
|
||||||
|
private ListStore<ColumnData> store;
|
||||||
|
|
||||||
public DeleteColumnPanel(TRId trId, String columnName, EventBus eventBus) {
|
public DeleteColumnPanel(TRId trId, String columnName, EventBus eventBus) {
|
||||||
setWidth(WIDTH);
|
setWidth(WIDTH);
|
||||||
|
@ -80,13 +86,42 @@ public class DeleteColumnPanel extends FramedPanel {
|
||||||
Log.debug("DeleteColumnPanel(): [" + trId.toString()
|
Log.debug("DeleteColumnPanel(): [" + trId.toString()
|
||||||
+ " columnName: " + columnName + "]");
|
+ " columnName: " + columnName + "]");
|
||||||
|
|
||||||
// Column Data
|
|
||||||
ColumnDataProperties propsColumnData = GWT
|
|
||||||
.create(ColumnDataProperties.class);
|
|
||||||
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
|
||||||
propsColumnData.id());
|
|
||||||
|
|
||||||
Log.trace("StoreCombo created");
|
build();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void build(){
|
||||||
|
ColumnDataProperties props = GWT.create(ColumnDataProperties.class);
|
||||||
|
|
||||||
|
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
||||||
|
props.label());
|
||||||
|
|
||||||
|
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
||||||
|
sm = new CheckBoxSelectionModel<ColumnData>(identity);
|
||||||
|
|
||||||
|
List<ColumnConfig<ColumnData, ?>> l = new ArrayList<ColumnConfig<ColumnData, ?>>();
|
||||||
|
l.add(sm.getColumn());
|
||||||
|
l.add(labelCol);
|
||||||
|
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(l);
|
||||||
|
|
||||||
|
store = new ListStore<ColumnData>(props.id());
|
||||||
|
|
||||||
|
store.addStoreDataChangeHandler(new StoreDataChangeHandler<ColumnData>(){
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataChange(StoreDataChangeEvent<ColumnData> event) {
|
||||||
|
List<ColumnData> cols=event.getSource().getAll();
|
||||||
|
Log.debug("Columns:"+cols.size());
|
||||||
|
for(ColumnData c:cols){
|
||||||
|
if(c.getName().compareTo(columnName)==0){
|
||||||
|
sm.select(c, false);
|
||||||
|
sm.refresh();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
|
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
|
||||||
|
|
||||||
|
@ -95,105 +130,99 @@ public class DeleteColumnPanel extends FramedPanel {
|
||||||
loadData(loadConfig, callback);
|
loadData(loadConfig, callback);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
loader = new ListLoader<ListLoadConfig, ListLoadResult<ColumnData>>(
|
loader = new ListLoader<ListLoadConfig, ListLoadResult<ColumnData>>(
|
||||||
proxy) {
|
proxy);
|
||||||
@Override
|
|
||||||
protected ListLoadConfig newLoadConfig() {
|
|
||||||
return (ListLoadConfig) new ListLoadConfigBean();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
loader.setRemoteSort(false);
|
||||||
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, ColumnData, ListLoadResult<ColumnData>>(
|
loader.addLoadHandler(new LoadResultListStoreBinding<ListLoadConfig, ColumnData, ListLoadResult<ColumnData>>(
|
||||||
storeCombo));
|
store) {
|
||||||
Log.trace("LoaderCombo created");
|
});
|
||||||
|
|
||||||
comboColumn = new ComboBox<ColumnData>(storeCombo,
|
|
||||||
propsColumnData.label()) {
|
|
||||||
|
|
||||||
|
grid = new Grid<ColumnData>(store, cm) {
|
||||||
|
@Override
|
||||||
protected void onAfterFirstAttach() {
|
protected void onAfterFirstAttach() {
|
||||||
super.onAfterFirstAttach();
|
super.onAfterFirstAttach();
|
||||||
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
|
||||||
|
|
||||||
public void execute() {
|
public void execute() {
|
||||||
loader.load();
|
loader.load();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Log.trace("Combo ColumnData created");
|
|
||||||
|
|
||||||
addHandlersForComboColumn(propsColumnData.label());
|
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);
|
||||||
|
|
||||||
comboColumn.setLoader(loader);
|
// Delete Button
|
||||||
comboColumn.setEmptyText("Select a column...");
|
delete = new TextButton("Delete");
|
||||||
comboColumn.setWidth(150);
|
SelectHandler deleteHandler = new SelectHandler() {
|
||||||
comboColumn.setTypeAhead(false);
|
|
||||||
comboColumn.setEditable(false);
|
|
||||||
comboColumn.setTriggerAction(TriggerAction.ALL);
|
|
||||||
|
|
||||||
|
|
||||||
delete=new TextButton("Delete");
|
|
||||||
delete.addSelectHandler(new SelectHandler() {
|
|
||||||
|
|
||||||
public void onSelect(SelectEvent event) {
|
public void onSelect(SelectEvent event) {
|
||||||
onDeleteColumn();
|
onDeleteColumns();
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
delete.addSelectHandler(deleteHandler);
|
||||||
|
|
||||||
|
FieldLabel columnsLabel = new FieldLabel(null, "Columns");
|
||||||
|
columnsLabel.getElement().applyStyles("font-weight:bold");
|
||||||
|
HBoxLayoutContainer hBox=new HBoxLayoutContainer();
|
||||||
|
hBox.add(delete,new BoxLayoutData(new Margins(2,5,2,5)));
|
||||||
|
|
||||||
|
|
||||||
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
VerticalLayoutContainer v = new VerticalLayoutContainer();
|
||||||
v.add(new FieldLabel(comboColumn, "Column"), new VerticalLayoutData(1,
|
v.setScrollMode(ScrollMode.AUTO);
|
||||||
-1));
|
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2,1,5,1)));
|
||||||
v.add(delete, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
|
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
|
||||||
add(v, new VerticalLayoutData(-1, -1, new Margins()));
|
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0,
|
||||||
|
10, 0)));
|
||||||
|
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addHandlersForComboColumn(
|
|
||||||
final LabelProvider<ColumnData> labelProvider) {
|
|
||||||
comboColumn.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
protected ArrayList<ColumnData> getSelectedItems() {
|
||||||
public void onSelection(SelectionEvent<ColumnData> event) {
|
return new ArrayList<ColumnData>(grid.getSelectionModel()
|
||||||
Info.display(
|
.getSelectedItems());
|
||||||
"Column Selected",
|
|
||||||
"You selected "
|
|
||||||
+ (event.getSelectedItem() == null ? "nothing"
|
|
||||||
: labelProvider.getLabel(event
|
|
||||||
.getSelectedItem()) + "!"));
|
|
||||||
Log.debug("ComboColumn selected: " + event.getSelectedItem());
|
|
||||||
ColumnData columnData = event.getSelectedItem();
|
|
||||||
updateComboStatus(columnData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
public void update(TRId trId, String columnName) {
|
||||||
|
this.trId = trId;
|
||||||
|
this.columnName=columnName;
|
||||||
|
loader.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void loadData(ListLoadConfig loadConfig,
|
protected void loadData(ListLoadConfig loadConfig,
|
||||||
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
|
final AsyncCallback<ListLoadResult<ColumnData>> callback) {
|
||||||
TDGWTServiceAsync.INSTANCE.getColumns(trId,
|
TDGWTServiceAsync.INSTANCE.getColumns(trId,
|
||||||
new AsyncCallback<ArrayList<ColumnData>>() {
|
new AsyncCallback<ArrayList<ColumnData>>() {
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("load combo failure:"
|
Log.error("load columns failure:"
|
||||||
+ caught.getLocalizedMessage());
|
+ caught.getLocalizedMessage());
|
||||||
AlertMessageBox d = new AlertMessageBox("Error",
|
UtilsGXT3.alert("Error retrieving columns",
|
||||||
"Error retrieving columns of tabular resource:"
|
"Error retrieving columns");
|
||||||
+ trId.getId());
|
|
||||||
d.addHideHandler(new HideHandler() {
|
|
||||||
|
|
||||||
public void onHide(HideEvent event) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
d.show();
|
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onSuccess(ArrayList<ColumnData> result) {
|
public void onSuccess(ArrayList<ColumnData> result) {
|
||||||
Log.trace("loaded " + result.size() + " ColumnData");
|
Log.trace("loaded " + result.size() + " ColumnData");
|
||||||
setComboStatus(result);
|
|
||||||
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
callback.onSuccess(new ListLoadResultBean<ColumnData>(
|
||||||
result));
|
result));
|
||||||
|
|
||||||
|
@ -203,42 +232,23 @@ public class DeleteColumnPanel extends FramedPanel {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setComboStatus(ArrayList<ColumnData> result) {
|
|
||||||
Log.debug("ColumnName:" + columnName);
|
|
||||||
if (columnName != null) {
|
|
||||||
for (ColumnData cd : result) {
|
|
||||||
Log.debug("ColumnData name:" + cd.getName());
|
|
||||||
if (cd.getName().compareTo(columnName) == 0) {
|
|
||||||
updateComboStatus(cd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void updateComboStatus(ColumnData cd) {
|
|
||||||
Log.debug("ColumnData: " + cd.toString());
|
|
||||||
deleteColumnSession = new DeleteColumnSession();
|
|
||||||
deleteColumnSession.setColumnData(cd);
|
|
||||||
comboColumn.setValue(cd);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void update(TRId trId, String columnName) {
|
|
||||||
this.trId = trId;
|
|
||||||
this.columnName = columnName;
|
|
||||||
loader.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onDeleteColumn() {
|
protected void onDeleteColumns() {
|
||||||
|
ArrayList<ColumnData> columns=getSelectedItems();
|
||||||
ColumnData columnData = comboColumn.getCurrentValue();
|
if(columns==null||columns.size()<1){
|
||||||
if(columnData!=null){
|
UtilsGXT3.alert("Attention",
|
||||||
callDeleteColumn();
|
"Attention no column selected!");
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
UtilsGXT3.alert("Attention", "Select a column!");
|
callDeleteColumn(columns);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void callDeleteColumn() {
|
private void callDeleteColumn(ArrayList<ColumnData> columns) {
|
||||||
|
deleteColumnSession=new DeleteColumnSession(trId,columns);
|
||||||
|
|
||||||
TDGWTServiceAsync.INSTANCE.startDeleteColumn(
|
TDGWTServiceAsync.INSTANCE.startDeleteColumn(
|
||||||
deleteColumnSession, new AsyncCallback<Void>() {
|
deleteColumnSession, new AsyncCallback<Void>() {
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.progress.LabelColumnProgressDialog;
|
import org.gcube.portlets.user.td.columnwidget.client.progress.LabelColumnProgressDialog;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
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.client.rpc.TDGWTServiceAsync;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
@ -78,8 +78,8 @@ public class LabelColumnPanel extends FramedPanel {
|
||||||
+ " columnName: " + columnName + "]");
|
+ " columnName: " + columnName + "]");
|
||||||
|
|
||||||
// Column Data
|
// Column Data
|
||||||
ColumnDataProperties propsColumnData = GWT
|
ColumnDataPropertiesCombo propsColumnData = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
ListStore<ColumnData> storeCombo = new ListStore<ColumnData>(
|
||||||
propsColumnData.id());
|
propsColumnData.id());
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ package org.gcube.portlets.user.td.columnwidget.client.dimension;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.ColumnDataPropertiesCombo;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProperties;
|
import org.gcube.portlets.user.td.columnwidget.client.properties.TabResourceProperties;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
|
||||||
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
|
||||||
|
@ -91,8 +91,8 @@ public class ConnectCodelistDialog extends Window implements
|
||||||
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
|
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, "Codelist");
|
||||||
|
|
||||||
// ColumnReferenceType
|
// ColumnReferenceType
|
||||||
ColumnDataProperties propsColumnReferenceType = GWT
|
ColumnDataPropertiesCombo propsColumnReferenceType = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
storeComboColumnReferenceType = new ListStore<ColumnData>(
|
storeComboColumnReferenceType = new ListStore<ColumnData>(
|
||||||
propsColumnReferenceType.id());
|
propsColumnReferenceType.id());
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ package org.gcube.portlets.user.td.columnwidget.client.properties;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
|
||||||
import com.google.gwt.editor.client.Editor.Path;
|
import com.google.gwt.editor.client.Editor.Path;
|
||||||
import com.sencha.gxt.data.shared.LabelProvider;
|
import com.sencha.gxt.core.client.ValueProvider;
|
||||||
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
import com.sencha.gxt.data.shared.ModelKeyProvider;
|
||||||
import com.sencha.gxt.data.shared.PropertyAccess;
|
import com.sencha.gxt.data.shared.PropertyAccess;
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ public interface ColumnDataProperties extends
|
||||||
@Path("id")
|
@Path("id")
|
||||||
ModelKeyProvider<ColumnData> id();
|
ModelKeyProvider<ColumnData> id();
|
||||||
|
|
||||||
LabelProvider<ColumnData> label();
|
ValueProvider<ColumnData,String> label();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package org.gcube.portlets.user.td.columnwidget.client.properties;
|
||||||
|
|
||||||
|
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;
|
||||||
|
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 ColumnDataPropertiesCombo extends
|
||||||
|
PropertyAccess<ColumnData> {
|
||||||
|
|
||||||
|
@Path("id")
|
||||||
|
ModelKeyProvider<ColumnData> id();
|
||||||
|
|
||||||
|
LabelProvider<ColumnData> label();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue