915: TDM - Support the Spanish language

Task-Url: https://support.d4science.org/issues/915

Updated Spanish support

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@119668 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-10-13 13:05:13 +00:00
parent 47be88eb77
commit 1d5f607051
38 changed files with 531 additions and 261 deletions

View File

@ -39,7 +39,7 @@ Documentation
tabular-data-column-widget allows to perform operations on the columns of a tabular resource
Documentation is available on-line from the Projects Documentation Wiki:
https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager
http://wiki.gcube-system.org/gcube/Tabular_Data_Manager
Licensing

View File

@ -39,7 +39,7 @@
<distroDirectory>${project.basedir}/distro</distroDirectory>
<webappDirectory>${project.build.directory}/${project.build.finalName}</webappDirectory>
<release.date>2015-10-15</release.date>
<wikiurl>https://gcube.wiki.gcube-system.org/gcube/index.php/Tabular_Data_Manager</wikiurl>
<wikiurl>http://wiki.gcube-system.org/gcube/Tabular_Data_Manager</wikiurl>
<templatesDirectory>templates</templatesDirectory>
<distroDirectory>distro</distroDirectory>
<configDirectory>config</configDirectory>

View File

@ -31,7 +31,7 @@ public class ChangeColumnTypeDialog extends Window {
}
protected void create(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(ChangeColumnTypeMessages.class);
initMessages();
initWindow();
ChangeColumnTypePanel changeColumnTypePanel = new ChangeColumnTypePanel(
trId, columnName, eventBus);
@ -39,6 +39,10 @@ public class ChangeColumnTypeDialog extends Window {
}
protected void initMessages(){
msgs = GWT.create(ChangeColumnTypeMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);

View File

@ -32,6 +32,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMapp
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -150,9 +151,9 @@ public class ChangeColumnTypePanel extends FramedPanel implements
private ChangeColumnTypeSession changeColumnTypeSession;
private boolean panelCreated;
private ChangeColumnTypeMessages msgs;
private CommonMessages msgsCommon;
public ChangeColumnTypePanel(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(ChangeColumnTypeMessages.class);
setWidth(WIDTH);
setHeight(HEIGHT);
setHeaderVisible(false);
@ -161,9 +162,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements
this.columnName = columnName;
this.eventBus = eventBus;
panelCreated = false;
initMessages();
retrieveValueDataFormatMap();
}
protected void initMessages(){
msgs = GWT.create(ChangeColumnTypeMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void retrieveValueDataFormatMap() {
@ -179,7 +186,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
Log.debug("Error retrieving value data formats map: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
UtilsGXT3.alert(msgsCommon.error(),
msgs.errorRetrievingValueDataFormatsMap());
}
@ -214,12 +221,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving column: "
@ -237,7 +244,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
public void onSuccess(ColumnData result) {
Log.debug("Retrieved Column: " + result);
if (result == null) {
UtilsGXT3.alert("Error",
UtilsGXT3.alert(msgsCommon.error(),
msgs.requestColumnIsNull());
}
columnRequested = result;
@ -864,17 +871,17 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load combo failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
UtilsGXT3.alert(msgsCommon.error(),
msgs.errorRetrievingColumnsOfTabularResource()
+ trId.getId());
}
@ -1042,12 +1049,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load column failure:"
@ -1105,7 +1112,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
}
}
// TODO
//
protected void configureBtnChange(ColumnTypeCode columnTypeCode) {
ColumnTypeCode sourceTypeCode = ColumnTypeCode
.getColumnTypeCodeFromId(sourceColumnChangeType.getTypeCode());
@ -1178,17 +1185,17 @@ public class ChangeColumnTypePanel extends FramedPanel implements
.setValueDataFormat(valueDataFormat);
callChangeColumnType();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.typeFormatNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -1211,15 +1218,15 @@ public class ChangeColumnTypePanel extends FramedPanel implements
.setValueDataFormat(valueDataFormat);
callChangeColumnType();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.typeFormatNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -1236,7 +1243,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
.getLocaleName());
callChangeColumnType();
} else {
UtilsGXT3.alert("Attention", msgs.noLocaleSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noLocaleSelected());
}
break;
case CODEDESCRIPTION:
@ -1262,7 +1269,7 @@ public class ChangeColumnTypePanel extends FramedPanel implements
.setCodelistColumnReference(columnReference);
callChangeColumnType();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.referenceColumnNotSelected());
}
break;
@ -1280,25 +1287,25 @@ public class ChangeColumnTypePanel extends FramedPanel implements
.setValueDataFormat(timeDataFormat);
callChangeColumnType();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.timeFormatNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.periodTypeNotSelected());
}
break;
default:
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.thisColumnTypeIsNotSupportedForNow());
break;
}
} else {
UtilsGXT3.alert("Attention", msgs.selectAColumnType());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAColumnType());
}
} else {
UtilsGXT3.alert("Attention", msgs.selectAColumn());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAColumn());
}
}
@ -1312,12 +1319,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Change Column Type Error: "
@ -1379,12 +1386,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving columns: "
@ -1422,12 +1429,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving columns: "
@ -1467,12 +1474,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving tabular resource: "
@ -1509,12 +1516,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(caught.getLocalizedMessage());
@ -1555,12 +1562,12 @@ public class ChangeColumnTypePanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(caught.getLocalizedMessage());
@ -1597,19 +1604,19 @@ public class ChangeColumnTypePanel extends FramedPanel implements
protected void callColumnMappingDialog() {
ColumnData selectedColumn = comboColumn.getCurrentValue();
if (selectedColumn == null) {
UtilsGXT3.alert("Attention", msgs.columnNotSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.columnNotSelected());
return;
}
TabResource dimensionTR = comboDimensionType.getValue();
if (dimensionTR == null) {
UtilsGXT3.alert("Attention", msgs.codelistNotSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.codelistNotSelected());
return;
}
ColumnData referenceColumn = comboColumnReferenceType.getValue();
if (referenceColumn == null) {
UtilsGXT3.alert("Attention", msgs.referenceColumnNotSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.referenceColumnNotSelected());
return;
}

View File

@ -29,13 +29,16 @@ public class DeleteColumnDialog extends Window {
}
protected void create(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(DeleteColumnMessages.class);
initMessages();
initWindow();
DeleteColumnPanel deleteColumnPanel= new DeleteColumnPanel(trId, columnName, eventBus);
add(deleteColumnPanel);
}
protected void initMessages(){
msgs = GWT.create(DeleteColumnMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);

View File

@ -23,5 +23,20 @@ public interface DeleteColumnMessages extends Messages {
//
@DefaultMessage("Columns")
String columnsLabel();
@DefaultMessage("Error retrieving columns")
String errorRetrievingColumnsHead();
@DefaultMessage("Error retrieving columns on server!")
String errorRetrievingColumns();
@DefaultMessage("Attention no column selected!")
String attentionNoColumnSelected();
@DefaultMessage("Delete Column Error")
String deleteColumnErrorHead();
@DefaultMessage("Error in invocation of delete column operation!")
String deleteColumnError();
}

View File

@ -13,6 +13,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.DeleteColumnSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -86,18 +87,26 @@ public class DeleteColumnPanel extends FramedPanel implements
private ListStore<ColumnData> store;
private DeleteColumnMessages msgs;
private CommonMessages msgsCommon;
public DeleteColumnPanel(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(DeleteColumnMessages.class);
this.trId = trId;
this.columnName = columnName;
this.eventBus = eventBus;
Log.debug("DeleteColumnPanel(): [" + trId.toString() + " columnName: "
+ columnName + "]");
initMessages();
init();
build();
}
protected void initMessages(){
msgs = GWT.create(DeleteColumnMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
public void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -235,18 +244,18 @@ public class DeleteColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
UtilsGXT3.alert(msgs.errorRetrievingColumnsHead(),
msgs.errorRetrievingColumns());
}
}
}
@ -277,7 +286,7 @@ public class DeleteColumnPanel extends FramedPanel implements
protected void onDeleteColumns() {
ArrayList<ColumnData> columns = getSelectedItems();
if (columns == null || columns.size() < 1) {
UtilsGXT3.alert("Attention", "Attention no column selected!");
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoColumnSelected());
return;
} else {
callDeleteColumn(columns);
@ -297,19 +306,19 @@ public class DeleteColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Delete Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Delete Column Error ",
"Error in invocation of delete column operation!");
.alert(msgs.deleteColumnErrorHead(),
msgs.deleteColumnError());
}
}
}

View File

@ -30,13 +30,19 @@ public class LabelColumnDialog extends Window {
}
protected void create(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(LabelColumnMessages.class);
initMessages();
initWindow();
LabelColumnPanel labelColumnPanel= new LabelColumnPanel(trId, columnName, eventBus);
add(labelColumnPanel);
}
protected void initMessages(){
msgs = GWT.create(LabelColumnMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);

View File

@ -42,5 +42,8 @@ public interface LabelColumnMessages extends Messages {
@DefaultMessage("Error in invocation of Change The Column Label operation!")
String errorChangingTheColumnLabel();
@DefaultMessage("Error retrieving columns of tabular resource!")
String errorRetrievingColumnsOfTabularResource();
}

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpire
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.LabelColumnSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -66,18 +67,24 @@ public class LabelColumnPanel extends FramedPanel implements
private boolean updateStatus;
private VerticalLayoutContainer v;
private LabelColumnMessages msgs;
private CommonMessages msgsCommon;
public LabelColumnPanel(TRId trId, String columnName, EventBus eventBus) {
msgs = GWT.create(LabelColumnMessages.class);
this.trId = trId;
this.eventBus = eventBus;
updateStatus = false;
Log.debug("LabelColumnPanel(): [" + trId + " columnName: " + columnName
+ "]");
initMessages();
init();
retrieveColumns();
}
protected void initMessages(){
msgs = GWT.create(LabelColumnMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void retrieveColumns() {
TDGWTServiceAsync.INSTANCE.getColumns(trId,
@ -90,19 +97,18 @@ public class LabelColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load combo failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving columns of tabular resource:"
+ trId.getId());
UtilsGXT3.alert(msgsCommon.error(),
msgs.errorRetrievingColumnsOfTabularResource());
}
}
}
@ -273,7 +279,7 @@ public class LabelColumnPanel extends FramedPanel implements
labelColumnSession = new LabelColumnSession(trId, maps);
callLabelColumn();
} else {
UtilsGXT3.alert("Attention", msgs.insertValidLabels());
UtilsGXT3.alert(msgsCommon.attention(), msgs.insertValidLabels());
}
}
@ -289,12 +295,12 @@ public class LabelColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Change The Column Label Error: "
@ -309,7 +315,7 @@ public class LabelColumnPanel extends FramedPanel implements
public void onSuccess(String taskId) {
UtilsGXT3
.info("Success", msgs.updatedLabels());
.info(msgsCommon.success(), msgs.updatedLabels());
syncOpComplete();
//openMonitorDialog(taskId);

View File

@ -21,13 +21,17 @@ public class PositionColumnDialog extends Window {
private PositionColumnMessages msgs;
public PositionColumnDialog(TRId trId, EventBus eventBus) {
msgs = GWT.create(PositionColumnMessages.class);
initMessages();
initWindow();
PositionColumnPanel changeColumnsPositionPanel= new PositionColumnPanel(trId, eventBus);
add(changeColumnsPositionPanel);
}
protected void initMessages(){
msgs = GWT.create(PositionColumnMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);

View File

@ -11,6 +11,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalExcept
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.column.ChangeColumnsPositionSession;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -84,16 +85,22 @@ public class PositionColumnPanel extends FramedPanel {
private ListStore<ColumnData> store;
private PositionColumnMessages msgs;
private CommonMessages msgsCommon;
public PositionColumnPanel(TRId trId, EventBus eventBus) {
msgs = GWT.create(PositionColumnMessages.class);
this.trId = trId;
this.eventBus = eventBus;
Log.debug("ReorderColumnsPanel(): [" + trId.toString() + "]");
initMessages();
init();
build();
}
protected void initMessages(){
msgs = GWT.create(PositionColumnMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
public void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -245,12 +252,12 @@ public class PositionColumnPanel extends FramedPanel {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load columns failure:"
@ -291,7 +298,7 @@ public class PositionColumnPanel extends FramedPanel {
protected void onReorderColumns() {
ArrayList<ColumnData> columns = getReorderedColumns();
if (columns == null || columns.size() < 1) {
UtilsGXT3.alert("Attention", msgs.attentionNoColumnChange());
UtilsGXT3.alert(msgsCommon.attention(), msgs.attentionNoColumnChange());
return;
} else {
callReorderColumn(columns);
@ -314,18 +321,18 @@ public class PositionColumnPanel extends FramedPanel {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error changing the position of the columns: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error",
.alert(msgsCommon.error(),
msgs.errorChangingPositionOfColumns()+caught.getLocalizedMessage());
}
}
@ -334,7 +341,7 @@ public class PositionColumnPanel extends FramedPanel {
public void onSuccess(Void result) {
UtilsGXT3
.info("Success", msgs.positionUpdated());
.info(msgsCommon.success(), msgs.positionUpdated());
syncOpComplete();
//openMonitorDialog(taskId);

View File

@ -17,6 +17,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceEntry;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingData;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -43,14 +44,16 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*
*/
public class ReplaceBatchDialog extends Window implements MonitorDialogListener {
private static final String WIDTH = "650px";
private static final String HEIGHT = "560px";
protected enum CALLTYPE {
REPLACEBATH, RESUME;
}
private ReplaceBatchMessages msgs;
private CommonMessages msgsCommon;
private static final String WIDTH = "650px";
private static final String HEIGHT = "560px";
private TRId trId;
private EventBus eventBus;
@ -58,6 +61,9 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
private CALLTYPE callType;
private InvocationS invocationS;
private ConditionCode conditionCode; // For Curation
/**
@ -108,6 +114,7 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
protected void initMessages(){
msgs = GWT.create(ReplaceBatchMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
/**
@ -262,12 +269,12 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("Start Replace Batch failed:"
@ -316,12 +323,12 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("Task Resume failed:"
@ -363,12 +370,12 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("Task Resume failed:"
@ -429,15 +436,7 @@ public class ReplaceBatchDialog extends Window implements MonitorDialogListener
}
/**
*
protected void callChangeColumnTypeProgressDialog() {
* ChangeColumnTypeProgressDialog changeColumnTypeProgressDialog = new
* ChangeColumnTypeProgressDialog( eventBus);
* changeColumnTypeProgressDialog.addProgressDialogListener(this);
* changeColumnTypeProgressDialog.show(); }
*/
// /
protected void openMonitorDialog(String taskId) {
MonitorDialog monitorDialog = new MonitorDialog(taskId, eventBus);

View File

@ -27,6 +27,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForRepla
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.client.CommonMessages;
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.widgetcommonevent.shared.CellData;
@ -102,7 +103,6 @@ import com.sencha.gxt.widget.core.client.toolbar.ToolBar;
public class ReplaceBatchPanel extends FramedPanel implements
SingleValueReplaceListener, DimensionRowSelectionListener,
ConnectCodelistListener {
private ReplaceBatchMessages msgs;
private static final String WIDTH = "560px";
private static final String HEIGHT = "550px";
private static final String GRID_HEIGHT = "344px";
@ -110,7 +110,10 @@ public class ReplaceBatchPanel extends FramedPanel implements
private static final String CONNECTION_FIELD_WIDTH = "470px";
private static final int SHOW_OCCURENCE_TYPE_WIDTH = 100;
private static final String COMBOCOLS_WIDTH = "510px";
private ReplaceBatchMessages msgs;
private CommonMessages msgsCommon;
private EventBus eventBus;
private TRId trId;
private ArrayList<ColumnData> columns;
@ -151,6 +154,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
private boolean simpleReplace;
private ComboBox<ColumnData> comboCols;
public ReplaceBatchPanel(ReplaceBatchDialog parent, TRId trId,
RequestProperties requestProperties, EventBus eventBus) {
@ -205,6 +209,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
protected void initMessages(){
msgs = GWT.create(ReplaceBatchMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void init() {
@ -666,12 +671,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load column failure:"
@ -721,12 +726,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load column failure:"
@ -813,12 +818,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load columns failure:"
@ -840,7 +845,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
callback.onSuccess(loadedResult);
} catch (Throwable e) {
Log.error("Too many different occurrences");
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.tooManyDifferentOccurrences());
}
}
@ -991,7 +996,7 @@ public class ReplaceBatchPanel extends FramedPanel implements
if (effectiveReplaceList.size() == 0) {
UtilsGXT3
.alert("Attention", msgs.selectAtLeastOneValueToReplace());
.alert(msgsCommon.attention(), msgs.selectAtLeastOneValueToReplace());
btnSave.enable();
} else {
startReplaceBatch(effectiveReplaceList);
@ -1224,12 +1229,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load column failure:"
@ -1264,12 +1269,12 @@ public class ReplaceBatchPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("load column failure:"

View File

@ -4,6 +4,7 @@ import java.util.Date;
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.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import com.allen_sauer.gwt.log.client.Log;
@ -48,6 +49,7 @@ public class SingleValueReplacePanel extends FramedPanel {
private TextButton btnClose;
private SingleValueReplaceMessages msgs;
private CommonMessages msgsCommon;
public SingleValueReplacePanel(SingleValueReplaceDialog parent,
String value, String replaceValue, ColumnData column,
@ -65,6 +67,7 @@ public class SingleValueReplacePanel extends FramedPanel {
protected void initMessages() {
msgs = GWT.create(SingleValueReplaceMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void initPanel() {
@ -132,13 +135,13 @@ public class SingleValueReplacePanel extends FramedPanel {
protected void replaceValue() {
String rValue = replaceValueField.getCurrentValue();
if (rValue == null || rValue.isEmpty()) {
UtilsGXT3.alert("Attention", msgs.insertAValidReplaceValue());
UtilsGXT3.alert(msgsCommon.attention(), msgs.insertAValidReplaceValue());
} else {
String checkedValue = checkTypeData(rValue);
if (checkedValue != null && !checkedValue.isEmpty()) {
callReplaceValue(rValue);
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.insertAValidReplaceValueForThisColumn());
}
}

View File

@ -30,6 +30,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.AddColumnSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.expression.ExpressionWrapper;
@ -132,6 +133,7 @@ public class AddColumnPanel extends FramedPanel implements
private TextButton btnRemoveExpression;
private TextButton btnAddExpression;
private AddColumnMessages msgs;
private CommonMessages msgsCommon;
/**
*
@ -168,6 +170,7 @@ public class AddColumnPanel extends FramedPanel implements
protected void initMessages() {
msgs = GWT.create(AddColumnMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void init() {
@ -779,12 +782,12 @@ public class AddColumnPanel extends FramedPanel implements
columnMockUp);
callAddColumm();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -828,7 +831,7 @@ public class AddColumnPanel extends FramedPanel implements
callAddColumm();
// } else {
// UtilsGXT3
// .alert("Attention",
// .alert(msgsCommon.attention(),
// "The default value is not a valid text representation for geometry type ( e.g. POINT(34 56) or LINESTRING(65 34, 56.43 78.65)!");
// }
} else {
@ -893,11 +896,11 @@ public class AddColumnPanel extends FramedPanel implements
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -951,7 +954,7 @@ public class AddColumnPanel extends FramedPanel implements
columnMockUp);
callAddColumm();
} else {
UtilsGXT3.alert("Attention", msgs.noLocaleSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noLocaleSelected());
}
break;
@ -965,7 +968,7 @@ public class AddColumnPanel extends FramedPanel implements
columnMockUp);
callAddColumm();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.noColumnReferenceSelected());
}
break;
@ -980,17 +983,17 @@ public class AddColumnPanel extends FramedPanel implements
callAddColumm();
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.timeDimensionTypeNotSelected());
}
break;
default:
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.thisColumnTypeIsNotSupported());
break;
}
} else {
UtilsGXT3.alert("Attention", msgs.selectAColumnType());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAColumnType());
}
} else {
UtilsGXT3.alert("Attntion", msgs.insertAValidLabel());
@ -1019,12 +1022,12 @@ public class AddColumnPanel extends FramedPanel implements
columnMockUp = new ColumnMockUp(null, null, labelS,
type, dataType, "");
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -1039,11 +1042,11 @@ public class AddColumnPanel extends FramedPanel implements
type, dataType, "");
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.columnDataTypeNotSelected());
}
break;
@ -1062,7 +1065,7 @@ public class AddColumnPanel extends FramedPanel implements
type, locale.getLocaleName(), "");
} else {
UtilsGXT3.alert("Attention", msgs.noLocaleSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noLocaleSelected());
}
break;
case DIMENSION:
@ -1073,7 +1076,7 @@ public class AddColumnPanel extends FramedPanel implements
type, columnReference, "");
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.noColumnReferenceSelected());
}
break;
@ -1085,20 +1088,20 @@ public class AddColumnPanel extends FramedPanel implements
type, periodDataType, "");
} else {
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.timeDimensionTypeNotSelected());
}
break;
default:
UtilsGXT3.alert("Attention",
UtilsGXT3.alert(msgsCommon.attention(),
msgs.thisColumnTypeIsNotSupported());
break;
}
} else {
UtilsGXT3.alert("Attention", msgs.selectAColumnType());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAColumnType());
}
} else {
UtilsGXT3.alert("Attention", msgs.insertAValidLabel());
UtilsGXT3.alert(msgsCommon.attention(), msgs.insertAValidLabel());
}
return columnMockUp;
@ -1115,18 +1118,18 @@ public class AddColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Add Column Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Add Column Error ",
msgsCommon.error(),
msgs.errorInInvocationOfAddColumnOperation());
}
}
@ -1181,12 +1184,12 @@ public class AddColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving columns: "
@ -1224,12 +1227,12 @@ public class AddColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(caught.getLocalizedMessage());
@ -1271,12 +1274,12 @@ public class AddColumnPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(caught.getLocalizedMessage());

View File

@ -13,6 +13,7 @@ import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalException;
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.widgetcommonevent.client.CommonMessages;
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.widgetcommonevent.shared.tr.TableType;
@ -82,6 +83,7 @@ public class CreateDefColumnPanel extends FramedPanel {
private TextField columnLabel;
private TextField defaultValue;
private CreateDefColumnMessages msgs;
private CommonMessages msgsCommon;
/**
*
@ -104,6 +106,7 @@ public class CreateDefColumnPanel extends FramedPanel {
protected void initMessages(){
msgs = GWT.create(CreateDefColumnMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void init() {
@ -271,18 +274,18 @@ public class CreateDefColumnPanel extends FramedPanel {
Log.debug("CheckValue: label: " + lab + ", type: " + typeElement
+ ", locale: " + localeElement + ", default: " + valueDefault);
if (lab == null || lab.isEmpty()) {
UtilsGXT3.alert("Attention", msgs.addALabel());
UtilsGXT3.alert(msgsCommon.attention(), msgs.addALabel());
btnSave.enable();
return;
}
if (typeElement == null) {
UtilsGXT3.alert("Attention", msgs.noTypeSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noTypeSelected());
btnSave.enable();
return;
} else {
if (typeElement.getCode() == null) {
UtilsGXT3.alert("Attention", msgs.noTypeSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noTypeSelected());
btnSave.enable();
return;
} else {
@ -302,13 +305,13 @@ public class CreateDefColumnPanel extends FramedPanel {
break;
case CODENAME:
if (localeElement == null) {
UtilsGXT3.alert("Attention", msgs.noLocaleSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noLocaleSelected());
btnSave.enable();
return;
} else {
if (localeElement.getLocaleName() == null
|| localeElement.getLocaleName().isEmpty()) {
UtilsGXT3.alert("Attention", msgs.noLocaleSelected());
UtilsGXT3.alert(msgsCommon.attention(), msgs.noLocaleSelected());
btnSave.enable();
return;
} else {
@ -400,12 +403,12 @@ public class CreateDefColumnPanel extends FramedPanel {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(caught.getLocalizedMessage());

View File

@ -17,6 +17,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoad
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadResult;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.Direction;
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.OrderInfo;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
@ -95,16 +96,22 @@ public class CodelistSelectionDialog extends Window {
private ResourceBundle res;
private TextButton btnSelect;
private CommonMessages msgsCommon;
public CodelistSelectionDialog(EventBus eventBus) {
Log.info("Dialog CodelistSelection");
this.eventBus = eventBus;
listeners = new ArrayList<CodelistSelectionListener>();
initMessages();
initWindow();
create();
}
protected void initMessages(){
msgsCommon = GWT.create(CommonMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
@ -256,18 +263,18 @@ public class CodelistSelectionDialog extends Window {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Attention",
Log.debug(msgsCommon.attention(),
"This tabular resource does not have a valid table");
UtilsGXT3
.alert("Attention",
.alert(msgsCommon.attention(),
msgs.thisTabularResourceDoesHaveAValidTable());
}
}
@ -283,7 +290,7 @@ public class CodelistSelectionDialog extends Window {
});
} else {
UtilsGXT3.alert("Attention", msgs.selectACodelist());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectACodelist());
}
}
@ -337,12 +344,12 @@ public class CodelistSelectionDialog extends Window {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error Retrieving Codelist",
@ -381,12 +388,12 @@ public class CodelistSelectionDialog extends Window {
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug(

View File

@ -11,6 +11,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTIsFinalExcept
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.TabResource;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
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.widgetcommonevent.shared.tr.column.ColumnData;
@ -66,6 +67,7 @@ public class ConnectCodelistDialog extends Window implements
private TextButton btnConnect;
private TextButton btnClose;
private ConnectCodelistMessages msgs;
private CommonMessages msgsCommon;
public ConnectCodelistDialog(EventBus eventBus) {
listeners = new ArrayList<ConnectCodelistListener>();
@ -78,6 +80,7 @@ public class ConnectCodelistDialog extends Window implements
protected void initMessages(){
msgs = GWT.create(ConnectCodelistMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
@ -212,12 +215,12 @@ public class ConnectCodelistDialog extends Window implements
TabResource codelist = comboDimensionType.getCurrentValue();
if (codelist == null) {
Log.debug("No codelist selected");
UtilsGXT3.alert("Attention", msgs.selectAValidCodelist());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAValidCodelist());
} else {
ColumnData connection = comboColumnReferenceType.getCurrentValue();
if (connection == null) {
Log.debug("No connection selected");
UtilsGXT3.alert("Attention", msgs.selectAValidColumn());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAValidColumn());
} else {
fireCompleted(connection);
}
@ -267,12 +270,12 @@ public class ConnectCodelistDialog extends Window implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.debug("Error retrieving columns: "

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import org.gcube.portlets.user.td.columnwidget.client.utils.UtilsGXT3;
import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.Constants;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
@ -56,6 +57,7 @@ public class DimensionRowSelectionDialog extends Window {
private TextField value;
private TextButton btnSelect;
private DimensionRowSelectionMessages msgs;
private CommonMessages msgsCommon;
public DimensionRowSelectionDialog(ColumnData column, CellData cellData,
EventBus eventBus) {
@ -116,6 +118,7 @@ public class DimensionRowSelectionDialog extends Window {
protected void initMessages(){
msgs = GWT.create(DimensionRowSelectionMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
@ -179,7 +182,7 @@ public class DimensionRowSelectionDialog extends Window {
} else {
UtilsGXT3
.alert("Attention",
.alert(msgsCommon.attention(),
msgs.noValidViewColumnAssociatedWithThisColumn());
hide();
return;
@ -216,7 +219,7 @@ public class DimensionRowSelectionDialog extends Window {
ArrayList<String> rowsId = gridPanel.getSelectedRowsId();
if (rowsId == null || rowsId.size() == 0) {
Log.debug("No row selected");
UtilsGXT3.alert("Attention", msgs.selectARow());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectARow());
} else {
String rowId = rowsId.get(0);
Log.debug("Row selected: " + rowId);
@ -233,7 +236,7 @@ public class DimensionRowSelectionDialog extends Window {
.getRelationship().getTargetColumnId());
} else {
UtilsGXT3
.alert("Attention",
.alert(msgsCommon.attention(),
msgs.noValidViewColumnAssociatedWithThisColumn());
hide();
return;
@ -243,10 +246,10 @@ public class DimensionRowSelectionDialog extends Window {
if (cellValues == null || cellValues.size() == 0) {
Log.debug("No value retrieved");
UtilsGXT3.alert("Attention", msgs.selectARow());
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectARow());
} else {
String cellValue = cellValues.get(0);
Log.debug("Retrived: " + rowId + " " + cellValue);
Log.debug("Retrieved: " + rowId + " " + cellValue);
dimRow = new DimensionRow(rowId, cellValue);
fireCompleted(dimRow);
}
@ -268,7 +271,7 @@ public class DimensionRowSelectionDialog extends Window {
.getTargetTableId());
} else {
UtilsGXT3
.alert("Attention",
.alert(msgsCommon.attention(),
msgs.noValidRelationshipAssociatedWithThisColumn());
hide();
return;

View File

@ -8,6 +8,7 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -20,16 +21,11 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*
*/
public class ColumnMappingDialog extends Window {
protected String WIDTH = "530px";
protected String HEIGHT = "450px";
protected TRId trId;
protected ColumnData selectedColumn;
protected TabResource dimensionTR;
protected ColumnData referenceColumn;
protected EventBus eventBus;
private static final String WIDTH = "530px";
private static final String HEIGHT = "450px";
protected ArrayList<ColumnMappingListener> listeners;
private ArrayList<ColumnMappingListener> listeners;
private ColumnMappingMessages msgs;
/**
*
@ -42,18 +38,13 @@ public class ColumnMappingDialog extends Window {
public ColumnMappingDialog(TRId trId, ColumnData selectedColumn,
TabResource dimensionTR, ColumnData referenceColumn,
EventBus eventBus) {
this.trId = trId;
this.selectedColumn = selectedColumn;
this.dimensionTR = dimensionTR;
this.referenceColumn= referenceColumn;
this.eventBus = eventBus;
Log.debug("ColumnMappingDialog: [trId:" + trId
+ ", selectedColumn:" + selectedColumn + ", dimensionTR:"
+ dimensionTR + ", columnReference:" + referenceColumn
+ ", eventBus:" + eventBus
+ "]");
listeners=new ArrayList<ColumnMappingListener>();
initMessages();
initWindow();
ColumnMappingPanel columnMappingPanel = new ColumnMappingPanel(this,
trId, selectedColumn,
@ -62,6 +53,11 @@ public class ColumnMappingDialog extends Window {
add(columnMappingPanel);
}
protected void initMessages(){
msgs = GWT.create(ColumnMappingMessages.class);
}
/**
*
*/
@ -70,7 +66,7 @@ public class ColumnMappingDialog extends Window {
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Column Mapping");
setHeadingText(msgs.dialogHead());
setClosable(true);
setModal(true);
forceLayoutOnResize = true;

View File

@ -0,0 +1,40 @@
package org.gcube.portlets.user.td.columnwidget.client.mapping;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ColumnMappingMessages extends Messages {
@DefaultMessage("Column Mapping")
String dialogHead();
@DefaultMessage("Save")
String btnSaveText();
@DefaultMessage("Save")
String btnSaveToolTip();
@DefaultMessage("Close")
String btnCloseText();
@DefaultMessage("Close")
String btnCloseToolTip();
@DefaultMessage("Select rows")
String rowsLabel();
@DefaultMessage("Creates a valid mapping!")
String createAValidMapping();
@DefaultMessage("Select a source...")
String comboSourceValueEmptyText();
@DefaultMessage("Select a target...")
String comboTargetValueEmptyText();
}

View File

@ -12,6 +12,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingList;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnData;
@ -49,32 +50,29 @@ import com.sencha.gxt.widget.core.client.form.FieldLabel;
*
*/
public class ColumnMappingPanel extends FramedPanel {
protected static final String WIDTH = "520px";
protected static final String HEIGHT = "400px";
protected static final String COMBOWIDTH = "220px";
protected static final String CONTAINERHEIGHT = "340px";
protected static final String CONTAINERWIDTH = "500px";
private static final String COMBOWIDTH = "220px";
private static final String CONTAINERHEIGHT = "340px";
private static final String CONTAINERWIDTH = "500px";
protected ColumnMappingPanel thisPanel;
private ColumnMappingPanel thisPanel;
private ColumnMappingDialog parent;
private ColumnData selectedColumn;
private ColumnData referenceColumn;
private EventBus eventBus;
protected ColumnMappingDialog parent;
protected TRId trId;
protected ColumnData selectedColumn;
protected TabResource dimensionTR;
protected ColumnData referenceColumn;
protected EventBus eventBus;
private VerticalLayoutContainer vert;
private String itemIdSourceValueArg;
private String itemIdTargetValueArg;
private String itemIdBtnAdd;
private String itemIdBtnDel;
protected VerticalLayoutContainer vert;
protected String itemIdSourceValueArg;
protected String itemIdTargetValueArg;
protected String itemIdBtnAdd;
protected String itemIdBtnDel;
protected ColumnMappingList columnMappingList;
protected ArrayList<ColumnMappingData> mapping;
private ColumnMappingList columnMappingList;
private ArrayList<ColumnMappingData> mapping;
private TextButton btnSave;
private TextButton btnClose;
private ColumnMappingMessages msgs;
private CommonMessages msgsCommon;
/**
*
@ -90,9 +88,7 @@ public class ColumnMappingPanel extends FramedPanel {
ColumnData selectedColumn, TabResource dimensionTR,
ColumnData referenceColumn, EventBus eventBus) {
this.parent = parent;
this.trId = trId;
this.selectedColumn = selectedColumn;
this.dimensionTR = dimensionTR;
this.referenceColumn = referenceColumn;
this.eventBus = eventBus;
thisPanel = this;
@ -102,10 +98,16 @@ public class ColumnMappingPanel extends FramedPanel {
+ ", eventBus:" + eventBus + "]");
columnMappingList = new ColumnMappingList();
mapping = new ArrayList<ColumnMappingData>();
initMessages();
initPanel();
create();
}
protected void initMessages() {
msgs = GWT.create(ColumnMappingMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void initPanel() {
setHeaderVisible(false);
setBodyBorder(false);
@ -120,10 +122,10 @@ public class ColumnMappingPanel extends FramedPanel {
container.setHeight(CONTAINERHEIGHT);
container.setWidth(CONTAINERWIDTH);
btnSave = new TextButton("Save");
btnSave = new TextButton(msgs.btnSaveText());
btnSave.setIcon(ResourceBundle.INSTANCE.save());
btnSave.setIconAlign(IconAlign.RIGHT);
btnSave.setToolTip("Save");
btnSave.setToolTip(msgs.btnSaveToolTip());
btnSave.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -134,10 +136,10 @@ public class ColumnMappingPanel extends FramedPanel {
}
});
btnClose = new TextButton("Close");
btnClose = new TextButton(msgs.btnCloseText());
btnClose.setIcon(ResourceBundle.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Close");
btnClose.setToolTip(msgs.btnCloseToolTip());
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -162,7 +164,7 @@ public class ColumnMappingPanel extends FramedPanel {
container.add(vert);
container.forceLayout();
FieldLabel rowsLabel = new FieldLabel(null, "Select rows");
FieldLabel rowsLabel = new FieldLabel(null, msgs.rowsLabel());
rowsLabel.getElement().applyStyles("font-weight:bold");
VerticalLayoutContainer vPanel = new VerticalLayoutContainer();
@ -205,7 +207,7 @@ public class ColumnMappingPanel extends FramedPanel {
parent.saveMapping(columnMappingList);
}
} else {
UtilsGXT3.info("Attention", "Creates a valid mapping");
UtilsGXT3.info(msgsCommon.attention(), msgs.createAValidMapping());
btnSave.enable();
}
@ -269,7 +271,8 @@ public class ColumnMappingPanel extends FramedPanel {
selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, false, true, eventBus);
selectedColumn, cellData, true, false, true, false,
true, eventBus);
dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -278,7 +281,7 @@ public class ColumnMappingPanel extends FramedPanel {
});
comboSourceValue.setEmptyText("Select a source...");
comboSourceValue.setEmptyText(msgs.comboSourceValueEmptyText());
comboSourceValue.setWidth(COMBOWIDTH);
comboSourceValue.setEditable(false);
comboSourceValue.setTriggerAction(TriggerAction.ALL);
@ -330,7 +333,8 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, false, true, eventBus);
referenceColumn, cellData, true, false, true, false,
true, eventBus);
dimensionRowSelectionDialog
.addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -339,7 +343,7 @@ public class ColumnMappingPanel extends FramedPanel {
});
comboTargetValue.setEmptyText("Select a target...");
comboTargetValue.setEmptyText(msgs.comboTargetValueEmptyText());
comboTargetValue.setWidth(COMBOWIDTH);
comboTargetValue.setEditable(false);
comboTargetValue.setTriggerAction(TriggerAction.ALL);
@ -440,7 +444,8 @@ public class ColumnMappingPanel extends FramedPanel {
selectedColumn.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
selectedColumn, cellData, true, false, true, false, true, eventBus);
selectedColumn, cellData, true, false, true, false,
true, eventBus);
dimensionRowSelectionDialog
.addListener(sourceValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -449,7 +454,7 @@ public class ColumnMappingPanel extends FramedPanel {
});
comboSourceValue.setEmptyText("Select a source...");
comboSourceValue.setEmptyText(msgs.comboSourceValueEmptyText());
comboSourceValue.setWidth(COMBOWIDTH);
comboSourceValue.setEditable(false);
comboSourceValue.setTriggerAction(TriggerAction.ALL);
@ -501,7 +506,8 @@ public class ColumnMappingPanel extends FramedPanel {
.getLabel(), null, 0, 0);
DimensionRowSelectionDialog dimensionRowSelectionDialog = new DimensionRowSelectionDialog(
referenceColumn, cellData, true, false, true, false, true, eventBus);
referenceColumn, cellData, true, false, true, false,
true, eventBus);
dimensionRowSelectionDialog
.addListener(targetValueSelectedListener);
dimensionRowSelectionDialog.show();
@ -510,7 +516,7 @@ public class ColumnMappingPanel extends FramedPanel {
});
comboTargetValue.setEmptyText("Select a target...");
comboTargetValue.setEmptyText(msgs.comboTargetValueEmptyText());
comboTargetValue.setWidth(COMBOWIDTH);
comboTargetValue.setEditable(false);
comboTargetValue.setTriggerAction(TriggerAction.ALL);

View File

@ -4,6 +4,7 @@ import org.gcube.portlets.user.td.columnwidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.widgetcommonevent.shared.CellData;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.google.gwt.core.client.GWT;
import com.google.web.bindery.event.shared.EventBus;
import com.sencha.gxt.widget.core.client.Window;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
@ -16,15 +17,16 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
*
*/
public class ReplaceAllDialog extends Window {
protected String WIDTH = "500px";
protected String HEIGHT = "150px";
protected ReplaceAllPanel ReplacePanel;
protected CellData cellData;
protected TRId trId;
protected EventBus eventBus;
private static final String WIDTH = "500px";
private static final String HEIGHT = "150px";
private CellData cellData;
private TRId trId;
private EventBus eventBus;
private ReplaceAllMessages msgs;
public ReplaceAllDialog(CellData cellData, TRId trId, EventBus eventBus) {
initMessages();
initWindow();
this.cellData = cellData;
this.trId = trId;
@ -32,13 +34,17 @@ public class ReplaceAllDialog extends Window {
create();
}
protected void initMessages(){
msgs = GWT.create(ReplaceAllMessages.class);
}
protected void initWindow() {
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(false);
setHeadingText("Replace All");
setHeadingText(msgs.dialogHead());
setClosable(true);
getHeader().setIcon(ResourceBundle.INSTANCE.replaceAll());

View File

@ -0,0 +1,46 @@
package org.gcube.portlets.user.td.columnwidget.client.replace;
import com.google.gwt.i18n.client.Messages;
/**
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public interface ReplaceAllMessages extends Messages {
@DefaultMessage("Replace All")
String dialogHead();
@DefaultMessage("Replace")
String btnReplaceText();
@DefaultMessage("Replace Value")
String btnReplaceToolTip();
@DefaultMessage("Close")
String btnCloseText();
@DefaultMessage("Close")
String btnCloseToolTip();
@DefaultMessage("Current Value")
String currentValue();
@DefaultMessage("Replacement")
String replacement();
@DefaultMessage("Select a value...")
String selectAValue();
@DefaultMessage("Insert a valid replace value!")
String insertAValidReplaceValue();
@DefaultMessage("Insert a valid replace value for this column!")
String insertAValidReplaceValueForThisColumn();
@DefaultMessage( "Select a valid value!")
String selectAValidValue();
}

View File

@ -15,6 +15,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.DimensionRow;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.ReplaceColumnSession;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialog;
import org.gcube.portlets.user.td.monitorwidget.client.MonitorDialogListener;
import org.gcube.portlets.user.td.widgetcommonevent.client.CommonMessages;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.ChangeTableRequestEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.event.SessionExpiredEvent;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableRequestType;
@ -60,9 +61,6 @@ import com.sencha.gxt.widget.core.client.form.TextField;
*/
public class ReplaceAllPanel extends FramedPanel implements
DimensionRowSelectionListener, MonitorDialogListener {
private static final String REPLACEMENT = "Replacement";
private static final String CURRENT_VALUE = "Current Value";
private DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
private String WIDTH = "500px";
@ -83,9 +81,11 @@ public class ReplaceAllPanel extends FramedPanel implements
private DateField valueDate;
private TextField replaceValue;
private DateField replaceValueDate;
private TextButton btnApply;
private TextButton btnReplace;
private TextButton btnClose;
private boolean isDimension;
private ReplaceAllMessages msgs;
private CommonMessages msgsCommon;
public ReplaceAllPanel(ReplaceAllDialog parent, TRId trId, CellData cellData,
EventBus eventBus) {
@ -95,10 +95,16 @@ public class ReplaceAllPanel extends FramedPanel implements
this.eventBus = eventBus;
dimensionRow = null;
Log.debug("ReplacePanel:[" + trId + ", CellData:" + cellData + "]");
initMessages();
initPanel();
retrieveColumn();
}
protected void initMessages(){
msgs = GWT.create(ReplaceAllMessages.class);
msgsCommon = GWT.create(CommonMessages.class);
}
protected void initPanel() {
setWidth(WIDTH);
@ -118,17 +124,17 @@ public class ReplaceAllPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("Error retrieving column: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving column",
UtilsGXT3.alert(msgsCommon.error(),
caught.getMessage());
}
}
@ -177,11 +183,11 @@ public class ReplaceAllPanel extends FramedPanel implements
replaceValue = new TextField();
}
btnApply = new TextButton("Replace");
btnApply.setIcon(ResourceBundle.INSTANCE.replaceAll());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Replace Value");
btnApply.addSelectHandler(new SelectHandler() {
btnReplace = new TextButton(msgs.btnReplaceText());
btnReplace.setIcon(ResourceBundle.INSTANCE.replaceAll());
btnReplace.setIconAlign(IconAlign.RIGHT);
btnReplace.setToolTip(msgs.btnReplaceToolTip());
btnReplace.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Apply");
@ -190,10 +196,10 @@ public class ReplaceAllPanel extends FramedPanel implements
}
});
btnClose = new TextButton("Close");
btnClose = new TextButton(msgs.btnCloseText());
btnClose.setIcon(ResourceBundle.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setToolTip("Close");
btnClose.setToolTip(msgs.btnCloseToolTip());
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -209,18 +215,18 @@ public class ReplaceAllPanel extends FramedPanel implements
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
flowButton.add(btnApply, boxLayoutData);
flowButton.add(btnReplace, boxLayoutData);
flowButton.add(btnClose, boxLayoutData);
VerticalLayoutContainer v = new VerticalLayoutContainer();
if (column.getDataTypeName().compareTo("Date") == 0) {
v.add(new FieldLabel(valueDate, CURRENT_VALUE), new VerticalLayoutData(1,
v.add(new FieldLabel(valueDate, msgs.currentValue()), new VerticalLayoutData(1,
-1));
v.add(new FieldLabel(replaceValueDate, REPLACEMENT),
v.add(new FieldLabel(replaceValueDate, msgs.replacement()),
new VerticalLayoutData(1, -1));
} else {
v.add(new FieldLabel(value, CURRENT_VALUE), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(replaceValue, REPLACEMENT),
v.add(new FieldLabel(value, msgs.currentValue()), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(replaceValue, msgs.replacement()),
new VerticalLayoutData(1, -1));
}
v.add(flowButton, new VerticalLayoutData(1, 36,
@ -247,19 +253,19 @@ public class ReplaceAllPanel extends FramedPanel implements
addHandlersForComboDimensionType(propsDimensionType.value());
comboDimensionType.setEmptyText("Select a Value...");
comboDimensionType.setEmptyText(msgs.selectAValue());
comboDimensionType.setWidth(300);
comboDimensionType.setEditable(false);
comboDimensionType.setTriggerAction(TriggerAction.ALL);
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, REPLACEMENT);
comboDimensionTypeLabel = new FieldLabel(comboDimensionType, msgs.replacement());
//
btnApply = new TextButton("Replace");
btnApply.setIcon(ResourceBundle.INSTANCE.replace());
btnApply.setIconAlign(IconAlign.RIGHT);
btnApply.setToolTip("Replace Value");
btnApply.addSelectHandler(new SelectHandler() {
btnReplace = new TextButton(msgs.btnReplaceText());
btnReplace.setIcon(ResourceBundle.INSTANCE.replace());
btnReplace.setIconAlign(IconAlign.RIGHT);
btnReplace.setToolTip(msgs.btnCloseToolTip());
btnReplace.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
Log.debug("Pressed Apply For Dimension");
@ -268,10 +274,10 @@ public class ReplaceAllPanel extends FramedPanel implements
}
});
btnClose = new TextButton("Close");
btnClose = new TextButton(msgs.btnCloseText());
btnClose.setIcon(ResourceBundle.INSTANCE.close());
btnClose.setIconAlign(IconAlign.RIGHT);
btnClose.setTitle("Close");
btnClose.setTitle(msgs.btnCloseToolTip());
btnClose.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
@ -286,11 +292,11 @@ public class ReplaceAllPanel extends FramedPanel implements
flowButton.setPack(BoxLayoutPack.CENTER);
BoxLayoutData boxLayoutData=new BoxLayoutData(new Margins(2, 4, 2, 4));
flowButton.add(btnApply, boxLayoutData);
flowButton.add(btnReplace, boxLayoutData);
flowButton.add(btnClose, boxLayoutData);
VerticalLayoutContainer v = new VerticalLayoutContainer();
v.add(new FieldLabel(value, CURRENT_VALUE), new VerticalLayoutData(1, -1));
v.add(new FieldLabel(value, msgs.currentValue()), new VerticalLayoutData(1, -1));
v.add(comboDimensionTypeLabel, new VerticalLayoutData(1, -1));
v.add(flowButton, new VerticalLayoutData(1, 36,
new Margins(5, 2, 5, 2)));
@ -304,7 +310,7 @@ public class ReplaceAllPanel extends FramedPanel implements
if (column.getDataTypeName().compareTo("Date") == 0) {
Date d = replaceValueDate.getCurrentValue();
if (d == null) {
UtilsGXT3.alert("Attention", "Insert a valid replace value");
UtilsGXT3.alert(msgsCommon.attention(), msgs.insertAValidReplaceValue());
return;
} else {
String dateS = sdf.format(d);
@ -314,13 +320,13 @@ public class ReplaceAllPanel extends FramedPanel implements
} else {
rValue = replaceValue.getCurrentValue();
if (rValue == null) {
UtilsGXT3.alert("Attention", "Insert a valid replace value");
UtilsGXT3.alert(msgsCommon.attention(), msgs.insertAValidReplaceValue());
return;
} else {
String checkedValue = checkTypeData(rValue);
if (checkedValue == null || checkedValue.isEmpty()) {
UtilsGXT3.alert("Attention",
"Insert a valid replace value for this column");
UtilsGXT3.alert(msgsCommon.attention(),
msgs.insertAValidReplaceValueForThisColumn());
return;
}
}
@ -332,7 +338,7 @@ public class ReplaceAllPanel extends FramedPanel implements
protected void replaceValueForDimension() {
Log.debug("Current Dimension Row in combo: " + dimensionRow);
if (dimensionRow == null) {
UtilsGXT3.alert("Attention", "Select a valid value");
UtilsGXT3.alert(msgsCommon.attention(), msgs.selectAValidValue());
} else {
callReplaceValue(dimensionRow.getRowId());
}
@ -422,12 +428,12 @@ public class ReplaceAllPanel extends FramedPanel implements
} else {
if (caught instanceof TDGWTIsLockedException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Locked",
UtilsGXT3.alert(msgsCommon.errorLocked(),
caught.getLocalizedMessage());
} else {
if (caught instanceof TDGWTIsFinalException) {
Log.error(caught.getLocalizedMessage());
UtilsGXT3.alert("Error Final",
UtilsGXT3.alert(msgsCommon.errorFinal(),
caught.getLocalizedMessage());
} else {
Log.error("Error submitting replace column value: "
@ -436,7 +442,7 @@ public class ReplaceAllPanel extends FramedPanel implements
+ caught.getCause());
caught.printStackTrace();
UtilsGXT3
.alert("Error submitting replace column value",
.alert(msgsCommon.error(),
caught.getMessage());
}
}

View File

@ -2,3 +2,8 @@ dialogHeadingText = Delete Columns
deleteBtnText = Delete
deleteBtnToolTip = Delete Columns
columnsLabel = Columns
errorRetrievingColumnsHead = Error retrieving columns
errorRetrievingColumns = Error retrieving columns on server!
attentionNoColumnSelected = Attention no column selected!
deleteColumnErrorHead = Delete Column Error
deleteColumnError = Error in invocation of delete column operation!

View File

@ -2,3 +2,8 @@ dialogHeadingText = Borrar Columnas
deleteBtnText = Borrar
deleteBtnToolTip = Borrar Columnas
columnsLabel = Columnas
errorRetrievingColumnsHead = Error al recuperar las columna
errorRetrievingColumns = Error al recuperar las columnas en el servidor!
attentionNoColumnSelected = Atención ninguna columna seleccionada!
deleteColumnErrorHead = Borrar Columnas Error
deleteColumnError = Error con la invocación de la operación borrar columnas!

View File

@ -2,3 +2,8 @@ dialogHeadingText = Elimina Colonne
deleteBtnText = Elimina
deleteBtnToolTip = Elimina Colonne
columnsLabel = Colonne
errorRetrievingColumnsHead = Errore recuperando le colonne
errorRetrievingColumns = Errore recuperando le colonne dal server!
attentionNoColumnSelected = Attenzione nessuna colonna selezionata!
deleteColumnErrorHead = Errore in Delete Column
deleteColumnError = Errore nella invocazione dell''operazione di delete column!

View File

@ -7,3 +7,4 @@ nolabelTextLabel = nolabel
insertValidLabels = Insert valid labels!
errorChangingTheColumnLabelHead = Error Changing The Column Label
errorChangingTheColumnLabel = Error in invocation of Change The Column Label operation!
errorRetrievingColumnsOfTabularResource = Error retrieving columns of tabular resource!

View File

@ -7,3 +7,4 @@ nolabelTextLabel = noetiqueta
insertValidLabels = Introducir etiquetas válidas!
errorChangingTheColumnLabelHead = Error en el Cambio de las Etiquetas
errorChangingTheColumnLabel = Error en la Operación de Cambio de las Etiquetas!
errorRetrievingColumnsOfTabularResource = Error al recuperar las columnas de la tabular resource!

View File

@ -7,3 +7,4 @@ nolabelTextLabel = senzaetichetta
insertValidLabels = Inserisci etichette valide!
errorChangingTheColumnLabelHead = Errore modificando l''etichette
errorChangingTheColumnLabel = Errore nell''invocazione dell''operazione di modifica etichette!
errorRetrievingColumnsOfTabularResource = Errore recuperando le colonne della tabular resource!

View File

@ -0,0 +1,9 @@
dialogHead = Column Mapping
btnSaveText = Save
btnSaveToolTip = Save
btnCloseText = Close
btnCloseToolTip = Close
rowsLabel = Select rows
createAValidMapping = Creates a valid mapping!
comboSourceValueEmptyText = Select a source...
comboTargetValueEmptyText = Select a target...

View File

@ -0,0 +1,9 @@
dialogHead = Columnas Asignación
btnSaveText = Guardar
btnSaveToolTip = Guardar
btnCloseText = Cerrar
btnCloseToolTip = Cerrar
rowsLabel = Seleccionar líneas
createAValidMapping = Crea una asignación válida!
comboSourceValueEmptyText = Seleccionar origen...
comboTargetValueEmptyText = Seleccionar el destino...

View File

@ -0,0 +1,10 @@
dialogHead = Mappatura Colonne
btnSaveText = Salva
btnSaveToolTip = Salva
btnCloseText = Chiudi
btnCloseToolTip = Chiudi
rowsLabel = Seleziona Righe
createAValidMapping = Crea una mappatura valida!
comboSourceValueEmptyText = Seleziona sorgente...
comboTargetValueEmptyText = Seleziona destinazione...

View File

@ -0,0 +1,11 @@
dialogHead = Replace All
btnReplaceText = Replace
btnReplaceToolTip = Replace Value
btnCloseText = Close
btnCloseToolTip = Close
currentValue = Current Value
replacement = Replacement
selectAValue = Select a value...
insertAValidReplaceValue = Insert a valid replace value!
insertAValidReplaceValueForThisColumn = Insert a valid replace value for this column!
selectAValidValue = Select a valid value!

View File

@ -0,0 +1,11 @@
dialogHead = Reemplazar Todo
btnReplaceText = Reemplaza
btnReplaceToolTip = Reemplaza
btnCloseText = Cerrar
btnCloseToolTip = Cerrar
currentValue = Valor Actual
replacement = Reemplazo
selectAValue = Seleccionar el valor...
insertAValidReplaceValue = Introducir reemplazo válido!
insertAValidReplaceValueForThisColumn = Introducir un valor válido para esta columna!
selectAValidValue = Seleccionar un valor válido!

View File

@ -0,0 +1,12 @@
dialogHead = Rimpiazza Tutto
btnReplaceText = Rimpiazza
btnReplaceToolTip = Rimpiazza
btnCloseText = Chiudi
btnCloseToolTip = Chiudi
currentValue = Valore Corrente
replacement = Rimpiazzo
selectAValue = Seleziona un valore...
insertAValidReplaceValue = Inserisci un rimpiazzo valido!
insertAValidReplaceValueForThisColumn = Inserisci un valore valido per questa colonna!
selectAValidValue = Seleziona un valore valido!