示例#1
0
  private void agregarAlgoritmoCategoria(int pos, AlgoritmoCategoria c) {
    HorizontalPanel h = new HorizontalPanel();
    Hyperlink hyper = new Hyperlink();
    hyper.setHTML(c.getNombre());

    h.add(hyper);
    if (c.getEstado() == 1) {
      Image m = new Image("cuidado.jpg");
      m.setPixelSize(15, 15);
      h.add(m);
    } else if (c.getEstado() == 2) {
      Image m = new Image("ok.png");
      m.setPixelSize(15, 15);
      h.add(m);
    } else if (c.getEstado() == 3) {
      Image m = new Image("pregunta.jpg");
      m.setPixelSize(15, 15);
      h.add(m);
    }
    panelesCategorias[pos].add(h);
  }
    private void doInitHandlerInfo(final LoggerInfo info) {

      // ScrollPanel scroll=new ScrollPanel(handlersBriefInfo);
      // display.add(scroll, DockPanel.CENTER);
      handlersBriefInfo = new ListPanel();
      display.add(handlersBriefInfo, DockPanel.CENTER);
      display.setCellWidth(handlersBriefInfo, "100%");
      // handlersBriefInfo.setHeight("200px");
      // handlersBriefInfo.setWidth("630px");

      handlersBriefInfo.setColumnWidth(0, "25px");
      handlersBriefInfo.setColumnWidth(1, "25px");

      handlersBriefInfo.setColumnWidth(2, "100px");
      handlersBriefInfo.setColumnWidth(3, "80%");

      handlersBriefInfo.setHeader(0, "Index");
      handlersBriefInfo.setHeader(1, "Remove");
      handlersBriefInfo.setHeader(2, "Name");
      handlersBriefInfo.setHeader(3, "Class name");

      if (info.getHandlerInfos() != null)
        for (int i = 0; i < info.getHandlerInfos().length; i++) {

          final int ii = i;
          // FIXME: Add details
          Hyperlink details = new Hyperlink();
          details.setHTML("#" + i);

          Hyperlink remove = new Hyperlink();
          remove.setHTML("Remove");
          ClickListener removeClick =
              new ClickListener() {

                public void onClick(Widget sender) {

                  AsyncCallback removeCallback =
                      new AsyncCallback() {

                        public void onFailure(Throwable caught) {
                          Logger.error(
                              "Failed to remove handler from logger["
                                  + fullName
                                  + "] at index["
                                  + ii
                                  + "] due to:\n"
                                  + caught);
                        }

                        public void onSuccess(Object result) {
                          onHide();
                          onShow();
                        }
                      };

                  ServerConnection.logServiceAsync.removeHandlerAtIndex(
                      info.getFullName(), ii, removeCallback);
                }
              };

          remove.addClickListener(removeClick);

          handlersBriefInfo.setCell(i, 0, details);
          handlersBriefInfo.setCell(i, 1, remove);
          handlersBriefInfo.setCellText(i, 2, info.getHandlerInfos()[i].getName());
          handlersBriefInfo.setCellText(i, 3, info.getHandlerInfos()[i].getHandelerClassName());
        }
    }