// @UiHandler({"edit_items"})
 public void editItemsCmd(ClickEvent ev) {
   PopupPanel p = new PopupPanel(true);
   // p.setTitle("Редактирование элементов...");
   p.setModal(false);
   // p.setPopupPosition(200, 200);
   p.setSize("100%", "100%");
   p.setWidget(new MultiValuedEntity(this.dto, null, this.filling, "", this));
   p.show();
   p.center();
 }
 // @UiHandler({"edit_field"})
 public void editFieldCmd(ClickEvent ev) {
   PopupPanel p = new PopupPanel();
   // p.setTitle("Редактирование поля...");
   p.setModal(true);
   // p.setPopupPosition(200, 200);
   p.setSize("100%", "100%");
   p.setWidget(new FieldEditor(new MultiValuedField(this.dto, null, this.filling, base_name), p));
   p.show();
   p.center();
 }
Example #3
0
  public KscComboboxViewImpl() {
    initWidget(uiBinder.createAndBindUi(this));

    m_layoutPanel.setSize("100%", "23px");
    m_textBox.addKeyDownHandler(
        new KeyDownHandler() {

          @Override
          public void onKeyDown(KeyDownEvent event) {
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
              if (m_presenter != null) {
                m_presenter.onEnterKeyEvent();
              }
            }
          }
        });

    m_selectionModel = new SingleSelectionModel<KscReportDetail>();
    m_selectionModel.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {

          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            m_presenter.onKscReportSelected();
          }
        });

    m_reportList = new CellList<KscReportDetail>(new KscReportDetailCell());
    m_reportList.setPageSize(10);
    m_reportList.getElement().getStyle().setFontSize(12, Unit.PX);
    m_reportList.setSelectionModel(m_selectionModel);

    m_dataList = new ListDataProvider<KscReportDetail>();
    m_dataList.addDataDisplay(m_reportList);

    m_pager = new SimplePager();
    m_pager.setStyleName("onms-table-no-borders-margin");
    m_pager.getElement().getStyle().setWidth(100, Unit.PCT);
    m_pager.setDisplay(m_reportList);

    FlowPanel flowPanel = new FlowPanel();
    flowPanel.add(m_reportList);
    flowPanel.add(m_pager);
    m_popupPanel = new PopupPanel();
    m_popupPanel.add(flowPanel);
    m_popupPanel.setAutoHideEnabled(true);
    m_popupPanel.setAnimationEnabled(true);
    m_popupPanel.setModal(false);
    m_popupPanel.getElement().getStyle().setBorderWidth(1, Unit.PX);
    m_popupPanel.getElement().getStyle().setBorderColor("#B5B8C8");
    m_popupPanel.getElement().getStyle().setPadding(1, Unit.PX);
  }
 // @UiHandler({"edit_selection"})
 public void editSelectionCmd(ClickEvent ev) {
   // DialogBox dialogBox = createDialogBox("Редактирование выбора...");
   // dialogBox.setGlassEnabled(true);
   // dialogBox.setAnimationEnabled(true);
   PopupPanel p = new PopupPanel(true);
   p.setModal(false);
   // p.setPopupPosition(200, 200);
   p.setAnimationEnabled(true);
   // p.setTitle("Редактирование выбора...");
   // dialogBox.setModal(true);
   // dialogBox.center();
   p.setSize("100%", "100%");
   p.setWidget(new MultiselectionEditor(this, p));
   p.setVisible(true);
   p.show();
   p.center();
 }
Example #5
0
  @Override
  public void go(final HasWidgets container) {
    if (m_addGraphView == null) {
      m_addGraphView = new KscAddGraphViewImpl();
      m_addGraphView.setTitle(m_graphInfo.getTitle() == null ? "" : m_graphInfo.getTitle());
    }

    if (m_popupPanel == null) {
      m_popupPanel = new PopupPanel();
      m_popupPanel.setWidth("300px");
      m_popupPanel.setHeight("79px");
      m_popupPanel.add(m_addGraphView);
      m_popupPanel.setAutoHideEnabled(true);
      m_popupPanel.setAnimationEnabled(false);
      m_popupPanel.setModal(false);
      m_popupPanel.setVisible(false);
      m_popupPanel.hide();
    }

    new KscAddGraphPresenter(m_popupPanel, m_addGraphView, m_reports, m_graphInfo).go(container);
  }
  public void switchSection(String token) {
    popup.hide();
    tokenHistory.add(token);
    Map<String, String> parameters = getHistoryTokenParameters(token);
    AppPlace place = getPlace(token);

    if (mainPresenter != null) {
      mainPresenter.clearNotifications();
    }

    if (ClientSessionUtil.checkSession()) {
      switch (place) {
        case HOME:
          HomePresenter homePresenter = new HomePresenter(new HomeView(), eventBus);
          homePresenter.bind();
          getLayout().clear();
          getLayout().add(homePresenter.getDisplay().asWidget());
          break;
        case REQUEST:
          RequestPresenter requestPresenter = new RequestPresenter(new RequestView(), eventBus);
          requestPresenter.bind();
          getLayout().clear();
          getLayout().add(requestPresenter.getDisplay().asWidget());
          break;
        case LOGOUT:
          ClientSessionUtil.destroySession();
          eventBus.fireEvent(new LoginRequiredEvent());
          break;
        case REQUESTSTATUS:
          try {
            Integer requestId = Integer.parseInt(parameters.get("requestId"));
            RequestStatusPresenter requestStatusPresenter =
                new RequestStatusPresenter(new RequestStatusView(), eventBus);
            requestStatusPresenter.bind();
            requestStatusPresenter.showRequest(requestId);
            getLayout().clear();
            getLayout().add(requestStatusPresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR);
          }
          break;
        case EDITREQUEST:
          try {
            Integer requestId = Integer.parseInt(parameters.get("requestId"));
            RequestEditPresenter editPresenter =
                new RequestEditPresenter(new RequestEditView(), eventBus);
            editPresenter.bind();
            editPresenter.showRequest(requestId);
            getLayout().clear();
            getLayout().add(editPresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR);
          }
          break;
        case RESPONSE:
          try {
            Integer requestId = Integer.parseInt(parameters.get("requestId"));
            RequestResponsePresenter requestResponsePresenter =
                new RequestResponsePresenter(new RequestResponseView(), eventBus);
            requestResponsePresenter.bind();
            requestResponsePresenter.showRequest(requestId);
            getLayout().clear();
            getLayout().add(requestResponsePresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR);
          }
          break;
        case LIST:
          try {
            String listType = parameters.get("type");
            RequestListPresenter requestListPresenter =
                new RequestListPresenter(new RequestListView(), eventBus);
            requestListPresenter.bind();
            requestListPresenter.loadRequests(0, 100, listType);
            getLayout().clear();
            getLayout().add(requestListPresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Tipo de lista incorrecto: No se puede cargar la lista",
                NotificationEventType.ERROR);
          }
          break;
        case STATISTICS:
          StatisticsPresenter statistics = new StatisticsPresenter(new StatisticsView(), eventBus);
          statistics.bind();
          getLayout().clear();
          getLayout().add(statistics.getDisplay().asWidget());
          break;
        case ABOUTPROJECT:
          AboutProjectPresenter aboutProjectPresenter =
              new AboutProjectPresenter(new AboutProjectView(), eventBus);
          aboutProjectPresenter.bind();
          getLayout().clear();
          getLayout().add(aboutProjectPresenter.getDisplay().asWidget());
          break;
        case ASOCIATES:
          AsociatesPresenter asociatesPresenter =
              new AsociatesPresenter(new AsociatesView(), eventBus);
          asociatesPresenter.bind();
          getLayout().clear();
          getLayout().add(asociatesPresenter.getDisplay().asWidget());
          break;
        case USERPROFILE:
          UserProfileEditPresenter userProfilePresenter =
              new UserProfileEditPresenter(new UserProfileEditView(), eventBus);
          userProfilePresenter.bind();
          getLayout().clear();
          getLayout().add(userProfilePresenter.getDisplay().asWidget());
          break;
        default:
          History.newItem(AppPlace.HOME.toString());
      }
    } else {
      switch (place) {
        case HOME:
          HomePresenter homePresenter = new HomePresenter(new HomeView(), eventBus);
          homePresenter.bind();
          getLayout().clear();
          getLayout().add(homePresenter.getDisplay().asWidget());
          break;
        case REQUEST:
        case LOGIN:
          LoginPresenter loginPresenter = new LoginPresenter(new LoginView(), eventBus);
          loginPresenter.bind();
          popup.setModal(true);
          popup.setGlassEnabled(true);
          popup.clear();
          popup.add(loginPresenter.getDisplay().asWidget());
          popup.center();
          break;
        case REGISTER:
          RegisterPresenter registerPresenter = new RegisterPresenter(new RegisterView(), eventBus);
          registerPresenter.bind();
          getLayout().clear();
          getLayout().add(registerPresenter.getDisplay().asWidget());
          break;
        case RESPONSE:
          try {
            Integer requestId = Integer.parseInt(parameters.get("requestId"));
            RequestResponsePresenter requestResponsePresenter =
                new RequestResponsePresenter(new RequestResponseView(), eventBus);
            requestResponsePresenter.bind();
            requestResponsePresenter.showRequest(requestId);
            getLayout().clear();
            getLayout().add(requestResponsePresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Id incorrecta: No se puede cargar la solicitud", NotificationEventType.ERROR);
          }
          break;
        case LIST:
          try {
            String listType = parameters.get("type");
            RequestListPresenter requtesListPresenter =
                new RequestListPresenter(new RequestListView(), eventBus);
            requtesListPresenter.bind();
            requtesListPresenter.loadRequests(0, 100, listType);
            getLayout().clear();
            getLayout().add(requtesListPresenter.getDisplay().asWidget());
          } catch (Exception e) {
            showNotification(
                "Tipo de lista incorrecto: No se puede cargar la lista",
                NotificationEventType.ERROR);
          }
          break;
        case STATISTICS:
          StatisticsPresenter statistics = new StatisticsPresenter(new StatisticsView(), eventBus);
          statistics.bind();
          getLayout().clear();
          getLayout().add(statistics.getDisplay().asWidget());
          break;
        case ABOUTPROJECT:
          AboutProjectPresenter aboutProjectPresenter =
              new AboutProjectPresenter(new AboutProjectView(), eventBus);
          aboutProjectPresenter.bind();
          getLayout().clear();
          getLayout().add(aboutProjectPresenter.getDisplay().asWidget());
          break;
        case ASOCIATES:
          AsociatesPresenter asociatesPresenter =
              new AsociatesPresenter(new AsociatesView(), eventBus);
          asociatesPresenter.bind();
          getLayout().clear();
          getLayout().add(asociatesPresenter.getDisplay().asWidget());
          break;
        case PASSWORDRECOVERY:
          PasswordRecoveryPresenter passwordRecoveryPresenter =
              new PasswordRecoveryPresenter(new PasswordRecoveryView(), eventBus);
          passwordRecoveryPresenter.bind();
          getLayout().clear();
          getLayout().add(passwordRecoveryPresenter.getDisplay().asWidget());
          break;
        default:
          History.newItem(AppPlace.HOME.toString());
      }
    }
  }