Added UtilsGXT3
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@93270 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4b7b10275e
commit
4543ba398e
|
@ -9,6 +9,7 @@ import org.gcube.portlets.user.td.tablewidget.client.progress.ChangeTableTypePro
|
|||
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.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -20,12 +21,9 @@ import com.sencha.gxt.core.client.dom.ScrollSupport.ScrollMode;
|
|||
import com.sencha.gxt.core.client.util.Margins;
|
||||
import com.sencha.gxt.data.shared.ListStore;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.ComboBox;
|
||||
|
@ -120,7 +118,7 @@ public class ChangeTableTypePanel extends FramedPanel {
|
|||
changeTableTypeSession=new ChangeTableTypeSession(trId,tableTypeElement.getTableType());
|
||||
callChangeTableType();
|
||||
} else {
|
||||
alert("Attention", "Select a table type!");
|
||||
UtilsGXT3.alert("Attention", "Select a table type!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -131,7 +129,7 @@ public class ChangeTableTypePanel extends FramedPanel {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Change The Table Type Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error Changing The Table Type",
|
||||
UtilsGXT3.alert("Error Changing The Table Type",
|
||||
"Error in invocation of Change Table Type operation!");
|
||||
|
||||
}
|
||||
|
@ -159,7 +157,7 @@ public class ChangeTableTypePanel extends FramedPanel {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.error("Error retrieving table: "
|
||||
+ caught.getMessage());
|
||||
alert("Error retrieving table",caught.getMessage());
|
||||
UtilsGXT3.alert("Error retrieving table",caught.getMessage());
|
||||
}
|
||||
|
||||
public void onSuccess(TableData result) {
|
||||
|
@ -173,17 +171,7 @@ public class ChangeTableTypePanel extends FramedPanel {
|
|||
|
||||
}
|
||||
|
||||
private void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void update(TRId trId) {
|
||||
this.trId = trId;
|
||||
|
|
|
@ -2,7 +2,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.tr.clone.CloneTabularResourceSession;
|
||||
import org.gcube.portlets.user.td.tablewidget.client.util.InfoMessageBox;
|
||||
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.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
@ -10,9 +10,6 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
|||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
|
||||
public class CloneTabularResource {
|
||||
protected TRId trId;
|
||||
|
@ -38,7 +35,7 @@ public class CloneTabularResource {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Clone Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error Cloning Tabular Resource",
|
||||
UtilsGXT3.alert("Error Cloning Tabular Resource",
|
||||
"Error in clone operation!");
|
||||
|
||||
}
|
||||
|
@ -47,35 +44,13 @@ public class CloneTabularResource {
|
|||
Log.info("TR Clone:"+result);
|
||||
final ChangeTableRequestEvent event=new ChangeTableRequestEvent(ChangeTableRequestType.CLONETABULARRESOURCE,result);
|
||||
eventBus.fireEvent(event);
|
||||
info("Clone", "Clone Tabular Resource Succed");
|
||||
UtilsGXT3.info("Clone", "Clone Tabular Resource Succed");
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
private void info(String title, String message) {
|
||||
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.td.tablewidget.client.progress;
|
||||
|
||||
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.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
@ -11,12 +12,9 @@ import com.sencha.gxt.core.client.util.Margins;
|
|||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||
import com.sencha.gxt.widget.core.client.Window;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
@ -107,12 +105,8 @@ public class ChangeTableTypeProgressDialog extends Window implements ChangeTable
|
|||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
AlertMessageBox d = new AlertMessageBox("Error Changing The Table Type", reason);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
public void onHide(HideEvent event) {
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
UtilsGXT3.alert("Error Changing The Table Type", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.td.tablewidget.client.progress;
|
||||
|
||||
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.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
@ -11,12 +12,9 @@ import com.sencha.gxt.core.client.util.Margins;
|
|||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.ProgressBar;
|
||||
import com.sencha.gxt.widget.core.client.Window;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
|
||||
|
@ -107,12 +105,8 @@ public class DeleteRowsProgressDialog extends Window implements DeleteRowsProgre
|
|||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
AlertMessageBox d = new AlertMessageBox("Error Deleting Rows", reason);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
public void onHide(HideEvent event) {
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
UtilsGXT3.alert("Error Deleting Rows", reason);
|
||||
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.td.tablewidget.client.progress;
|
||||
|
||||
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.type.ChangeTableRequestType;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
@ -107,12 +108,7 @@ public class DuplicatesRowsProgressDialog extends Window implements DuplicatesRo
|
|||
String failureDetails) {
|
||||
ok.setVisible(true);
|
||||
this.trId=null;
|
||||
AlertMessageBox d = new AlertMessageBox("Error Deleting Rows", reason);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
public void onHide(HideEvent event) {
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
UtilsGXT3.alert("Error Deleting Rows", reason);
|
||||
}
|
||||
|
||||
public void updateInvocation(){
|
||||
|
|
|
@ -5,14 +5,12 @@ import java.util.ArrayList;
|
|||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTServiceAsync;
|
||||
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.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.web.bindery.event.shared.EventBus;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
|
||||
public class DeleteRows {
|
||||
protected TRId trId;
|
||||
|
@ -39,7 +37,7 @@ public class DeleteRows {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Delete Rows Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error Deleting Rows",
|
||||
UtilsGXT3.alert("Error Deleting Rows",
|
||||
"Error in invocation Delete Rows operation!");
|
||||
|
||||
}
|
||||
|
@ -53,16 +51,5 @@ public class DeleteRows {
|
|||
|
||||
}
|
||||
|
||||
private void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ 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.shared.TRId;
|
||||
|
||||
import com.allen_sauer.gwt.log.client.Log;
|
||||
|
@ -28,14 +29,11 @@ import com.sencha.gxt.data.shared.loader.ListLoadResultBean;
|
|||
import com.sencha.gxt.data.shared.loader.ListLoader;
|
||||
import com.sencha.gxt.data.shared.loader.LoadResultListStoreBinding;
|
||||
import com.sencha.gxt.widget.core.client.FramedPanel;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.button.TextButton;
|
||||
import com.sencha.gxt.widget.core.client.container.BoxLayoutContainer.BoxLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.container.HBoxLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer;
|
||||
import com.sencha.gxt.widget.core.client.container.VerticalLayoutContainer.VerticalLayoutData;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
|
||||
import com.sencha.gxt.widget.core.client.form.FieldLabel;
|
||||
|
@ -185,7 +183,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.error("load columns failure:"
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error retrieving columns",
|
||||
UtilsGXT3.alert("Error retrieving columns",
|
||||
"Error retrieving columns");
|
||||
callback.onFailure(caught);
|
||||
}
|
||||
|
@ -204,7 +202,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
protected void onDeleteDuplicate() {
|
||||
ArrayList<ColumnData> col=getSelectedItems();
|
||||
if(col==null||col.size()<1){
|
||||
alert("Attention",
|
||||
UtilsGXT3.alert("Attention",
|
||||
"Attention no column selected!");
|
||||
return;
|
||||
}
|
||||
|
@ -217,7 +215,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Delete Duplicates Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error Deleting Rows",
|
||||
UtilsGXT3.alert("Error Deleting Rows",
|
||||
"Error in invocation Delete Duplicates operation!");
|
||||
|
||||
}
|
||||
|
@ -235,7 +233,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
protected void onValidatesDuplicate() {
|
||||
ArrayList<ColumnData> col=getSelectedItems();
|
||||
if(col==null||col.size()<1){
|
||||
alert("Attention",
|
||||
UtilsGXT3.alert("Attention",
|
||||
"Attention no column selected!");
|
||||
return;
|
||||
}
|
||||
|
@ -248,7 +246,7 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
public void onFailure(Throwable caught) {
|
||||
Log.debug("Validates Duplicates Error: "
|
||||
+ caught.getLocalizedMessage());
|
||||
alert("Error Deleting Rows",
|
||||
UtilsGXT3.alert("Error Deleting Rows",
|
||||
"Error in invocation Validates Duplicates operation!");
|
||||
|
||||
}
|
||||
|
@ -263,16 +261,6 @@ public class DuplicatesRowsPanel extends FramedPanel {
|
|||
}
|
||||
|
||||
|
||||
private void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,12 @@ package org.gcube.portlets.user.td.tablewidget.client.util;
|
|||
|
||||
import com.sencha.gxt.widget.core.client.box.MessageBox;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class InfoMessageBox extends MessageBox {
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package org.gcube.portlets.user.td.tablewidget.client.util;
|
||||
|
||||
import com.google.gwt.user.client.Element;
|
||||
import com.sencha.gxt.core.client.dom.XElement;
|
||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent;
|
||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class UtilsGXT3 {
|
||||
public static void mask(Element element) {
|
||||
XElement el = element.<XElement> cast();
|
||||
el.mask("Loading...");
|
||||
}
|
||||
|
||||
public static void umask(Element element) {
|
||||
element.<XElement> cast().unmask();
|
||||
}
|
||||
|
||||
|
||||
public static void alert(String title, String message) {
|
||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
public static void info(String title, String message) {
|
||||
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||
d.addHideHandler(new HideHandler() {
|
||||
|
||||
public void onHide(HideEvent event) {
|
||||
|
||||
}
|
||||
});
|
||||
d.show();
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue