Fixed Final and Lock error
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-extractcodelist-widget@100243 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c6b9ea6739
commit
7af37b02df
|
@ -53,7 +53,7 @@ public class SourceColumnsSelectionCard extends WizardCard {
|
||||||
VerticalLayoutContainer content = new VerticalLayoutContainer();
|
VerticalLayoutContainer content = new VerticalLayoutContainer();
|
||||||
panel.add(content);
|
panel.add(content);
|
||||||
|
|
||||||
columnsGridPanel = new ColumnDataGridPanel();
|
columnsGridPanel = new ColumnDataGridPanel(this);
|
||||||
|
|
||||||
columnsGridPanel
|
columnsGridPanel
|
||||||
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
.addSelectionHandler(new SelectionHandler<ColumnData>() {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.portlets.user.td.columnwidget.client.properties.ExtractCodelist
|
||||||
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;
|
||||||
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.exception.TDGWTIsLockedException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistTargetColumn;
|
import org.gcube.portlets.user.td.gwtservice.shared.extract.ExtractCodelistTargetColumn;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
@ -229,7 +230,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void completedDefColumnCreation(DefNewColumn defNewColumn) {
|
public void completedDefColumnCreation(DefNewColumn defNewColumn) {
|
||||||
comboDefColumn.setValue(defNewColumn,true);
|
comboDefColumn.setValue(defNewColumn, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -239,7 +240,6 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
|
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
final ComboBox<DefNewColumn> comboDefColumn = new ComboBox<DefNewColumn>(
|
final ComboBox<DefNewColumn> comboDefColumn = new ComboBox<DefNewColumn>(
|
||||||
storeComboDefColumn, props.label());
|
storeComboDefColumn, props.label());
|
||||||
comboDefColumn.setItemId(COMBO_DEF_COLUMN);
|
comboDefColumn.setItemId(COMBO_DEF_COLUMN);
|
||||||
|
|
||||||
Log.debug("ComboDefColumn created");
|
Log.debug("ComboDefColumn created");
|
||||||
|
|
||||||
final CreateDefColumnListener createDefColumnListener = new CreateDefColumnListener() {
|
final CreateDefColumnListener createDefColumnListener = new CreateDefColumnListener() {
|
||||||
|
@ -291,7 +291,7 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void completedDefColumnCreation(DefNewColumn defNewColumn) {
|
public void completedDefColumnCreation(DefNewColumn defNewColumn) {
|
||||||
comboDefColumn.setValue(defNewColumn,true);
|
comboDefColumn.setValue(defNewColumn, true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +301,6 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
|
comboDefColumn.addTriggerClickHandler(new TriggerClickHandler() {
|
||||||
|
|
||||||
|
@ -324,8 +323,6 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
comboDefColumn.setEditable(false);
|
comboDefColumn.setEditable(false);
|
||||||
comboDefColumn.setTriggerAction(TriggerAction.ALL);
|
comboDefColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// comboColumn
|
// comboColumn
|
||||||
ColumnDataPropertiesCombo propsCod = GWT
|
ColumnDataPropertiesCombo propsCod = GWT
|
||||||
.create(ColumnDataPropertiesCombo.class);
|
.create(ColumnDataPropertiesCombo.class);
|
||||||
|
@ -343,16 +340,16 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
comboColumn.setWidth(COMBOWIDTH);
|
comboColumn.setWidth(COMBOWIDTH);
|
||||||
comboColumn.setEditable(false);
|
comboColumn.setEditable(false);
|
||||||
comboColumn.setTriggerAction(TriggerAction.ALL);
|
comboColumn.setTriggerAction(TriggerAction.ALL);
|
||||||
|
|
||||||
CheckBox checkNew = new CheckBox();
|
CheckBox checkNew = new CheckBox();
|
||||||
checkNew.setItemId(CHECK_NEW);
|
checkNew.setItemId(CHECK_NEW);
|
||||||
checkNew.setEnabled(true);
|
checkNew.setEnabled(true);
|
||||||
checkNew.setBoxLabel("New");
|
checkNew.setBoxLabel("New");
|
||||||
checkNew.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
checkNew.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
public void onValueChange(ValueChangeEvent<Boolean> event) {
|
||||||
if(event.getValue()){
|
if (event.getValue()) {
|
||||||
comboColumn.setVisible(false);
|
comboColumn.setVisible(false);
|
||||||
comboDefColumn.setVisible(true);
|
comboDefColumn.setVisible(true);
|
||||||
forceLayout();
|
forceLayout();
|
||||||
|
@ -361,18 +358,19 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
comboDefColumn.setVisible(false);
|
comboDefColumn.setVisible(false);
|
||||||
forceLayout();
|
forceLayout();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
HBoxLayoutContainer flowButton = new HBoxLayoutContainer();
|
||||||
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
flowButton.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
|
||||||
flowButton.setPack(BoxLayoutPack.START);
|
flowButton.setPack(BoxLayoutPack.START);
|
||||||
|
|
||||||
flowButton.add(checkNew, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(checkNew, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(comboColumn, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(comboColumn, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
||||||
flowButton.add(comboDefColumn, new BoxLayoutData(new Margins(2, 4, 2, 4)));
|
flowButton.add(comboDefColumn, new BoxLayoutData(
|
||||||
|
new Margins(2, 4, 2, 4)));
|
||||||
|
|
||||||
FieldLabel columnLabel = new FieldLabel(flowButton, label);
|
FieldLabel columnLabel = new FieldLabel(flowButton, label);
|
||||||
columnLabel.setId(col.getColumnId());
|
columnLabel.setId(col.getColumnId());
|
||||||
comboDefColumn.setVisible(false);
|
comboDefColumn.setVisible(false);
|
||||||
|
@ -434,10 +432,16 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
new SessionExpiredEvent(
|
new SessionExpiredEvent(
|
||||||
SessionExpiredType.EXPIREDONSERVER));
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
} else {
|
} else {
|
||||||
Log.debug("Error retrieving columns: "
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
+ caught.getLocalizedMessage());
|
Log.error(caught.getLocalizedMessage());
|
||||||
UtilsGXT3.alert("Error retrieving columns",
|
parent.showErrorAndHide("Error Locked",
|
||||||
"Error retrieving columns on server!");
|
caught.getLocalizedMessage(), caught);
|
||||||
|
} else {
|
||||||
|
Log.debug("Error retrieving columns: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error retrieving columns",
|
||||||
|
"Error retrieving columns on server!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -480,20 +484,20 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
|
|
||||||
public boolean updateExtractCodelistSession() {
|
public boolean updateExtractCodelistSession() {
|
||||||
targetColumns = new ArrayList<ExtractCodelistTargetColumn>();
|
targetColumns = new ArrayList<ExtractCodelistTargetColumn>();
|
||||||
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int lenght = formLayout.getWidgetCount();
|
int lenght = formLayout.getWidgetCount();
|
||||||
|
|
||||||
for (; i < lenght; i++) {
|
for (; i < lenght; i++) {
|
||||||
FieldLabel fieldLabel = (FieldLabel) formLayout.getWidget(i);
|
FieldLabel fieldLabel = (FieldLabel) formLayout.getWidget(i);
|
||||||
String columnId = fieldLabel.getId();
|
String columnId = fieldLabel.getId();
|
||||||
Log.debug("Field id:"+columnId);
|
Log.debug("Field id:" + columnId);
|
||||||
ColumnData colCurrent = null;
|
ColumnData colCurrent = null;
|
||||||
for (ColumnData col : parent.extractCodelistSession
|
for (ColumnData col : parent.extractCodelistSession
|
||||||
.getSourceColumns()) {
|
.getSourceColumns()) {
|
||||||
if (col.getColumnId().compareTo(columnId) == 0) {
|
if (col.getColumnId().compareTo(columnId) == 0) {
|
||||||
colCurrent = col;
|
colCurrent = col;
|
||||||
Log.debug("Column Match:"+colCurrent);
|
Log.debug("Column Match:" + colCurrent);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -501,53 +505,59 @@ public class TargetColumnsSelectionPanel extends FramedPanel implements
|
||||||
UtilsGXT3.alert("Error creating form", "Error creating form!");
|
UtilsGXT3.alert("Error creating form", "Error creating form!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(connection==null){
|
if (connection == null) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<DefNewColumn> comboDefColumn = ((ComboBox<DefNewColumn>) fieldLabel
|
ComboBox<DefNewColumn> comboDefColumn = ((ComboBox<DefNewColumn>) fieldLabel
|
||||||
.getWidget());
|
.getWidget());
|
||||||
DefNewColumn defNewColumn = comboDefColumn.getValue();
|
DefNewColumn defNewColumn = comboDefColumn.getValue();
|
||||||
Log.debug("Retrieved: "+defNewColumn.toString());
|
Log.debug("Retrieved: " + defNewColumn.toString());
|
||||||
ExtractCodelistTargetColumn extractCodelistTargetColumn = new ExtractCodelistTargetColumn(colCurrent, defNewColumn);
|
ExtractCodelistTargetColumn extractCodelistTargetColumn = new ExtractCodelistTargetColumn(
|
||||||
Log.debug("New TargetColumn: "+extractCodelistTargetColumn);
|
colCurrent, defNewColumn);
|
||||||
|
Log.debug("New TargetColumn: " + extractCodelistTargetColumn);
|
||||||
targetColumns.add(extractCodelistTargetColumn);
|
targetColumns.add(extractCodelistTargetColumn);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
HBoxLayoutContainer flowButton=(HBoxLayoutContainer) fieldLabel
|
HBoxLayoutContainer flowButton = (HBoxLayoutContainer) fieldLabel
|
||||||
.getWidget();
|
.getWidget();
|
||||||
CheckBox checkNew=(CheckBox)flowButton.getItemByItemId(CHECK_NEW);
|
CheckBox checkNew = (CheckBox) flowButton
|
||||||
if(checkNew==null){
|
.getItemByItemId(CHECK_NEW);
|
||||||
UtilsGXT3.alert("Error creating form", "Error creating form for check radio!");
|
if (checkNew == null) {
|
||||||
|
UtilsGXT3.alert("Error creating form",
|
||||||
|
"Error creating form for check radio!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(checkNew.getValue()){
|
if (checkNew.getValue()) {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<DefNewColumn> comboDefColumn = (ComboBox<DefNewColumn>)flowButton.getItemByItemId(COMBO_DEF_COLUMN);
|
ComboBox<DefNewColumn> comboDefColumn = (ComboBox<DefNewColumn>) flowButton
|
||||||
|
.getItemByItemId(COMBO_DEF_COLUMN);
|
||||||
DefNewColumn defNewColumn = comboDefColumn.getValue();
|
DefNewColumn defNewColumn = comboDefColumn.getValue();
|
||||||
Log.debug("Retrieved: "+defNewColumn.toString());
|
Log.debug("Retrieved: " + defNewColumn.toString());
|
||||||
ExtractCodelistTargetColumn extractCodelistTargetCol = new ExtractCodelistTargetColumn(colCurrent, defNewColumn);
|
ExtractCodelistTargetColumn extractCodelistTargetCol = new ExtractCodelistTargetColumn(
|
||||||
Log.debug("New TargetColumn:"+extractCodelistTargetCol);
|
colCurrent, defNewColumn);
|
||||||
|
Log.debug("New TargetColumn:" + extractCodelistTargetCol);
|
||||||
targetColumns.add(extractCodelistTargetCol);
|
targetColumns.add(extractCodelistTargetCol);
|
||||||
} else {
|
} else {
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
ComboBox<ColumnData> comboColumn=(ComboBox<ColumnData>)flowButton.getItemByItemId(COMBO_COLUMN);
|
ComboBox<ColumnData> comboColumn = (ComboBox<ColumnData>) flowButton
|
||||||
ColumnData columnData=comboColumn.getCurrentValue();
|
.getItemByItemId(COMBO_COLUMN);
|
||||||
if(columnData==null){
|
ColumnData columnData = comboColumn.getCurrentValue();
|
||||||
|
if (columnData == null) {
|
||||||
UtilsGXT3.alert("Attention", "Fill all column!");
|
UtilsGXT3.alert("Attention", "Fill all column!");
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
ExtractCodelistTargetColumn extractCodelistTargetC = new ExtractCodelistTargetColumn(
|
ExtractCodelistTargetColumn extractCodelistTargetC = new ExtractCodelistTargetColumn(
|
||||||
colCurrent, columnData, connection.getTrId());
|
colCurrent, columnData, connection.getTrId());
|
||||||
Log.debug("New TargetColumn:"+extractCodelistTargetC);
|
Log.debug("New TargetColumn:" + extractCodelistTargetC);
|
||||||
targetColumns.add(extractCodelistTargetC);
|
targetColumns.add(extractCodelistTargetC);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.debug("UpdateExtractCodelistSession:"+targetColumns);
|
Log.debug("UpdateExtractCodelistSession:" + targetColumns);
|
||||||
parent.extractCodelistSession.setTargetColumns(targetColumns);
|
parent.extractCodelistSession.setTargetColumns(targetColumns);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,13 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
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.exception.TDGWTIsLockedException;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.WizardCard;
|
||||||
|
import org.gcube.portlets.user.td.wizardwidget.client.util.UtilsGXT3;
|
||||||
|
|
||||||
import com.allen_sauer.gwt.log.client.Log;
|
import com.allen_sauer.gwt.log.client.Log;
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
@ -35,35 +41,34 @@ import com.sencha.gxt.widget.core.client.grid.Grid;
|
||||||
|
|
||||||
public class ColumnDataGridPanel extends ContentPanel implements
|
public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
HasSelectionHandlers<ColumnData> {
|
HasSelectionHandlers<ColumnData> {
|
||||||
protected static final int GRIDHEIGHT=360;
|
protected static final int GRIDHEIGHT = 360;
|
||||||
|
|
||||||
protected static final ColumnDataProperties props = GWT
|
protected static final ColumnDataProperties props = GWT
|
||||||
.create(ColumnDataProperties.class);
|
.create(ColumnDataProperties.class);
|
||||||
|
|
||||||
protected final CheckBoxSelectionModel<ColumnData> sm;
|
protected final CheckBoxSelectionModel<ColumnData> sm;
|
||||||
|
|
||||||
protected final Grid<ColumnData> grid;
|
protected final Grid<ColumnData> grid;
|
||||||
|
|
||||||
public ColumnDataGridPanel() {
|
private WizardCard parent;
|
||||||
|
|
||||||
|
public ColumnDataGridPanel(WizardCard parent) {
|
||||||
|
this.parent = parent;
|
||||||
Log.debug("ColumnDataGridPanel");
|
Log.debug("ColumnDataGridPanel");
|
||||||
setHeadingText("Columns");
|
setHeadingText("Columns");
|
||||||
|
|
||||||
|
|
||||||
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
ColumnConfig<ColumnData, String> labelCol = new ColumnConfig<ColumnData, String>(
|
||||||
props.label());
|
props.label());
|
||||||
|
|
||||||
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
IdentityValueProvider<ColumnData> identity = new IdentityValueProvider<ColumnData>();
|
||||||
|
|
||||||
sm = new CheckBoxSelectionModel<ColumnData>(
|
sm = new CheckBoxSelectionModel<ColumnData>(identity);
|
||||||
identity);
|
|
||||||
|
|
||||||
|
|
||||||
List<ColumnConfig<ColumnData, ?>> l = new ArrayList<ColumnConfig<ColumnData, ?>>();
|
List<ColumnConfig<ColumnData, ?>> l = new ArrayList<ColumnConfig<ColumnData, ?>>();
|
||||||
l.add(sm.getColumn());
|
l.add(sm.getColumn());
|
||||||
l.add(labelCol);
|
l.add(labelCol);
|
||||||
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(l);
|
ColumnModel<ColumnData> cm = new ColumnModel<ColumnData>(l);
|
||||||
|
|
||||||
|
|
||||||
ListStore<ColumnData> store = new ListStore<ColumnData>(props.id());
|
ListStore<ColumnData> store = new ListStore<ColumnData>(props.id());
|
||||||
|
|
||||||
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
|
RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>> proxy = new RpcProxy<ListLoadConfig, ListLoadResult<ColumnData>>() {
|
||||||
|
@ -86,7 +91,7 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
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();
|
||||||
}
|
}
|
||||||
|
@ -94,21 +99,18 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sm.setSelectionMode(SelectionMode.MULTI);
|
||||||
sm.setSelectionMode(SelectionMode.MULTI);
|
|
||||||
grid.setLoader(loader);
|
grid.setLoader(loader);
|
||||||
grid.setSelectionModel(sm);
|
grid.setSelectionModel(sm);
|
||||||
grid.setHeight(GRIDHEIGHT);
|
grid.setHeight(GRIDHEIGHT);
|
||||||
//grid.getView().setAutoExpandColumn(labelCol);
|
// grid.getView().setAutoExpandColumn(labelCol);
|
||||||
grid.getView().setStripeRows(true);
|
grid.getView().setStripeRows(true);
|
||||||
grid.getView().setColumnLines(true);
|
grid.getView().setColumnLines(true);
|
||||||
grid.getView().setAutoFill(true);
|
grid.getView().setAutoFill(true);
|
||||||
grid.setBorders(false);
|
grid.setBorders(false);
|
||||||
grid.setLoadMask(true);
|
grid.setLoadMask(true);
|
||||||
grid.setColumnReordering(true);
|
grid.setColumnReordering(true);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
VerticalLayoutContainer con = new VerticalLayoutContainer();
|
VerticalLayoutContainer con = new VerticalLayoutContainer();
|
||||||
con.setScrollMode(ScrollMode.AUTO);
|
con.setScrollMode(ScrollMode.AUTO);
|
||||||
con.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
con.add(grid, new VerticalLayoutData(-1, -1, new Margins(0)));
|
||||||
|
@ -125,10 +127,25 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
TDGWTServiceAsync.INSTANCE
|
TDGWTServiceAsync.INSTANCE
|
||||||
.getColumns(new AsyncCallback<ArrayList<ColumnData>>() {
|
.getColumns(new AsyncCallback<ArrayList<ColumnData>>() {
|
||||||
|
|
||||||
|
|
||||||
public void onFailure(Throwable caught) {
|
public void onFailure(Throwable caught) {
|
||||||
Log.error("No load columns: "
|
if (caught instanceof TDGWTSessionExpiredException) {
|
||||||
+ caught.getLocalizedMessage());
|
parent.getEventBus()
|
||||||
|
.fireEvent(
|
||||||
|
new SessionExpiredEvent(
|
||||||
|
SessionExpiredType.EXPIREDONSERVER));
|
||||||
|
} else {
|
||||||
|
if (caught instanceof TDGWTIsLockedException) {
|
||||||
|
Log.error(caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error Locked",
|
||||||
|
caught.getLocalizedMessage());
|
||||||
|
} else {
|
||||||
|
Log.error("No columns loaded: "
|
||||||
|
+ caught.getLocalizedMessage());
|
||||||
|
UtilsGXT3.alert("Error",
|
||||||
|
"No columns loaded: "+caught.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
callback.onFailure(caught);
|
callback.onFailure(caught);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,11 +160,10 @@ public class ColumnDataGridPanel extends ContentPanel implements
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<ColumnData> getSelectedItems() {
|
public ArrayList<ColumnData> getSelectedItems() {
|
||||||
return new ArrayList<ColumnData>(grid
|
return new ArrayList<ColumnData>(grid.getSelectionModel()
|
||||||
.getSelectionModel().getSelectedItems());
|
.getSelectedItems());
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public HandlerRegistration addSelectionHandler(
|
public HandlerRegistration addSelectionHandler(
|
||||||
SelectionHandler<ColumnData> handler) {
|
SelectionHandler<ColumnData> handler) {
|
||||||
|
|
Loading…
Reference in New Issue