public void launchNewConfigDialoge() {

    window = new DefaultWindow("Create Server Configuration");
    window.setWidth(480);
    window.setHeight(360);
    window.addCloseHandler(
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {
            /*if(selectedRecord==null)
            History.back();*/
          }
        });

    serverGroupStore.loadServerGroups(
        new SimpleCallback<List<ServerGroupRecord>>() {
          @Override
          public void onSuccess(List<ServerGroupRecord> result) {
            serverGroups = result;
            window.setWidget(
                new NewServerConfigWizard(ServerConfigPresenter.this, serverGroups).asWidget());

            window.setGlassEnabled(true);
            window.center();
          }
        });
  }
  @Override
  public void launchNewPropertyDialoge(String reference) {
    propertyWindow = new DefaultWindow("New System Property");
    propertyWindow.setWidth(320);
    propertyWindow.setHeight(240);
    propertyWindow.addCloseHandler(
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {}
        });

    propertyWindow.setWidget(new NewPropertyWizard(this, reference).asWidget());

    propertyWindow.setGlassEnabled(true);
    propertyWindow.center();
  }
Exemplo n.º 3
0
  private void showVersionInfo(String json) {
    DefaultWindow window = new DefaultWindow("Management Model Versions");
    window.setWidth(480);
    window.setHeight(360);
    window.addCloseHandler(
        new CloseHandler<PopupPanel>() {
          @Override
          public void onClose(CloseEvent<PopupPanel> event) {}
        });

    TextArea textArea = new TextArea();
    textArea.setStyleName("fill-layout");
    textArea.setText(json);

    window.setWidget(textArea);

    window.setGlassEnabled(true);
    window.center();
  }
Exemplo n.º 4
0
  private void showDetail(final Message msg) {

    msg.setNew(false);

    final DefaultWindow window =
        new DefaultWindow(Console.CONSTANTS.common_label_messageDetailTitle());

    window.setWidth(480);
    window.setHeight(360);
    window.setGlassEnabled(true);

    // ImageResource icon = MessageCenterView.getSeverityIcon(msg.getSeverity());
    // AbstractImagePrototype prototype = AbstractImagePrototype.create(icon);

    SafeHtmlBuilder html = new SafeHtmlBuilder();

    // TODO: XSS prevention?
    html.appendHtmlConstant(msg.getSeverity().getTag());
    html.appendHtmlConstant("&nbsp;");
    html.appendHtmlConstant(msg.getFired().toString());
    html.appendHtmlConstant("<h3 id='consise-message'>");
    html.appendHtmlConstant(msg.getConciseMessage());
    html.appendHtmlConstant("</h3>");
    html.appendHtmlConstant("<p/>");

    String detail = msg.getDetailedMessage() != null ? msg.getDetailedMessage() : "";

    html.appendHtmlConstant(
        "<pre style='font-family:tahoma, verdana, sans-serif;' id='detail-message'>");
    html.appendHtmlConstant(detail);
    html.appendHtmlConstant("</pre>");

    final HTML widget = new HTML(html.toSafeHtml());
    widget.getElement().setAttribute("style", "margin:5px");

    DialogueOptions options =
        new DialogueOptions(
            "OK",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent clickEvent) {
                window.hide();
              }
            },
            Console.CONSTANTS.common_label_cancel(),
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent clickEvent) {
                window.hide();
              }
            });

    options.getSubmit().setAttribute("aria-describedby", "consise-message detail-message");

    Widget windowContent = new WindowContentBuilder(widget, options).build();

    TrappedFocusPanel trap =
        new TrappedFocusPanel(windowContent) {
          @Override
          protected void onAttach() {
            super.onAttach();

            Scheduler.get()
                .scheduleDeferred(
                    new Scheduler.ScheduledCommand() {
                      @Override
                      public void execute() {
                        getFocus().onFirstButton();
                      }
                    });
          }
        };

    window.setWidget(trap);

    window.addCloseHandler(
        new CloseHandler<PopupPanel>() {

          @Override
          public void onClose(CloseEvent<PopupPanel> event) {
            messagePopup.getMessageList().getSelectionModel().setSelected(msg, false);
            messagePopup.hide();
          }
        });

    messagePopup.hide();
    window.center();
  }