Esempio n. 1
0
 public void showLoading(boolean sayLoad) {
   if (sayLoad) {
     loadingDialog.setVisible(true);
     mainBodypanel.setVisible(false);
   } else {
     loadingDialog.setVisible(false);
     mainBodypanel.setVisible(true);
   }
 }
 @UiHandler("runButton")
 void runSQLCode(ClickEvent event) {
   resultStatusTextBox.setVisible(false);
   presenter.runSQLCode(codeEditor.getValue());
   loadingBar.setVisible(true);
   quickCodeResult.setVisible(false);
 }
Esempio n. 3
0
  private void setWidgetValuesFromEditElement(MapDrawingObject element) {
    selectMsg.setVisible(false);
    editPanel.setVisible(true);

    editLabel.setText("Editing: " + element.getType());
    code.setText(editElement.getCode());
    description.setText(editElement.getDescription());

    if (element.getType().equals("point")) {
      pointFields.setVisible(true);
      zone.setText(editElement.getZone());
      easting.setText(editElement.getEasting());
      northing.setText(editElement.getNorthing());
      height.setText(editElement.getHeight());
      latitude.setText(editElement.getLatitude());
      longitude.setText(editElement.getLongitude());
    } else {
      pointFields.setVisible(false);
    }
  }
  /** constructor */
  public LoginUiHorizontal() {

    HorizontalPanel hp = new HorizontalPanel();
    hp.add(wLoading);
    hp.add(pUi);

    pWidget.add(hp);

    initWidget(pWidget);

    // observers
    bLogin.addClickListener(this);
    bForgot.addClickListener(this);

    tbConsumerKey.addClickListener(this);
    tbConsumerKey.addChangeListener(this);
    tbConsumerKey.addKeyboardListener(this);
    tbConsumerKey.addFocusListener(this);

    tbConsumerSecret.addClickListener(this);
    tbConsumerSecret.addChangeListener(this);
    tbConsumerSecret.addKeyboardListener(this);
    tbConsumerSecret.addFocusListener(this);

    tbConsumerSecretPass.addClickListener(this);
    tbConsumerSecretPass.addChangeListener(this);
    tbConsumerSecretPass.addKeyboardListener(this);
    tbConsumerSecretPass.addFocusListener(this);

    cbRemberMe.addKeyboardListener(this);
    cbRemberMe.addClickListener(this);

    hAccountLogin.addClickListener(this);
    hForgotPassword.addClickListener(this);

    // style
    pWidget.setStyleName("login-Ui");

    // defaults
    pError.setVisible(false);

    hp.setCellVerticalAlignment(wLoading, VerticalPanel.ALIGN_MIDDLE);

    // debug
    // pWidget.addStyleName("test2");

  }
  public void drawError(String error) {
    hideLoading();

    pError.clear();
    pError.setVisible(true);

    error = Global_String.removeHtmlTags(error);
    HTML htmlError = new HTML(error);

    pError.add(htmlError);

    // hide error shortly after fire
    Timer t =
        new Timer() {
          public void run() {
            pError.setVisible(false);
          }
        };
    t.schedule(3000);
  }
Esempio n. 6
0
  private void initializeStatusPanel() {
    String comboWidth = "125px";
    statusPanel = new VerticalPanel();
    StyleInjector.inject(
        ".statusPanelStyle { "
            + "background: #E0ECF8;"
            + "border-radius: 5px 10px;"
            + "opacity: 0.8}");
    statusPanel.setStyleName("statusPanelStyle");

    statusPanel.setSpacing(5);
    statusPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    initializeLayerCombo(comboWidth);
    initializeEpsgCombo(comboWidth);
    initializeStatusGrid();

    statusPanel.add(new FieldLabel(layerCombo, UIMessages.INSTANCE.sbSelectLayerLabel()));
    statusPanel.add(new FieldLabel(epsgCombo, UIMessages.INSTANCE.sbEpsgLabel()));
    statusPanel.add(statusGrid);

    statusPanel.setVisible(false);
  }
 @Override
 @Export
 public void setVisible(boolean isVisible) {
   super.setVisible(isVisible);
 }
  @Inject
  public PublishingPreferencesPane(
      GlobalDisplay globalDisplay,
      RSConnectServerOperations server,
      RSAccountConnector connector,
      UIPrefs prefs,
      DependencyManager deps) {
    reloadRequired_ = false;
    display_ = globalDisplay;
    uiPrefs_ = prefs;
    server_ = server;
    connector_ = connector;
    deps_ = deps;

    VerticalPanel accountPanel = new VerticalPanel();
    Label accountLabel = headerLabel("Publishing Accounts");
    HorizontalPanel hpanel = new HorizontalPanel();

    accountPanel.add(accountLabel);

    accountList_ = new RSConnectAccountList(server, globalDisplay, true, true);
    accountList_.setHeight("200px");
    accountList_.setWidth("300px");
    accountList_.getElement().getStyle().setMarginBottom(15, Unit.PX);
    accountList_.getElement().getStyle().setMarginLeft(3, Unit.PX);
    hpanel.add(accountList_);

    accountList_.setOnRefreshCompleted(
        new Operation() {
          @Override
          public void execute() {
            setButtonEnabledState();
          }
        });
    accountList_.addChangeHandler(
        new ChangeHandler() {
          @Override
          public void onChange(ChangeEvent arg0) {
            setButtonEnabledState();
          }
        });

    VerticalPanel vpanel = new VerticalPanel();
    hpanel.add(vpanel);

    connectButton_ = new ThemedButton("Connect...");
    connectButton_.getElement().getStyle().setMarginBottom(5, Unit.PX);
    connectButton_.setWidth("100%");
    connectButton_.setWrapperWidth("100%");
    connectButton_.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            onConnect();
          }
        });
    vpanel.add(connectButton_);

    reconnectButton_ = new ThemedButton("Reconnect...");
    reconnectButton_.getElement().getStyle().setMarginBottom(5, Unit.PX);
    reconnectButton_.setWidth("100%");
    reconnectButton_.setWrapperWidth("100%");
    reconnectButton_.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            onReconnect();
          }
        });
    vpanel.add(reconnectButton_);

    disconnectButton_ = new ThemedButton("Disconnect");
    disconnectButton_.setWidth("100%");
    disconnectButton_.setWrapperWidth("100%");
    disconnectButton_.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            onDisconnect();
          }
        });
    vpanel.add(disconnectButton_);

    setButtonEnabledState();

    accountPanel.add(hpanel);
    add(accountPanel);

    // special UI to show when we detect that there are account records but
    // the RSConnect package isn't installed
    final VerticalPanel missingPkgPanel = new VerticalPanel();
    missingPkgPanel.setVisible(false);
    missingPkgPanel.add(
        new Label(
            "Account records appear to exist, but cannot be viewed because a "
                + "required package is not installed."));
    ThemedButton installPkgs = new ThemedButton("Install Missing Packages");
    installPkgs.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent arg0) {
            deps_.withRSConnect(
                "Viewing publish accounts",
                false,
                null,
                new CommandWithArg<Boolean>() {
                  @Override
                  public void execute(Boolean succeeded) {
                    if (succeeded) {
                      // refresh the account list to show the accounts
                      accountList_.refreshAccountList();

                      // remove the "missing package" UI
                      missingPkgPanel.setVisible(false);
                    }
                  }
                });
          }
        });
    installPkgs.getElement().getStyle().setMarginLeft(0, Unit.PX);
    installPkgs.getElement().getStyle().setMarginTop(10, Unit.PX);
    missingPkgPanel.add(installPkgs);
    missingPkgPanel.getElement().getStyle().setMarginBottom(20, Unit.PX);
    add(missingPkgPanel);

    final CheckBox chkEnableRSConnect =
        checkboxPref("Enable publishing to RStudio Connect", uiPrefs_.enableRStudioConnect());
    final HorizontalPanel rsconnectPanel = checkBoxWithHelp(chkEnableRSConnect, "rstudio_connect");
    lessSpaced(rsconnectPanel);

    add(headerLabel("Settings"));
    CheckBox chkEnablePublishing =
        checkboxPref("Enable publishing documents and apps", uiPrefs_.showPublishUi());
    chkEnablePublishing.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            reloadRequired_ = true;
            rsconnectPanel.setVisible(RSConnect.showRSConnectUI() && event.getValue());
          }
        });
    add(chkEnablePublishing);

    if (RSConnect.showRSConnectUI()) add(rsconnectPanel);

    add(
        checkboxPref(
            "Show diagnostic information when publishing", uiPrefs_.showPublishDiagnostics()));

    server_.hasOrphanedAccounts(
        new ServerRequestCallback<Int>() {
          @Override
          public void onResponseReceived(Int numOrphans) {
            missingPkgPanel.setVisible(numOrphans.getValue() > 0);
          }

          @Override
          public void onError(ServerError error) {
            // if we can't determine whether orphans exist, presume that they
            // don't (this state is recoverable as we'll attempt to install
            // rsconnect if necessary and refresh the account list when the user
            // tries to interact with it)
          }
        });
  }