Added SessionExpiredShow

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@95793 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-16 14:21:10 +00:00 committed by Giancarlo Panichi
parent 5ec8a3d7ac
commit ed0e9fdef3
14 changed files with 890 additions and 783 deletions

View File

@ -1,8 +1,7 @@
package org.gcube.portlets.user.td.tablewidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.ChangeTableTypeProgressDialog;
@ -10,6 +9,8 @@ import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeElement;
import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeProperties;
import org.gcube.portlets.user.td.tablewidget.client.type.TableTypeStore;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -29,50 +30,47 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.ComboBox;
import com.sencha.gxt.widget.core.client.form.FieldLabel;
/**
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChangeTableTypePanel extends FramedPanel {
public class ChangeTableTypePanel extends FramedPanel {
protected String WIDTH = "640px";
protected String HEIGHT = "520px";
protected TRId trId;
protected TableData table;
protected String headingTitle;
protected VerticalLayoutContainer vl;
protected EventBus eventBus;
protected ChangeTableTypeSession changeTableTypeSession;
protected ChangeTableTypeProgressDialog changeTableTypeProgressDialog;
protected ChangeTableTypeProgressDialog changeTableTypeProgressDialog;
protected ComboBox<TableTypeElement> comboTableType;
protected TextButton change;
public ChangeTableTypePanel(TRId trId, EventBus eventBus) {
super();
this.trId=trId;
this.trId = trId;
this.eventBus = eventBus;
forceLayoutOnResize=true;
forceLayoutOnResize = true;
create();
}
protected void create(){
protected void create() {
setWidth(WIDTH);
setHeight(HEIGHT);
setHeaderVisible(false);
setBodyBorder(false);
TableTypeProperties props = GWT.create(TableTypeProperties.class);
ListStore<TableTypeElement> storeTableType = new ListStore<TableTypeElement>(props.id());
ListStore<TableTypeElement> storeTableType = new ListStore<TableTypeElement>(
props.id());
storeTableType.addAll(TableTypeStore.getTableTypes());
Log.trace("Store created");
comboTableType = new ComboBox<TableTypeElement>(storeTableType,
@ -80,104 +78,110 @@ public class ChangeTableTypePanel extends FramedPanel {
Log.trace("ComboTableType created");
comboTableType.setEmptyText("Select a Table Type...");
comboTableType.setItemId("ComboTableType");
comboTableType.setWidth("200px");
comboTableType.setEditable(false);
comboTableType.setTriggerAction(TriggerAction.ALL);
change=new TextButton("Change");
change = new TextButton("Change");
change.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
onChangeTableType();
}
});
vl = new VerticalLayoutContainer();
vl.setScrollMode(ScrollMode.AUTO);
vl.setAdjustForScroll(true);
vl.add(new FieldLabel(comboTableType, "Table Type"), new VerticalLayoutData(1,
-1));
vl.add(change, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
vl.add(new FieldLabel(comboTableType, "Table Type"),
new VerticalLayoutData(1, -1));
vl.add(change,
new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
add(vl);
show();
load();
}
protected void onChangeTableType(){
protected void onChangeTableType() {
TableTypeElement tableTypeElement = comboTableType.getCurrentValue();
if(tableTypeElement!=null){
changeTableTypeSession=new ChangeTableTypeSession(trId,tableTypeElement.getTableType());
if (tableTypeElement != null) {
changeTableTypeSession = new ChangeTableTypeSession(trId,
tableTypeElement.getTableType());
callChangeTableType();
} else {
UtilsGXT3.alert("Attention", "Select a table type!");
}
}
private void callChangeTableType() {
TDGWTServiceAsync.INSTANCE.startChangeTableType(
changeTableTypeSession, new AsyncCallback<Void>() {
TDGWTServiceAsync.INSTANCE.startChangeTableType(changeTableTypeSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.debug("Change The Table Type Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Changing The Table Type",
"Error in invocation of Change Table Type operation!");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Change The Table Type Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Changing The Table Type",
"Error in invocation of Change Table Type operation!");
}
}
public void onSuccess(Void result) {
changeTableTypeProgressDialog= new ChangeTableTypeProgressDialog(changeTableTypeSession, eventBus);
changeTableTypeProgressDialog = new ChangeTableTypeProgressDialog(
changeTableTypeSession, eventBus);
}
});
}
protected void setCurrentType(){
TableTypeElement tElement=TableTypeStore.getTableTypeElement(table.getTypeName());
comboTableType.setValue(tElement);
protected void setCurrentType() {
TableTypeElement tElement = TableTypeStore.getTableTypeElement(table
.getTypeName());
comboTableType.setValue(tElement);
}
private void load() {
TDGWTServiceAsync.INSTANCE.getTable(trId,
new AsyncCallback<TableData>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving table: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving table",caught.getMessage());
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving table: "
+ caught.getMessage());
UtilsGXT3.alert("Error retrieving table",
caught.getMessage());
}
}
public void onSuccess(TableData result) {
Log.debug("Retrieved table: "+result.toString());
table=result;
Log.debug("Retrieved table: " + result.toString());
table = result;
setCurrentType();
}
});
}
public void update(TRId trId) {
this.trId = trId;
load();
}
}

View File

@ -1,11 +1,14 @@
package org.gcube.portlets.user.td.tablewidget.client;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.clone.CloneTabularResourceSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -34,24 +37,29 @@ public class CloneTabularResource {
cloneTabularResourceSession, new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.debug("Clone Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Cloning Tabular Resource",
"Error in clone operation!");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Clone Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Cloning Tabular Resource",
"Error in clone operation!");
}
}
public void onSuccess(TRId result) {
Log.info("TR Clone:"+result);
final ChangeTableRequestEvent event=new ChangeTableRequestEvent(ChangeTableRequestType.CLONETABULARRESOURCE,result,ChangeTableWhy.TABLEUPDATED);
Log.info("TR Clone:" + result);
final ChangeTableRequestEvent event = new ChangeTableRequestEvent(
ChangeTableRequestType.CLONETABULARRESOURCE,
result, ChangeTableWhy.TABLEUPDATED);
eventBus.fireEvent(event);
UtilsGXT3.info("Clone", "Clone Tabular Resource Succed");
UtilsGXT3
.info("Clone", "Clone Tabular Resource Succed");
}
});
}
}

View File

@ -1,9 +1,12 @@
package org.gcube.portlets.user.td.tablewidget.client.history;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.RollBackProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -26,11 +29,15 @@ public class HistoryDiscard {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving trId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving trId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {
@ -47,10 +54,15 @@ public class HistoryDiscard {
new AsyncCallback<RollBackSession>() {
public void onFailure(Throwable caught) {
Log.error("Error in discard: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in discard", "Error in discard");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error in discard: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in discard",
"Error in discard");
}
}
public void onSuccess(RollBackSession result) {

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.history.OpHistory;
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
@ -12,6 +13,8 @@ import org.gcube.portlets.user.td.tablewidget.client.progress.RollBackProgressDi
import org.gcube.portlets.user.td.tablewidget.client.properties.OpHistoryProperties;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -120,8 +123,8 @@ public class HistoryPanel extends FramedPanel {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<span title='"+value+"'>"
+ value + "</span>");
sb.appendHtmlConstant("<span title='" + value + "'>" + value
+ "</span>");
}
@ -132,8 +135,6 @@ public class HistoryPanel extends FramedPanel {
ColumnConfig<OpHistory, String> rollBackColumn = new ColumnConfig<OpHistory, String>(
props.date(), 40, "Undo");
ActionButtonCellNoFirst button = new ActionButtonCellNoFirst();
button.setIcon(ResourceBundle.INSTANCE.undo());
@ -150,9 +151,7 @@ public class HistoryPanel extends FramedPanel {
});
rollBackColumn.setCell(button);
List<ColumnConfig<OpHistory, ?>> l = new ArrayList<ColumnConfig<OpHistory, ?>>();
l.add(expander);
l.add(nameCol);
@ -219,7 +218,7 @@ public class HistoryPanel extends FramedPanel {
protected void startSearchRollBackId(int rowIndex) {
currentRowIndex = rowIndex;
currentOpHistory = store.get(rowIndex-1);
currentOpHistory = store.get(rowIndex - 1);
Log.debug(currentOpHistory.toString() + " was clicked.[rowIndex="
+ currentRowIndex + " ]");
callRollBack();
@ -233,11 +232,15 @@ public class HistoryPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.error("Error in rollback: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in rollback",
"Error in rollback");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error in rollback: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error in rollback",
"Error in rollback");
}
}
public void onSuccess(Void result) {
@ -262,10 +265,15 @@ public class HistoryPanel extends FramedPanel {
new AsyncCallback<ArrayList<OpHistory>>() {
public void onFailure(Throwable caught) {
Log.error("Error Retrieving History: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving history",
"Error retrieving history");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error Retrieving History: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving history",
"Error retrieving history");
}
callback.onFailure(caught);
}
@ -288,11 +296,15 @@ public class HistoryPanel extends FramedPanel {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -19,125 +22,130 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* LabelColumnProgressDialog is a Dialog that show progress of change the column label
* LabelColumnProgressDialog is a Dialog that show progress of change the column
* label
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ChangeTableTypeProgressDialog extends Window implements ChangeTableTypeProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected ChangeTableTypeSession changeTableTypeSession;
protected EventBus eventBus;
protected ChangeTableTypeProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
public ChangeTableTypeProgressDialog(ChangeTableTypeSession changeTableTypeSession, EventBus eventBus) {
this.changeTableTypeSession=changeTableTypeSession;
this.eventBus=eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Change The Table Type Progress");
trId=null;
FramedPanel panel=new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok=new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new ChangeTableTypeProgressUpdater();
progressUpdater.addListener(new ChangeTableTypeProgressBarUpdater(progressBar));
public class ChangeTableTypeProgressDialog extends Window implements
ChangeTableTypeProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected ChangeTableTypeSession changeTableTypeSession;
protected EventBus eventBus;
protected ChangeTableTypeProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public ChangeTableTypeProgressDialog(
ChangeTableTypeSession changeTableTypeSession, EventBus eventBus) {
this.changeTableTypeSession = changeTableTypeSession;
this.eventBus = eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Change The Table Type Progress");
public void operationInitializing() {
// TODO Auto-generated method stub
}
trId = null;
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: "+trId.toString());
this.trId=trId;
why=ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
ok.setVisible(true);
this.trId=null;
UtilsGXT3.alert("Error Changing The Table Type", reason);
}
public void updateInvocation(){
if(trId!=null){
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.CHANGETABLETYPE, trId,why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
});
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new ChangeTableTypeProgressUpdater();
progressUpdater.addListener(new ChangeTableTypeProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public void operationInitializing() {
// TODO Auto-generated method stub
}
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: " + trId.toString());
this.trId = trId;
why = ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
ok.setVisible(true);
this.trId=trId;
why=ChangeTableWhy.TABLECURATION;
this.trId = null;
UtilsGXT3.alert("Error Changing The Table Type", reason);
}
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.CHANGETABLETYPE, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -19,126 +22,131 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* LabelColumnProgressDialog is a Dialog that show progress of change the column label
* LabelColumnProgressDialog is a Dialog that show progress of change the column
* label
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected DeleteRowsSession deleteRowsSession;
protected EventBus eventBus;
protected DeleteRowsProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
public DeleteRowsProgressDialog(DeleteRowsSession deleteRowsSession, EventBus eventBus) {
this.deleteRowsSession=deleteRowsSession;
this.eventBus=eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Delete Rows Progress");
trId=null;
FramedPanel panel=new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok=new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DeleteRowsProgressUpdater();
progressUpdater.addListener(new DeleteRowsProgressBarUpdater(progressBar));
public class DeleteRowsProgressDialog extends Window implements
DeleteRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected DeleteRowsSession deleteRowsSession;
protected EventBus eventBus;
protected DeleteRowsProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public DeleteRowsProgressDialog(DeleteRowsSession deleteRowsSession,
EventBus eventBus) {
this.deleteRowsSession = deleteRowsSession;
this.eventBus = eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Delete Rows Progress");
public void operationInitializing() {
// TODO Auto-generated method stub
}
trId = null;
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: "+trId.toString());
this.trId=trId;
why=ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
ok.setVisible(true);
this.trId=null;
UtilsGXT3.alert("Error Deleting Rows", reason);
}
public void updateInvocation(){
if(trId!=null){
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DELETEROWS, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
});
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DeleteRowsProgressUpdater();
progressUpdater.addListener(new DeleteRowsProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public void operationInitializing() {
// TODO Auto-generated method stub
}
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: " + trId.toString());
this.trId = trId;
why = ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
ok.setVisible(true);
this.trId=trId;
why=ChangeTableWhy.TABLECURATION;
this.trId = null;
UtilsGXT3.alert("Error Deleting Rows", reason);
}
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DELETEROWS, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DuplicatesSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -19,124 +22,130 @@ import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.Verti
import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
* LabelColumnProgressDialog is a Dialog that show progress of change the column label
* LabelColumnProgressDialog is a Dialog that show progress of change the column
* label
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected DuplicatesSession duplicatesSession;
protected EventBus eventBus;
protected DuplicatesRowsProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
public DuplicatesRowsProgressDialog(DuplicatesSession duplicatesSession, EventBus eventBus) {
this.duplicatesSession=duplicatesSession;
this.eventBus=eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Duplicates Rows Progress");
trId=null;
FramedPanel panel=new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok=new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DuplicatesRowsProgressUpdater();
progressUpdater.addListener(new DuplicatesRowsProgressBarUpdater(progressBar));
public class DuplicatesRowsProgressDialog extends Window implements
DuplicatesRowsProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected DuplicatesSession duplicatesSession;
protected EventBus eventBus;
protected DuplicatesRowsProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public DuplicatesRowsProgressDialog(DuplicatesSession duplicatesSession,
EventBus eventBus) {
this.duplicatesSession = duplicatesSession;
this.eventBus = eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Duplicates Rows Progress");
public void operationInitializing() {
// TODO Auto-generated method stub
}
trId = null;
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: "+trId.toString());
this.trId=trId;
why=ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
VerticalLayoutContainer v = new VerticalLayoutContainer();
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new DuplicatesRowsProgressUpdater();
progressUpdater.addListener(new DuplicatesRowsProgressBarUpdater(
progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public void operationInitializing() {
// TODO Auto-generated method stub
}
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: " + trId.toString());
this.trId = trId;
why = ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
ok.setVisible(true);
this.trId=null;
this.trId = null;
UtilsGXT3.alert("Error Deleting Rows", reason);
}
public void updateInvocation(){
if(trId!=null){
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DUPLICATES, trId,why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
}
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
ok.setVisible(true);
this.trId=trId;
why=ChangeTableWhy.TABLECURATION;
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DUPLICATES, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.tablewidget.client.rows.EditRowPanel;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -20,123 +23,127 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class EditRowProgressDialog extends Window implements EditRowProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected EditRowPanel parent;
protected EventBus eventBus;
protected EditRowProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
public EditRowProgressDialog(EditRowPanel editRowPanel, EventBus eventBus) {
this.parent=editRowPanel;
this.eventBus=eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Rollback Progress");
trId=null;
FramedPanel panel=new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok=new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new EditRowProgressUpdater();
progressUpdater.addListener(new EditRowProgressBarUpdater(progressBar));
public class EditRowProgressDialog extends Window implements
EditRowProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected EditRowPanel parent;
protected EventBus eventBus;
protected EditRowProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public EditRowProgressDialog(EditRowPanel editRowPanel, EventBus eventBus) {
this.parent = editRowPanel;
this.eventBus = eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Rollback Progress");
public void operationInitializing() {
// TODO Auto-generated method stub
}
trId = null;
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: "+trId.toString());
this.trId=trId;
why=ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
ok.setVisible(true);
this.trId=null;
UtilsGXT3.alert("Error", reason);
}
public void updateInvocation(){
if(trId!=null){
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.EDITROW, trId,why);
eventBus.fireEvent(changeTableRequestEvent);
}
parent.close();
hide();
}
});
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new EditRowProgressUpdater();
progressUpdater.addListener(new EditRowProgressBarUpdater(progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public void operationInitializing() {
// TODO Auto-generated method stub
}
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: " + trId.toString());
this.trId = trId;
why = ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
ok.setVisible(true);
this.trId=trId;
why=ChangeTableWhy.TABLECURATION;
this.trId = null;
UtilsGXT3.alert("Error", reason);
}
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.EDITROW, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
parent.close();
hide();
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -1,10 +1,13 @@
package org.gcube.portlets.user.td.tablewidget.client.progress;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.history.RollBackSession;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.ChangeTableWhy;
import org.gcube.portlets.user.td.widgetcommonevent.client.type.SessionExpiredType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -20,122 +23,128 @@ import com.sencha.gxt.widget.core.client.event.SelectEvent;
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
/**
*
*
* @author "Giancarlo Panichi"
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class RollBackProgressDialog extends Window implements RollBackProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected RollBackSession rollBackSession;
protected EventBus eventBus;
protected RollBackProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
public RollBackProgressDialog(RollBackSession rollBackSession, EventBus eventBus) {
this.rollBackSession=rollBackSession;
this.eventBus=eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Rollback Progress");
trId=null;
FramedPanel panel=new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok=new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
}
});
v.add(progressBar, new VerticalLayoutData(1,
1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new RollBackProgressUpdater();
progressUpdater.addListener(new RollBackProgressBarUpdater(progressBar));
public class RollBackProgressDialog extends Window implements
RollBackProgressListener {
public static final int STATUS_POLLING_DELAY = 1000;
protected String WIDTH = "400px";
protected String HEIGHT = "120px";
protected RollBackSession rollBackSession;
protected EventBus eventBus;
protected RollBackProgressUpdater progressUpdater;
protected TextButton ok;
protected TRId trId;
private ChangeTableWhy why;
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public RollBackProgressDialog(RollBackSession rollBackSession,
EventBus eventBus) {
this.rollBackSession = rollBackSession;
this.eventBus = eventBus;
setWidth(WIDTH);
setHeight(HEIGHT);
setBodyBorder(false);
setResizable(true);
setModal(true);
setHeadingText("Rollback Progress");
public void operationInitializing() {
// TODO Auto-generated method stub
}
trId = null;
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
FramedPanel panel = new FramedPanel();
panel.setHeaderVisible(false);
panel.setBodyBorder(false);
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: "+trId.toString());
this.trId=trId;
why=ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
VerticalLayoutContainer v = new VerticalLayoutContainer();
ProgressBar progressBar = new ProgressBar();
ok = new TextButton("OK");
ok.addSelectHandler(new SelectHandler() {
public void onSelect(SelectEvent event) {
updateInvocation();
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
ok.setVisible(true);
this.trId=null;
UtilsGXT3.alert("Error in RollBack", reason);
}
public void updateInvocation(){
if(trId!=null){
ChangeTableRequestEvent changeTableRequestEvent=
new ChangeTableRequestEvent(ChangeTableRequestType.DELETEROWS, trId,why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
});
@Override
public void operationStopped(TRId trId,String reason, String details) {
Log.debug("Operation Stopped: ["+trId.toString()+", "+reason+", "+details+"]");
v.add(progressBar,
new VerticalLayoutData(1, 1, new Margins(5, 5, 5, 5)));
panel.add(v);
panel.addButton(ok);
add(panel);
progressUpdater = new RollBackProgressUpdater();
progressUpdater
.addListener(new RollBackProgressBarUpdater(progressBar));
progressUpdater.addListener(this);
progressUpdater.scheduleRepeating(STATUS_POLLING_DELAY);
show();
ok.setVisible(false);
}
public void operationInitializing() {
// TODO Auto-generated method stub
}
public void operationUpdate(float elaborated) {
// TODO Auto-generated method stub
}
public void operationComplete(TRId trId) {
Log.debug("Operation Complete return: " + trId.toString());
this.trId = trId;
why = ChangeTableWhy.TABLEUPDATED;
updateInvocation();
}
public void operationFailed(Throwable caught, String reason,
String failureDetails) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
ok.setVisible(true);
this.trId=trId;
why=ChangeTableWhy.TABLECURATION;
this.trId = null;
UtilsGXT3.alert("Error in RollBack", reason);
}
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
public void updateInvocation() {
if (trId != null) {
ChangeTableRequestEvent changeTableRequestEvent = new ChangeTableRequestEvent(
ChangeTableRequestType.DELETEROWS, trId, why);
eventBus.fireEvent(changeTableRequestEvent);
}
hide();
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
@Override
public void operationStopped(TRId trId, String reason, String details) {
Log.debug("Operation Stopped: [" + trId.toString() + ", " + reason
+ ", " + details + "]");
ok.setVisible(true);
this.trId = trId;
why = ChangeTableWhy.TABLECURATION;
}
@Override
public void operationGeneratingView() {
// TODO Auto-generated method stub
}
@Override
public void operationValidate(float elaborated) {
// TODO Auto-generated method stub
}
}

View File

@ -3,9 +3,12 @@ package org.gcube.portlets.user.td.tablewidget.client.rows;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.DeleteRowsSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.DeleteRowsProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -16,46 +19,50 @@ import com.google.web.bindery.event.shared.EventBus;
* Delete rows in table
*
* @author "Giancarlo Panichi"
*
*
*/
public class DeleteRows {
protected TRId trId;
protected EventBus eventBus;
protected ArrayList<String> rows;
protected DeleteRowsSession deleteRowsSession;
protected DeleteRowsProgressDialog deleteRowsProgressDialog;
public DeleteRows(TRId trId, ArrayList<String> rows,EventBus eventBus) {
protected DeleteRowsProgressDialog deleteRowsProgressDialog;
public DeleteRows(TRId trId, ArrayList<String> rows, EventBus eventBus) {
this.trId = trId;
this.rows=rows;
this.rows = rows;
this.eventBus = eventBus;
}
public void delete(){
deleteRowsSession =new DeleteRowsSession(trId, rows);
public void delete() {
deleteRowsSession = new DeleteRowsSession(trId, rows);
onDelete();
}
protected void onDelete(){
TDGWTServiceAsync.INSTANCE.startDeleteRows(
deleteRowsSession, new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
protected void onDelete() {
TDGWTServiceAsync.INSTANCE.startDeleteRows(deleteRowsSession,
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Delete Rows Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
"Error in invocation Delete Rows operation!");
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Delete Rows operation!");
}
}
public void onSuccess(Void result) {
deleteRowsProgressDialog= new DeleteRowsProgressDialog(deleteRowsSession, eventBus);
}
public void onSuccess(Void result) {
deleteRowsProgressDialog = new DeleteRowsProgressDialog(
deleteRowsSession, eventBus);
}
});
});
}
}

View File

@ -4,11 +4,14 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
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.rows.DuplicatesSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.DuplicatesRowsProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.properties.ColumnDataProperties;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -115,16 +118,16 @@ public class DuplicatesRowsPanel extends FramedPanel {
sm.setSelectionMode(SelectionMode.MULTI);
grid.setLoader(loader);
grid.setSelectionModel(sm);
//grid.getView().setAutoExpandColumn(labelCol);
// grid.getView().setAutoExpandColumn(labelCol);
grid.setHeight(360);
grid.getView().setStripeRows(true);
grid.getView().setColumnLines(true);
grid.getView().setAutoFill(true);
grid.getView().setAutoFill(true);
grid.setBorders(false);
grid.setLoadMask(true);
grid.setColumnReordering(true);
grid.setColumnResize(false);
// Delete Button
deleteButton = new TextButton("Delete");
SelectHandler deleteHandler = new SelectHandler() {
@ -146,21 +149,19 @@ public class DuplicatesRowsPanel extends FramedPanel {
}
};
validatesButton.addSelectHandler(validatesHandler);
FieldLabel columnsLabel = new FieldLabel(null, "Columns");
columnsLabel.getElement().applyStyles("font-weight:bold");
HBoxLayoutContainer hBox=new HBoxLayoutContainer();
hBox.add(validatesButton, new BoxLayoutData(new Margins(2,5,2,5)));
hBox.add(deleteButton,new BoxLayoutData(new Margins(2,5,2,5)));
HBoxLayoutContainer hBox = new HBoxLayoutContainer();
hBox.add(validatesButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
hBox.add(deleteButton, new BoxLayoutData(new Margins(2, 5, 2, 5)));
VerticalLayoutContainer v = new VerticalLayoutContainer();
v.setScrollMode(ScrollMode.AUTO);
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2,1,5,1)));
v.add(columnsLabel, new VerticalLayoutData(-1, -1, new Margins(2, 1, 5,
1)));
v.add(grid, new VerticalLayoutData(1, -1, new Margins(0)));
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0,
10, 0)));
v.add(hBox, new VerticalLayoutData(-1, -1, new Margins(10, 0, 10, 0)));
add(v, new VerticalLayoutData(-1, -1, new Margins(0)));
}
@ -182,10 +183,15 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
}
callback.onFailure(caught);
}
@ -201,10 +207,9 @@ public class DuplicatesRowsPanel extends FramedPanel {
}
protected void onDeleteDuplicate() {
ArrayList<ColumnData> col=getSelectedItems();
if(col==null||col.size()<1){
UtilsGXT3.alert("Attention",
"Attention no column selected!");
ArrayList<ColumnData> col = getSelectedItems();
if (col == null || col.size() < 1) {
UtilsGXT3.alert("Attention", "Attention no column selected!");
return;
}
duplicatesSession = new DuplicatesSession(trId, col,
@ -214,11 +219,16 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.debug("Delete Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
"Error in invocation Delete Duplicates operation!");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Delete Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Delete Duplicates operation!");
}
}
public void onSuccess(Void result) {
@ -229,13 +239,11 @@ public class DuplicatesRowsPanel extends FramedPanel {
});
}
protected void onValidatesDuplicate() {
ArrayList<ColumnData> col=getSelectedItems();
if(col==null||col.size()<1){
UtilsGXT3.alert("Attention",
"Attention no column selected!");
ArrayList<ColumnData> col = getSelectedItems();
if (col == null || col.size() < 1) {
UtilsGXT3.alert("Attention", "Attention no column selected!");
return;
}
duplicatesSession = new DuplicatesSession(trId, col,
@ -245,11 +253,16 @@ public class DuplicatesRowsPanel extends FramedPanel {
new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
Log.debug("Validates Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error Deleting Rows",
"Error in invocation Validates Duplicates operation!");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.debug("Validates Duplicates Error: "
+ caught.getLocalizedMessage());
UtilsGXT3
.alert("Error Deleting Rows",
"Error in invocation Validates Duplicates operation!");
}
}
public void onSuccess(Void result) {
@ -260,8 +273,5 @@ public class DuplicatesRowsPanel extends FramedPanel {
});
}
}

View File

@ -15,6 +15,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.rows.EditRowSession;
import org.gcube.portlets.user.td.tablewidget.client.progress.EditRowProgressDialog;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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;
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
import org.gcube.portlets.user.td.widgetcommonevent.shared.grid.model.RowRaw;
@ -72,9 +74,9 @@ public class EditRowPanel extends FramedPanel {
protected ArrayList<ColumnData> columns;
protected RowRaw rowRaw;
protected boolean editRow;
protected EditRowProgressDialog editRowProgressDialog;
protected VerticalLayoutContainer v;
private TextButton btnSave;
private TextButton btnClose;
@ -195,11 +197,15 @@ public class EditRowPanel extends FramedPanel {
new AsyncCallback<ArrayList<ColumnData>>() {
public void onFailure(Throwable caught) {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("load columns failure:"
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error retrieving columns",
"Error retrieving columns");
}
}
public void onSuccess(ArrayList<ColumnData> result) {
@ -587,33 +593,31 @@ public class EditRowPanel extends FramedPanel {
parent.close();
}
}
protected void callEditRow(EditRowSession editRowSession) {
final EditRowPanel panel=this;
TDGWTServiceAsync.INSTANCE.startEditRow(editRowSession,new AsyncCallback<Void>() {
final EditRowPanel panel = this;
public void onFailure(Throwable caught) {
Log.debug("EditRow: "
+ caught.getLocalizedMessage());
if(caught instanceof TDGWTSessionExpiredException){
UtilsGXT3.alert("Attention",caught.getLocalizedMessage());
} else {
UtilsGXT3.alert("Error",
"Error in operation invocation!");
}
}
TDGWTServiceAsync.INSTANCE.startEditRow(editRowSession,
new AsyncCallback<Void>() {
public void onSuccess(Void result) {
editRowProgressDialog = new EditRowProgressDialog(
panel, eventBus);
}
public void onFailure(Throwable caught) {
Log.debug("EditRow: " + caught.getLocalizedMessage());
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
UtilsGXT3.alert("Error",
"Error in operation invocation!");
}
}
public void onSuccess(Void result) {
editRowProgressDialog = new EditRowProgressDialog(
panel, eventBus);
}
});
});
}
}

View File

@ -4,12 +4,15 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.Validations;
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabValidationsMetadata;
import org.gcube.portlets.user.td.tablewidget.client.properties.ValidationsProperties;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
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.TRId;
import com.allen_sauer.gwt.log.client.Log;
@ -54,16 +57,15 @@ public class ValidationsTablePanel extends FramedPanel {
protected ListLoader<ListLoadConfig, ListLoadResult<Validations>> loader;
protected Grid<Validations> grid;
private boolean drawed;
public ValidationsTablePanel(EventBus eventBus) {
super();
this.eventBus = eventBus;
forceLayoutOnResize = true;
retrieveCurrentTR();
}
public ValidationsTablePanel(TRId trId, EventBus eventBus) {
super();
this.trId = trId;
@ -77,7 +79,7 @@ public class ValidationsTablePanel extends FramedPanel {
init();
create();
}
protected void init() {
setWidth(WIDTH);
setHeight(HEIGHT);
@ -90,19 +92,18 @@ public class ValidationsTablePanel extends FramedPanel {
ColumnConfig<Validations, String> descriptionCol = new ColumnConfig<Validations, String>(
props.description(), 168, "Description");
descriptionCol.setCell(new AbstractCell<String>() {
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
sb.appendHtmlConstant("<span title='"+value+"'>"
+ value + "</span>");
sb.appendHtmlConstant("<span title='" + value + "'>" + value
+ "</span>");
}
});
ColumnConfig<Validations, Boolean> validCol = new ColumnConfig<Validations, Boolean>(
props.valid(), 28, "Valid");
validCol.setCell(new AbstractCell<Boolean>() {
@ -176,7 +177,6 @@ public class ValidationsTablePanel extends FramedPanel {
grid.getView().setAutoExpandColumn(descriptionCol);
grid.getView().setEmptyText("No validation");
add(grid, new MarginData(0));
onResize();
@ -190,11 +190,16 @@ public class ValidationsTablePanel extends FramedPanel {
new AsyncCallback<TabValidationsMetadata>() {
public void onFailure(Throwable caught) {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
}
callback.onFailure(caught);
}
@ -218,28 +223,29 @@ public class ValidationsTablePanel extends FramedPanel {
}
public void update() {
retrieveCurrentTR();
loader.load();
}
public void update(TRId trId) {
this.trId=trId;
this.trId = trId;
loader.load();
}
protected void retrieveCurrentTR() {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {
@ -253,6 +259,5 @@ public class ValidationsTablePanel extends FramedPanel {
});
}
}

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTSessionExpiredException;
import org.gcube.portlets.user.td.gwtservice.shared.task.ValidationsTasksMetadata;
import org.gcube.portlets.user.td.tablewidget.client.resources.ResourceBundle;
import org.gcube.portlets.user.td.tablewidget.client.util.UtilsGXT3;
@ -11,6 +12,8 @@ import org.gcube.portlets.user.td.tablewidget.client.validation.tree.BaseDto;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.FolderDto;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.TreeDataGenerator;
import org.gcube.portlets.user.td.tablewidget.client.validation.tree.ValidationDto;
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.TRId;
import com.sencha.gxt.widget.core.client.event.CollapseItemEvent.CollapseItemHandler;
import com.allen_sauer.gwt.log.client.Log;
@ -108,8 +111,8 @@ public class ValidationsTasksPanel extends FramedPanel {
protected void create() {
con = new VerticalLayoutContainer();
con.setScrollMode(ScrollMode.AUTO);
//con.setAdjustForScroll(true);
// con.setAdjustForScroll(true);
store = new TreeStore<BaseDto>(new KeyProvider());
FolderDto root = gen.getRoot();
@ -149,7 +152,7 @@ public class ValidationsTasksPanel extends FramedPanel {
* @Override public String getPath() { return "description"; } });
* cc2.setHeader("Description");
*/
ColumnConfig<BaseDto, Boolean> cc3 = new ColumnConfig<BaseDto, Boolean>(
new ValueProvider<BaseDto, Boolean>() {
@ -213,8 +216,7 @@ public class ValidationsTasksPanel extends FramedPanel {
tree.setLoadMask(true);
tree.setColumnResize(true);
tree.getView().setAutoExpandColumn(cc1);
IconProvider<BaseDto> iconProvider = new IconProvider<BaseDto>() {
@Override
@ -238,26 +240,25 @@ public class ValidationsTasksPanel extends FramedPanel {
}
};
tree.setIconProvider(iconProvider);
tree.addExpandHandler(new ExpandItemHandler<BaseDto>() {
@Override
public void onExpand(ExpandItemEvent<BaseDto> event) {
forceLayout();
}
});
tree.addCollapseHandler(new CollapseItemHandler<BaseDto>() {
@Override
public void onCollapse(CollapseItemEvent<BaseDto> event) {
forceLayout();
}
});
ToolBar toolBar = new ToolBar();
TextButton btnExpandAll = new TextButton();
@ -273,8 +274,7 @@ public class ValidationsTasksPanel extends FramedPanel {
}
});
toolBar.add(btnExpandAll);
TextButton btnCollapseAll = new TextButton();
// btnReload.setText("Expand All");
btnCollapseAll.setIcon(ResourceBundle.INSTANCE.expandAll12());
@ -288,16 +288,12 @@ public class ValidationsTasksPanel extends FramedPanel {
}
});
toolBar.add(btnCollapseAll);
con.add(toolBar, new VerticalLayoutData(1, -1));
con.add(tree, new VerticalLayoutData(1, -1));
add(con,new MarginData(0));
add(con, new MarginData(0));
}
protected void retrieveValidations() {
@ -306,12 +302,16 @@ public class ValidationsTasksPanel extends FramedPanel {
new AsyncCallback<ValidationsTasksMetadata>() {
public void onFailure(Throwable caught) {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Load validations metadata failure: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert(
"Error retrieving validations metadata",
"Error retrieving validations metadata");
}
}
public void onSuccess(ValidationsTasksMetadata result) {
@ -338,11 +338,15 @@ public class ValidationsTasksPanel extends FramedPanel {
TDGWTServiceAsync.INSTANCE.getCurrentTRId(new AsyncCallback<TRId>() {
public void onFailure(Throwable caught) {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
if (caught instanceof TDGWTSessionExpiredException) {
eventBus.fireEvent(new SessionExpiredEvent(
SessionExpiredType.EXPIREDONSERVER));
} else {
Log.error("Error retrieving current TRId: "
+ caught.getLocalizedMessage());
UtilsGXT3.alert("Error",
"Error retrieving current tabular resource id");
}
}
public void onSuccess(TRId result) {