예제 #1
0
 /** langRefresh */
 public void langRefresh() {
   setText(GeneralComunicator.i18nExtension("dropbox.search"));
   cancelButton.setHTML(GeneralComunicator.i18n("button.cancel"));
   importButton.setHTML(GeneralComunicator.i18nExtension("button.import"));
   typeList.clear();
   typeList.addItem(GeneralComunicator.i18nExtension("dropbox.type.all"), "");
   typeList.addItem(GeneralComunicator.i18nExtension("dropbox.type.document"), CATEGORY_DOCUMENT);
   typeList.addItem(GeneralComunicator.i18nExtension("dropbox.type.folder"), CATEGORY_FOLDER);
 }
예제 #2
0
 /** langRefresh */
 public void langRefresh() {
   searchButton.setHTML(Main.i18n("button.search"));
   cleanButton.setHTML(Main.i18n("button.clean"));
   saveSearchButton.setHTML(Main.i18n("button.save.search"));
   advancedView.setText(Main.i18n("search.view.advanced"));
   compactResultsView.setText(Main.i18n("search.view.compact.results"));
   showPropertyGroups.setText(Main.i18n("search.view.propety.groups"));
   saveUserNews.setText(Main.i18n("search.save.as.news"));
   resultsPageText.setHTML(Main.i18n("search.page.results"));
   searchTypeText.setHTML(Main.i18n("search.type"));
   controlSearch.langRefresh();
 }
  public void OpenEditPanel() {
    GeneralPanel.remove(PanelEdicion);
    GeneralPanel.add(PanelEdicion, 0, 0);
    PanelEdicion.setSize(
        PanelActivity.getOffsetWidth() + "px", PanelActivity.getOffsetHeight() + "px");
    PanelEdicion.clear();
    PanelEdicion.setStyleName("BlancoTransparente");
    Button Boton = new Button();

    Boton.setHTML(ConstantsInformation.END_EDIT_BOTTON);
    Boton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            closeEditPanel();

            if (!SelectTeacherCatalogButtonTextBox.getText().isEmpty())
              BOTTON_TEACHER_CATALOG = SelectTeacherCatalogButtonTextBox.getText();
            else BOTTON_TEACHER_CATALOG = BOTTON_TEACHER_CATALOG_RESET;

            if (!SelectOpenCatalogButtonTextBox.getText().isEmpty())
              BOTTON_OPEN_CATALOG = SelectOpenCatalogButtonTextBox.getText();
            else BOTTON_OPEN_CATALOG = BOTTON_OPEN_CATALOG_RESET;

            ParsearFieldsAItems();
            SaveChages();
          }
        });
    SelectTeacherCatalogButtonTextBox = new TextBox();
    SelectTeacherCatalogButtonTextBox.setText(BOTTON_TEACHER_CATALOG);
    SelectTeacherCatalogButtonTextBox.setSize(
        SelectTeacherCatalogButton.getOffsetWidth() + "px",
        SelectTeacherCatalogButton.getOffsetHeight() + "px");
    PanelEdicion.add(
        SelectTeacherCatalogButtonTextBox,
        SelectTeacherCatalogButton.getAbsoluteLeft()
            - PanelActivity.getAbsoluteLeft()
            - DecoradorWidth,
        SelectTeacherCatalogButton.getAbsoluteTop()
            - PanelActivity.getAbsoluteTop()
            - DecoradorWidth);

    SelectOpenCatalogButtonTextBox = new TextBox();
    SelectOpenCatalogButtonTextBox.setText(BOTTON_OPEN_CATALOG);
    SelectOpenCatalogButtonTextBox.setSize(
        SelectOpenCatalogButton.getOffsetWidth() + "px",
        SelectOpenCatalogButton.getOffsetHeight() + "px");
    PanelEdicion.add(
        SelectOpenCatalogButtonTextBox,
        SelectOpenCatalogButton.getAbsoluteLeft()
            - PanelActivity.getAbsoluteLeft()
            - DecoradorWidth,
        SelectOpenCatalogButton.getAbsoluteTop() - PanelActivity.getAbsoluteTop() - DecoradorWidth);

    PanelEdicion.add(Boton, PanelEdicion.getOffsetWidth() - Constants.TAMANOBOTOBEDITON, 0);
  }
 private Button buildRemoveParameterButton(final HorizontalPanel entry) {
   Button remButton = new Button();
   remButton.setStyleName(removeParamButton.getStyleName());
   remButton.setHTML(removeParamButton.getHTML());
   remButton.addClickHandler(
       new ClickHandler() {
         public void onClick(ClickEvent event) {
           removeParameter(entry);
           enableSaveButton();
         }
       });
   return remButton;
 }
  private void closeEditPanel() {
    GeneralPanel.remove(PanelEdicion);
    GeneralPanel.add(PanelEdicion, PanelActivity.getOffsetWidth() - 40, 0);
    PanelEdicion.setSize(Constants.TAMANOBOTOBEDITOFF + Constants.PX, "50px");
    PanelEdicion.clear();
    PanelEdicion.setStyleName("");
    Button Boton = new Button();
    PanelEdicion.add(Boton, 0, 0);
    Boton.setHTML(ConstantsInformation.EDIT_BOTTON);
    Boton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            OpenEditPanel();
          }
        });
  }
예제 #6
0
  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");
  }
예제 #7
0
 public void setText(String text) {
   super.setHTML("<i class=\"fa " + icon + "\"></i> " + text);
   this.text = text;
 }
예제 #8
0
 public void setIcon(String icon) {
   super.setHTML("<i class=\"fa " + icon + "\"></i> " + text);
   this.icon = icon;
 }
예제 #9
0
 @Override
 public void setName(String name) {
   button.setHTML(name);
 }
예제 #10
0
  public iCalCalendarPanel() {

    // style this element as absolute position
    DOM.setStyleAttribute(this.getElement(), "position", "absolute");
    DOM.setStyleAttribute(this.getElement(), "top", "0px");
    DOM.setStyleAttribute(this.getElement(), "left", "0px");
    DOM.setStyleAttribute(this.getElement(), "padding", "0px");

    DOM.setStyleAttribute(DOM.getElementById("messageBox"), "display", "none");

    mainLayoutPanel.setWidth("100%");
    add(mainLayoutPanel);

    // add header
    headerPanel.setStyleName("gwt-cal-HeaderPanel");
    DOM.setInnerHTML(headerPanel.getElement(), "&nbsp;");
    footerPanel.setStyleName("gwt-cal-FooterPanel");
    DOM.setInnerHTML(headerPanel.getElement(), "&nbsp;");
    mainLayoutPanel.add(headerPanel, DockPanel.NORTH);
    mainLayoutPanel.add(footerPanel, DockPanel.SOUTH);

    // add left panel
    datePicker.setValue(new Date());
    dateLayoutPanel.add(datePicker, DockPanel.SOUTH);
    dateLayoutPanel.add(splitterPanel, DockPanel.SOUTH);
    splitterPanel.setStyleName("splitter");
    mainLayoutPanel.add(dateLayoutPanel, DockPanel.WEST);

    // CalendarFormat.INSTANCE.setFirstDayOfWeek(1);

    // change hour offset to false to facilitate iCal style
    settings.setOffsetHourLabels(true);
    settings.setTimeBlockClickNumber(Click.Double);
    // create day view
    calendar = new Calendar();
    calendar.setSettings(settings);
    // set style as google-cal
    calendar.setWidth("100%");
    // set today as default date
    mainLayoutPanel.add(calendar, DockPanel.CENTER);
    mainLayoutPanel.setCellVerticalAlignment(dateLayoutPanel, HasAlignment.ALIGN_BOTTOM);
    dateLayoutPanel.setCellVerticalAlignment(datePicker, HasAlignment.ALIGN_BOTTOM);
    dateLayoutPanel.setWidth("168px");

    // add today button
    todayButton.setStyleName("todayButton");
    todayButton.setText("Today");
    todayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            datePicker.setValue(new Date(), true);
            // dayView.setDate(new Date());
          }
        });
    previousDayButton.setStyleName("previousButton");
    previousDayButton.setHTML("&laquo;");
    previousDayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Date d = datePicker.getValue();
            d.setDate(d.getDate() - 1);
            datePicker.setValue(d, true);
          }
        });
    nextDayButton.setStyleName("nextButton");
    nextDayButton.setHTML("&raquo;");
    nextDayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            Date d = datePicker.getValue();
            d.setDate(d.getDate() + 1);
            datePicker.setValue(d, true);
          }
        });
    headerPanelLayout.setWidget(0, 0, todayButton);
    headerPanelLayout.setWidget(0, 1, previousDayButton);

    oneDayButton.setText("1 Day");
    oneDayButton.setStyleName("dayButton");
    threeDayButton.setText("3 Day");
    threeDayButton.setStyleName("dayButton");
    threeDayButton.addStyleName("active");
    activeDayButton = threeDayButton;
    weekDayButton.setText("Work Week");
    weekDayButton.setStyleName("dayButton");
    monthButton.setText("Month");
    monthButton.setStyleName("dayButton");
    headerPanelLayout.setWidget(0, 2, oneDayButton);
    headerPanelLayout.setWidget(0, 3, threeDayButton);
    headerPanelLayout.setWidget(0, 4, weekDayButton);
    headerPanelLayout.setWidget(0, 5, monthButton);
    headerPanelLayout.setWidget(0, 6, nextDayButton);
    headerPanelLayout.setHTML(0, 7, "&nbsp;");

    headerPanelLayout.getCellFormatter().setWidth(0, 0, "50%");
    headerPanelLayout.getCellFormatter().setWidth(0, 7, "50%");

    headerPanelLayout.setWidth("100%");
    headerPanelLayout.setCellPadding(0);
    headerPanelLayout.setCellSpacing(0);
    headerPanel.add(headerPanelLayout);

    footerPanel.add(
        new HTML(
            "<a href='http://code.google.com/p/gwt-cal'>gwt-cal</a> widget for Google Web Toolkit, GPLv3, by <a href='http://www.google.com/profiles/Brad.Rydzewski'>Brad Rydzewski</a>"));

    oneDayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            activeDayButton.removeStyleName("active");
            activeDayButton = oneDayButton;
            activeDayButton.addStyleName("active");
            calendar.setView(CalendarViews.DAY, 1);
            // calendar.scrollToHour(6);
          }
        });
    threeDayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            activeDayButton.removeStyleName("active");
            activeDayButton = threeDayButton;
            activeDayButton.addStyleName("active");
            calendar.setView(CalendarViews.DAY, 3);
            // calendar.scrollToHour(6);
          }
        });
    weekDayButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            activeDayButton.removeStyleName("active");
            activeDayButton = weekDayButton;
            activeDayButton.addStyleName("active");
            calendar.setView(CalendarViews.DAY, 5);
            // calendar.scrollToHour(6);
          }
        });
    monthButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            activeDayButton.removeStyleName("active");
            activeDayButton = monthButton;
            activeDayButton.addStyleName("active");
            calendar.setView(CalendarViews.MONTH);
          }
        });

    datePicker.addValueChangeHandler(
        new ValueChangeHandler<Date>() {
          public void onValueChange(ValueChangeEvent<Date> event) {
            calendar.setDate(event.getValue());
          }
        });
    calendar.addDeleteHandler(
        new DeleteHandler<Appointment>() {
          public void onDelete(DeleteEvent<Appointment> event) {
            boolean commit =
                Window.confirm(
                    "Are you sure you want to delete appointment \""
                        + event.getTarget().getTitle()
                        + "\"");
            if (commit == false) {
              event.setCancelled(true);
              System.out.println("cancelled appointment deletion");
            }
          }
        });
    calendar.addOpenHandler(
        new OpenHandler<Appointment>() {
          public void onOpen(OpenEvent<Appointment> event) {
            Window.alert("You double-clicked appointment \"" + event.getTarget().getTitle() + "\"");
          }
        });

    calendar.addSelectionHandler(
        new SelectionHandler<Appointment>() {
          public void onSelection(SelectionEvent<Appointment> event) {
            System.out.println("selected " + event.getSelectedItem().getTitle());
          }
        });

    calendar.addTimeBlockClickHandler(
        new TimeBlockClickHandler<Date>() {
          public void onTimeBlockClick(TimeBlockClickEvent<Date> event) {
            Window.alert("you clicked time block " + event.getTarget());
          }
        });

    /* Generate random appointments */
    AppointmentBuilder.appointmentsPerDay = 5;
    AppointmentBuilder.HOURS = new Integer[] {7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19};
    AppointmentBuilder.MINUTES = new Integer[] {0, 30};
    AppointmentBuilder.DURATIONS = new Integer[] {60, 90, 120, 180, 240, 600};
    AppointmentBuilder.DESCRIPTIONS[1] = "Best show on TV!";

    ArrayList<Appointment> appointments = AppointmentBuilder.build(AppointmentBuilder.ICAL_STYLES);
    /* Add appointments to day view */
    calendar.suspendLayout();
    calendar.addAppointments(appointments);

    calendar.resumeLayout();

    // window events to handle resizing
    Window.enableScrolling(false);
    Window.addResizeHandler(
        new ResizeHandler() {
          public void onResize(ResizeEvent event) {
            int h = event.getHeight();
            calendar.setHeight(
                h - headerPanel.getOffsetHeight() - footerPanel.getOffsetHeight() + "px");
          }
        });
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              public void execute() {
                calendar.setHeight(
                    Window.getClientHeight()
                        - headerPanel.getOffsetHeight()
                        - footerPanel.getOffsetHeight()
                        + "px");
                calendar.scrollToHour(6);
              }
            });
  }
  protected void ParsearFieldsAItems() {

    SelectTeacherCatalogButton.setHTML(BOTTON_TEACHER_CATALOG);
    SelectOpenCatalogButton.setHTML(BOTTON_OPEN_CATALOG);
  }
예제 #12
0
  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%");
  }
예제 #13
0
  public void initQuestionButtonPanel() {
    questionButtonPanel.setWidth("435px");
    questionButtonPanel.setHeight("30px");

    btnPrev = new Button("Prev");
    btnPrev.setHTML("<img src='images/icon16/back.png' />Prev");
    btnPrev.setSize("75px", "28px");
    btnPrev.setEnabled(false);

    btnNext = new Button("Next");
    btnNext.setHTML("<img src='images/icon16/right.png' />Next");
    btnNext.setSize("75px", "28px");

    html = new HTML("<center><span class='app-title3'>" + controller.getTitle() + "</></center>");
    html.setWidth("285px");

    questionButtonPanel.add(btnPrev, 0, 2);
    questionButtonPanel.add(html, 75, 0);
    questionButtonPanel.add(btnNext, 360, 2);

    btnPrev.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            if (questionIndex > 0) {
              questionIndex--;
              controller = questionList.get(questionIndex);

              String str =
                  "<center><span class='app-title3'>" + controller.getTitle() + "</span></center>";
              html.setHTML(str);

              if (questionIndex == 0) btnPrev.setEnabled(false);
              else btnPrev.setEnabled(true);
              if (questionIndex == questionList.size() - 1) btnNext.setEnabled(false);
              else btnNext.setEnabled(true);
              base.remove(panel);
              panel = controller.getQuestionPanel();
              base.add(panel);
              controller.syncDiagram();
            }
          }
        });

    btnNext.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            if (questionIndex < questionList.size() - 1) {
              questionIndex++;
              controller = questionList.get(questionIndex);

              String str =
                  "<center><span class='app-title3'>" + controller.getTitle() + "</span></center>";
              html.setHTML(str);

              if (questionIndex == questionList.size() - 1) btnNext.setEnabled(false);
              else btnNext.setEnabled(true);
              if (questionIndex == 0) btnPrev.setEnabled(false);
              else btnPrev.setEnabled(true);
              base.remove(panel);
              panel = controller.getQuestionPanel();
              base.add(panel);
              controller.syncDiagram();
            }
          }
        });
  }