1 Estructura.headerPanel = header;2 3 4 createComplex.addStyleName("logout-button");5 createComplex.setText("Complejos");6 createComplex.addClickHandler(new ClickHandler() {7 8 @Override9 public void onClick(ClickEvent event) {10 setPanel(new ConfigComplexes());11 }12 });13 14 adminStrings.addStyleName("logout-button");15 adminStrings.setText("Strings");16 adminStrings.addClickHandler(new ClickHandler() {17 18 @Override19 public void onClick(ClickEvent event) {20 //setPanel(new ConfigMessages());21 setPanel(new ConfigCategoriesMessages());22 }23 });24 25 logout.addStyleName("logout-button");26 logout.setText("Cerrar la aplicacion");27 logout.addClickHandler(new ClickHandler() {28 29 @Override30 public void onClick(ClickEvent event) {31 32 // Borramos las cookies. Tampoco haria falta.33 34 if (Cookies.getCookieNames().contains("remember") && Integer.parseInt(Cookies.getCookie("remember")) == 0){35 Cookies.removeCookie("session");36 Cookies.removeCookie("login");37 }38 39 new StandardRequest(ApiCalls.logout,new MyCallback<String>() {40 41 @Override42 public void onError(String t) {}43 44 @Override45 public void onDone(String result) {46 Window.Location.reload();47 48 }49 },"");50 51 }52 });53 }54 55 public static void showMessage(String mensaje){56 57 // Muestra un mensaje en la cabecera durante unos segundos (4).58 // Usado para mostrar advertencias en lugar de los Window.alert.59 60 final InlineLabel ilabel = new InlineLabel(mensaje);61 /*final FlowPanel containerMessage = new FlowPanel();62 containerMessage.add(ilabel);63 headerPanel.add(containerMessage);64 */65 headerPanel.add(ilabel);66 67 Timer t = new Timer() {68 public void run() {69 // containerMessage.removeFromParent();70 ilabel.removeFromParent();71 }72 };73 74 t.schedule(4000);75 76 }77
Enlace
El enlace para compartir es: