@Test public void checkMouseOutEvent() { tested = false; Button b = new Button(); b.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { tested = !tested; } }); // simule the event mouseOut(b); Assert.assertTrue("onMouseOut event was not triggered", tested); }
@Override public void redisplayJobIds(List<String> jobIds) { tab.clear(); int row = 0; for (final String jobId : jobIds) { int col = 0; final int fRow = row; Button execButton = new Button( constants.execute(), new ClickHandler() { @Override public void onClick(ClickEvent event) { fireAppJobRequested(jobId); } }); execButton.addStyleName("execButton"); execButton.addMouseOverHandler( new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { tab.getRowFormatter().addStyleName(fRow, "hoveredOn"); } }); execButton.addMouseOutHandler( new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { tab.getRowFormatter().removeStyleName(fRow, "hoveredOn"); } }); tab.setWidget(row, col++, new Label(jobId)); tab.setWidget(row, col++, execButton); ++row; } }
public void addText(String TextoBoton) { // if (!TextoBoton.isEmpty() // && TextoBoton.length() > 2) { Button btnNewButton_1 = new Button("<img src=\"Users.gif\">" + TextoBoton); btnNewButton_1.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Button sourceB = ((Button) event.getSource()); verticalPanel_1.remove(sourceB); if (verticalPanel_1.getWidgetCount() == 0) SaveNewUsers.setVisible(false); } }); btnNewButton_1.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonPush"); } }); btnNewButton_1.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonTOP"); } }); btnNewButton_1.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonTOPOver"); } }); btnNewButton_1.setStyleName("gwt-ButtonTOP"); btnNewButton_1.setText(TextoBoton); btnNewButton_1.setHTML("<img src=\"Users.gif\">" + TextoBoton); verticalPanel_1.add(btnNewButton_1); btnNewButton_1.setSize("100%", "100%"); SaveNewUsers.setVisible(true); // } else // Window.alert("The User need to be a valid reference"); }
public SeleccionCatalogoPopupPanel( CatalogoClient catalogo, Label catalogLabel, Label openCatalogLabel, EditorActivityPopupPanel yo) { super(true); Catalogo = catalogo; LPrivate = catalogLabel; LPublic = openCatalogLabel; Father = yo; GeneralPanel = new AbsolutePanel(); setAnimationEnabled(true); HorizontalPanel PanelActivityH = new HorizontalPanel(); PanelActivity = new VerticalPanel(); EditorZone = new SimplePanel(); EditorZone.setHeight(Constants.TAMANO_PANEL_EDICION); EditorZone.setVisible(false); PanelActivity.add(EditorZone); PanelActivity.add(PanelActivityH); PanelActivityH.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); PanelActivityH.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); PanelActivityH.setSpacing(4); GeneralPanel.add(PanelActivity, 0, 0); setWidget(GeneralPanel); GeneralPanel.setSize( Window.getClientWidth() + Constants.PX, Window.getClientHeight() + Constants.PX); // PanelActivityH.setSize("100%", "100%"); // PanelActivity.setSize("100%", "100%"); PanelActivity.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); PanelActivity.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); SelectTeacherCatalogButton = new Button(SeleccionCatalogoPopupPanel.BOTTON_TEACHER_CATALOG); SelectTeacherCatalogButton.setSize("100%", "100%"); SelectTeacherCatalogButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); SelectTeacherCatalogButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); SelectTeacherCatalogButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); SelectTeacherCatalogButton.setStyleName("gwt-ButtonCenter"); SelectTeacherCatalogButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { LPrivate.setText("Teacher Catalog :" + Catalogo.getCatalogName()); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto(ConstantsInformation.LOADING); bookReaderServiceHolder.loadCatalogById( Catalogo.getId(), new AsyncCallback<CatalogoClient>() { @Override public void onSuccess(CatalogoClient result) { LoadingPanel.getInstance().hide(); Father.setSelectedCatalog(result); Father.setPanel_Selecion_Default_Visibility(true); hide(); } @Override public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); Window.alert(ConstantsError.ERROR_LOADING_CATALOG); hide(); } }); } }); PanelActivityH.add(SelectTeacherCatalogButton); SelectOpenCatalogButton = new Button(SeleccionCatalogoPopupPanel.BOTTON_OPEN_CATALOG); SelectOpenCatalogButton.setSize("100%", "100%"); SelectOpenCatalogButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); SelectOpenCatalogButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); SelectOpenCatalogButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); SelectOpenCatalogButton.setStyleName("gwt-ButtonCenter"); SelectOpenCatalogButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { LPublic.setText("Open Catalog :" + Catalogo.getCatalogName()); Father.setSelectedCatalogPublic(Catalogo); hide(); } }); PanelActivityH.add(SelectOpenCatalogButton); PanelEdicion = new AbsolutePanel(); }
public FilterBasicPopUp() { super(true); setAnimationEnabled(true); AllBoolean = false; filtro = new ArrayList<TypeClient>(); VerticalPanel verticalPanel = new VerticalPanel(); setWidget(verticalPanel); verticalPanel.setSize("100%", "100%"); SimplePanel simplePanel = new SimplePanel(); verticalPanel.add(simplePanel); simplePanel.setSize("100%", "100%"); if (textBox == null) textBox = new TextBox(); textBox.setVisibleLength(100); simplePanel.setWidget(textBox); textBox.setSize("98%", "100%"); Lang = ActualState.getLanguage(); horizontalPanel = new HorizontalPanel(); verticalPanel.add(horizontalPanel); Button btnNewButton = new Button(Lang.getFilterButton()); horizontalPanel.add(btnNewButton); horizontalPanel.setCellHorizontalAlignment(btnNewButton, HasHorizontalAlignment.ALIGN_CENTER); All = new Button(Lang.getSelect_All()); All.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { AllBoolean = !AllBoolean; if (AllBoolean) { textBox.setEnabled(false); textBox.setReadOnly(true); textBox.setText(Lang.getAllSelected()); } else { textBox.setEnabled(true); textBox.setReadOnly(false); textBox.setText(""); } } }); horizontalPanel.add(All); All.setSize("100%", "100%"); All.setStyleName("gwt-ButtonCenter"); All.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); All.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); All.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); Advance = new Button(Lang.getAdvance()); Advance.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { Controlador.change2FilterAdvance(); } }); Advance.setSize("100%", "100%"); Advance.setStyleName("gwt-ButtonCenter"); Advance.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); Advance.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); Advance.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); horizontalPanel.add(Advance); btnNewButton.setSize("100%", "100%"); btnNewButton.setStyleName("gwt-ButtonCenter"); btnNewButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); btnNewButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { filtro = new ArrayList<TypeClient>(); if (!AllBoolean) { String Token = textBox.getText(); String[] Words = Token.split(","); if (Words.length > 0) { Types = MakeWords(Words); filtro = FindTypes(Types, ActualState.getReadingActivityCloseCatalog()); ArrayList<UserClient> Usuarios = FindUsers(Types, ActualState.getReadingactivity().getGroup()); MainEntryPoint.setFiltro(filtro, Usuarios, Types, new ArrayList<Long>()); Me.hide(); } } else { MainEntryPoint.CleanFilter(); Me.hide(); } } private ArrayList<UserClient> FindUsers(ArrayList<String> types, GroupClient group) { ArrayList<UserClient> salida = new ArrayList<UserClient>(); for (UserClient studentUnit : group.getParticipatingUsers()) { testUserIn(studentUnit, types, salida); } testUserIn(group.getProfessor(), types, salida); return salida; } private void testUserIn( UserClient studentUnit, ArrayList<String> types, ArrayList<UserClient> salida) { for (String typocandidato : types) { if (studentUnit.getFirstName().toUpperCase().contains(typocandidato.toUpperCase())) AddSalida(studentUnit, salida); if (studentUnit.getLastName().toUpperCase().contains(typocandidato.toUpperCase())) AddSalida(studentUnit, salida); if (studentUnit .getId() .toString() .toUpperCase() .contains(typocandidato.toUpperCase())) AddSalida(studentUnit, salida); if (studentUnit.getEmail().toUpperCase().contains(typocandidato.toUpperCase())) AddSalida(studentUnit, salida); } } private void AddSalida(UserClient studentUnit, ArrayList<UserClient> salida) { if (!salida.contains(studentUnit)) salida.add(studentUnit); } private ArrayList<TypeClient> FindTypes( ArrayList<String> types, CatalogoClient catalogo) { ArrayList<TypeClient> Salida = new ArrayList<TypeClient>(); for (EntryClient entryUni : catalogo.getEntries()) { EvaluaEntry(entryUni, types, Salida); } return Salida; } private void EvaluaEntry( EntryClient entryUni, ArrayList<String> types, ArrayList<TypeClient> salida) { if (entryUni instanceof TypeClient) EvaluaType((TypeClient) entryUni, types, salida); else if (entryUni instanceof TypeCategoryClient) EvaluaTypeCategory((TypeCategoryClient) entryUni, types, salida); } private void EvaluaTypeCategory( TypeCategoryClient entryUni, ArrayList<String> types, ArrayList<TypeClient> salida) { if (existeEn(entryUni, types)) AddHijos(entryUni, salida); } private void AddHijos(TypeCategoryClient entryUni, ArrayList<TypeClient> salida) { for (EntryClient candidato : entryUni.getChildren()) { if (candidato instanceof TypeClient) AddASalida((TypeClient) candidato, salida); else if (candidato instanceof TypeCategoryClient) AddHijos((TypeCategoryClient) candidato, salida); } } private void EvaluaType( TypeClient entryUni, ArrayList<String> types, ArrayList<TypeClient> salida) { if (existeEn(entryUni, types)) AddASalida(entryUni, salida); } private void AddASalida(TypeClient entryUni, ArrayList<TypeClient> salida) { if (!salida.contains(entryUni)) salida.add(entryUni); } private boolean existeEn(EntryClient entryUni, ArrayList<String> types) { for (String candidato : types) { if (candidato.toUpperCase().contains(entryUni.getName().toUpperCase())) return true; } return false; } private ArrayList<String> MakeWords(String[] words) { ArrayList<String> Salida = new ArrayList<String>(); for (String SS : words) { if (!SS.isEmpty()) Salida.add(SS); } return Salida; } }); }
public void onModuleLoad() { RootPanel RootTXOriginal = RootPanel.get(); RootPanel RootMenu = RootPanel.get("Menu"); RootTXOriginal.setSize("100%", "100%"); RootMenu.setStyleName("Root"); RootTXOriginal.setStyleName("Root"); YO = this; MenuBar menuBar = new MenuBar(false); RootMenu.add(menuBar); menuBar.setWidth("100%"); MenuItem menuItem = new MenuItem("GroupAdministration", false, (Command) null); menuItem.setHTML("Users Administrator"); menuItem.setEnabled(false); menuBar.addItem(menuItem); MenuItemSeparator separator = new MenuItemSeparator(); menuBar.addSeparator(separator); MenuItem mntmBack = new MenuItem( "Back", false, new Command() { public void execute() { Controlador.change2Administrator(); } }); menuBar.addItem(mntmBack); MenuItem AddLots = new MenuItem( "Masive add", false, new Command() { public void execute() { PanelAddMasibo PAM = new PanelAddMasibo(YO); PAM.setVisible(true); PAM.center(); } }); AddLots.setHTML("Masive add"); menuBar.addItem(AddLots); HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); RootTXOriginal.add(horizontalSplitPanel, 0, 25); horizontalSplitPanel.setSize("100%", "100%"); VerticalPanel verticalPanel = new VerticalPanel(); horizontalSplitPanel.setLeftWidget(verticalPanel); verticalPanel.setSize("100%", ""); SimplePanel simplePanel = new SimplePanel(); verticalPanel.add(simplePanel); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); simplePanel.setWidget(horizontalPanel); horizontalPanel.setSize("100%", "100%"); textBox = new TextBox(); textBox.setVisibleLength(50); horizontalPanel.add(textBox); textBox.setWidth("90%"); Button btnNewButton = new Button("New button"); btnNewButton.setText("+"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); btnNewButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); btnNewButton.setStyleName("gwt-ButtonCenter"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { String S = ClearText(textBox.getText()); if (isValidEmail(S)) addText(S); else Window.alert(ErrorConstants.ERROR_NO_EMAIL_VALIDO + S); textBox.setText(""); } private native boolean isValidEmail(String email) /*-{ var reg1 = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; // not valid var reg2 = /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/; // valid return !reg1.test(email) && reg2.test(email); }-*/; }); horizontalPanel.add(btnNewButton); btnNewButton.setWidth("66px"); btnNewButton.setHTML("+"); verticalPanel_1 = new VerticalPanel(); verticalPanel.add(verticalPanel_1); verticalPanel_1.setWidth("100%"); SaveNewUsers = new Button("Save New Users"); SaveNewUsers.setVisible(false); SaveNewUsers.addClickHandler( new ClickHandler() { private AsyncCallback<Boolean> callback; public void onClick(ClickEvent event) { Pilallamada = new Stack<UserApp>(); int Elementos_a_salvar = verticalPanel_1.getWidgetCount(); for (int i = 0; i < Elementos_a_salvar; i++) { Widget Uno = verticalPanel_1.getWidget(i); Button Dos = (Button) Uno; String Nombre = Dos.getText(); Pilallamada.add(new UserApp(Nombre, Constants.STUDENT)); } if (!Pilallamada.isEmpty()) { callback = new AsyncCallback<Boolean>() { public void onFailure(Throwable caught) { Window.alert("The user could not be saved at this moment"); LoadingPanel.getInstance().hide(); } public void onSuccess(Boolean result) { LoadingPanel.getInstance().hide(); if (!result) Window.alert( "The user " + Pilallamada.peek().getEmail() + " already exists (if you do not see him/her it's because he may be administrator)"); Pilallamada.pop(); if (!Pilallamada.isEmpty()) { LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Saving..."); bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback); } else { refreshPanel(); } } }; LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Saving..."); bookReaderServiceHolder.saveUser(Pilallamada.peek(), callback); } verticalPanel_1.clear(); SaveNewUsers.setVisible(false); } }); SaveNewUsers.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSavePush"); } }); SaveNewUsers.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSave"); } }); SaveNewUsers.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonBottonSaveOver"); } }); SaveNewUsers.setStyleName("gwt-ButtonBottonSave"); // SaveNewUsers.setStyleName("gwt-MenuItemMio"); verticalPanel.add(SaveNewUsers); SaveNewUsers.setSize("100%", "100%"); ScrollPanel scrollPanel = new ScrollPanel(); horizontalSplitPanel.setRightWidget(scrollPanel); scrollPanel.setSize("100%", "100%"); stackPanel_1 = new StackPanelMio(); scrollPanel.setWidget(stackPanel_1); // simplePanel.add(stackPanel_1); stackPanel_1.setBotonTipo(new BotonesStackPanelUsersMio("prototipo", new VerticalPanel())); stackPanel_1.setBotonClick( new ClickHandler() { public void onClick(ClickEvent event) { Long Nombre = ((BotonesStackPanelUsersMio) event.getSource()).getEntidad().getID(); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Loading..."); bookReaderServiceHolder.loadUserById( Nombre, new AsyncCallback<UserApp>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); } public void onSuccess(UserApp result) { LoadingPanel.getInstance().hide(); if (result.getGroupIds() == null) result.setGroupIds(new ArrayList<Long>()); if (!result.getGroupIds().isEmpty()) if (Window.confirm( InformationConstants.ARE_YOU_SURE_DELETE_USER + result.getGroupIds().size() + InformationConstants.ARE_YOU_SURE_DELETE_USER2)) remove(result.getId()); else { } else { if (Window.confirm( "Are you sure you want to delete this user?, he is not a member of any group")) remove(result.getId()); } } }); } private void remove(Long userId) { LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Deleting..."); bookReaderServiceHolder.deleteUserApp( userId, new AsyncCallback<Integer>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); Window.alert("Sorry but the user could not be removed, try again later"); } public void onSuccess(Integer result) { LoadingPanel.getInstance().hide(); refreshPanel(); } }); } }); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Loading..."); bookReaderServiceHolder.getUsersApp( new AsyncCallback<ArrayList<UserApp>>() { public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); } public void onSuccess(ArrayList<UserApp> result) { LoadingPanel.getInstance().hide(); if (result.size() < 10) { for (UserApp User1 : result) { String Bienvenida; if ((User1.getName() != null) && (!User1.getName().isEmpty())) Bienvenida = User1.getName(); else Bienvenida = User1.getEmail(); EntidadUser E = new EntidadUser(Bienvenida, User1.getId()); stackPanel_1.addBotonLessTen(E); } } else { for (UserApp User1 : result) { String Bienvenida; if ((User1.getName() != null) && (!User1.getName().isEmpty())) Bienvenida = User1.getName(); else Bienvenida = User1.getEmail(); EntidadUser E = new EntidadUser(Bienvenida, User1.getId()); stackPanel_1.addBoton(E); } } stackPanel_1.setSize("100%", "100%"); stackPanel_1.ClearEmpty(); } }); stackPanel_1.setSize("100%", "100%"); }
public void onModuleLoad() { RootPanel rootPanel = RootPanel.get(); RootPanel RootMenu = RootPanel.get("Menu"); MenuBar menuBar = new MenuBar(false); RootMenu.add(menuBar); MenuItem CloseBoton = new MenuItem( "Close", false, new Command() { public void execute() { if (ActualUser.getUser().getProfile().equals(Constants.PROFESSOR)) Controlador.change2Administrator(); else if (ActualUser.getUser().getProfile().equals(Constants.STUDENT)) Controlador.change2MyActivities(); } }); menuBar.addItem(CloseBoton); SimplePanel simplePanel = new SimplePanel(); rootPanel.add(simplePanel, 0, 25); simplePanel.setSize("100%", "100%"); DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.EM); simplePanel.setWidget(dockLayoutPanel); dockLayoutPanel.setSize("100%", "100%"); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); dockLayoutPanel.addWest(verticalPanel, 32.2); verticalPanel.setSize("100%", "100%"); HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalPanel_1); horizontalPanel_1.setWidth("100%"); VerticalPanel PanelCampos = new VerticalPanel(); PanelCampos.setSpacing(10); horizontalPanel_1.add(PanelCampos); PanelCampos.setWidth("100%"); HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); PanelCampos.add(horizontalPanel_2); horizontalPanel_2.setWidth("100%"); Label lblNewLabel = new Label("Nombre"); horizontalPanel_2.add(lblNewLabel); NameText = new TextBox(); NameText.setMaxLength(25); NameText.setVisibleLength(25); horizontalPanel_2.add(NameText); NameText.setWidth("90%"); String Nombre = ""; if ((ActualUser.getUser().getName() != null) && (!ActualUser.getUser().getName().isEmpty())) Nombre = ActualUser.getUser().getName(); NameText.setText(Nombre); HorizontalPanel horizontalPanel_3 = new HorizontalPanel(); horizontalPanel_3.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); PanelCampos.add(horizontalPanel_3); horizontalPanel_3.setWidth("100%"); Label lblNewLabel_1 = new Label("Apellidos"); horizontalPanel_3.add(lblNewLabel_1); ApellidosText = new TextBox(); ApellidosText.setVisibleLength(25); ApellidosText.setMaxLength(120); horizontalPanel_3.add(ApellidosText); ApellidosText.setWidth("90%"); String Apellido = ""; if ((ActualUser.getUser().getLastName() != null) && (!ActualUser.getUser().getLastName().isEmpty())) Apellido = ActualUser.getUser().getLastName(); ApellidosText.setText(Apellido); HorizontalPanel horizontalPanel_4 = new HorizontalPanel(); horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); PanelCampos.add(horizontalPanel_4); horizontalPanel_4.setWidth("100%"); SimplePanel simplePanel_1 = new SimplePanel(); horizontalPanel_4.add(simplePanel_1); Button btnNewButton = new Button("Save"); simplePanel_1.setWidget(btnNewButton); btnNewButton.setSize("100%", "100%"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseDownHandler( new MouseDownHandler() { public void onMouseDown(MouseDownEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterPush"); } }); btnNewButton.addMouseOutHandler( new MouseOutHandler() { public void onMouseOut(MouseOutEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenter"); } }); btnNewButton.addMouseOverHandler( new MouseOverHandler() { public void onMouseOver(MouseOverEvent event) { ((Button) event.getSource()).setStyleName("gwt-ButtonCenterOver"); } }); btnNewButton.setStyleName("gwt-ButtonCenter"); btnNewButton.addClickHandler( new ClickHandler() { public void onClick(ClickEvent event) { UserApp AU = ActualUser.getUser(); AU.setName(NameText.getText()); AU.setLastName(ApellidosText.getText()); LoadingPanel.getInstance().center(); LoadingPanel.getInstance().setLabelTexto("Updating..."); bookReaderServiceHolder.saveUser( AU, new AsyncCallback<Boolean>() { public void onSuccess(Boolean result) { bookReaderServiceHolder.loadUserById( ActualUser.getUser().getId(), new AsyncCallback<UserApp>() { public void onSuccess(UserApp result) { ActualUser.setUser(result); bookReaderServiceHolder.updateRenameOfUser( result.getId(), new AsyncCallback<Void>() { public void onSuccess(Void result) { LoadingPanel.getInstance().hide(); if (ActualUser.getUser() .getProfile() .equals(Constants.PROFESSOR)) Controlador.change2Administrator(); else if (ActualUser.getUser() .getProfile() .equals(Constants.STUDENT)) Controlador.change2MyActivities(); } public void onFailure(Throwable caught) { LoadingPanel.getInstance().hide(); Window.alert( "I can refresh the old anotations, please re-save your name to fix it"); } }); } public void onFailure(Throwable caught) { Window.alert( "I can reload the update User, if you want to show the new userInformation please reload the page"); LoadingPanel.getInstance().hide(); } }); } public void onFailure(Throwable caught) { Window.alert("Error updating User."); LoadingPanel.getInstance().hide(); } }); } }); VerticalPanel verticalPanel_1 = new VerticalPanel(); verticalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dockLayoutPanel.add(verticalPanel_1); verticalPanel_1.setSize("100%", "100%"); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel_1.add(horizontalPanel); Image image = new Image("Logo.jpg"); horizontalPanel.add(image); }