Added UtilsGXT3
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-column-widget@93271 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9292bd4ee3
commit
a57b4d5c54
|
@ -0,0 +1,28 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.utils;
|
||||
|
||||
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 {
|
||||
|
||||
/**
|
||||
* Creates a message box with an info icon and the specified title and
|
||||
* message.
|
||||
*
|
||||
* @param title
|
||||
* the message box title
|
||||
* @param message
|
||||
* the message displayed in the message box
|
||||
*/
|
||||
public InfoMessageBox(String title, String message) {
|
||||
super(title, message);
|
||||
|
||||
setIcon(ICONS.info());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package org.gcube.portlets.user.td.columnwidget.client.utils;
|
||||
|
||||
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