Updated utils
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@100245 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
274d781987
commit
cecd041fe0
|
@ -1,16 +1,18 @@
|
||||||
package org.gcube.portlets.user.td.columnwidget.client.utils;
|
package org.gcube.portlets.user.td.columnwidget.client.utils;
|
||||||
|
|
||||||
|
import com.google.gwt.core.client.Callback;
|
||||||
import com.google.gwt.user.client.Element;
|
import com.google.gwt.user.client.Element;
|
||||||
import com.sencha.gxt.core.client.dom.XElement;
|
import com.sencha.gxt.core.client.dom.XElement;
|
||||||
|
import com.sencha.gxt.widget.core.client.Component;
|
||||||
import com.sencha.gxt.widget.core.client.box.AlertMessageBox;
|
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;
|
||||||
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
import com.sencha.gxt.widget.core.client.event.HideEvent.HideHandler;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author "Giancarlo Panichi"
|
* @author "Giancarlo Panichi" <a
|
||||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class UtilsGXT3 {
|
public class UtilsGXT3 {
|
||||||
public static void mask(Element element) {
|
public static void mask(Element element) {
|
||||||
|
@ -21,8 +23,7 @@ public class UtilsGXT3 {
|
||||||
public static void umask(Element element) {
|
public static void umask(Element element) {
|
||||||
element.<XElement> cast().unmask();
|
element.<XElement> cast().unmask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void alert(String title, String message) {
|
public static void alert(String title, String message) {
|
||||||
final AlertMessageBox d = new AlertMessageBox(title, message);
|
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||||
d.addHideHandler(new HideHandler() {
|
d.addHideHandler(new HideHandler() {
|
||||||
|
@ -34,7 +35,20 @@ public class UtilsGXT3 {
|
||||||
d.show();
|
d.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void alert(String title, String message,
|
||||||
|
final Callback<Component, Void> callback) {
|
||||||
|
final AlertMessageBox d = new AlertMessageBox(title, message);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
Component comp = event.getSource();
|
||||||
|
callback.onSuccess(comp);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
}
|
||||||
|
|
||||||
public static void info(String title, String message) {
|
public static void info(String title, String message) {
|
||||||
final InfoMessageBox d = new InfoMessageBox(title, message);
|
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||||
d.addHideHandler(new HideHandler() {
|
d.addHideHandler(new HideHandler() {
|
||||||
|
@ -46,5 +60,19 @@ public class UtilsGXT3 {
|
||||||
d.show();
|
d.show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void info(String title, String message,
|
||||||
|
final Callback<Component, Void> callback) {
|
||||||
|
final InfoMessageBox d = new InfoMessageBox(title, message);
|
||||||
|
d.addHideHandler(new HideHandler() {
|
||||||
|
|
||||||
|
public void onHide(HideEvent event) {
|
||||||
|
Component comp = event.getSource();
|
||||||
|
callback.onSuccess(comp);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
d.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue