Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation


        else
        {
            success = Console.MESSAGES.successEnabled(record.getRuntimeName());
            failed = Console.MESSAGES.failedToEnable(record.getRuntimeName());
        }
        final PopupPanel loading = Feedback.loading(
                Console.CONSTANTS.common_label_plaseWait(),
                Console.CONSTANTS.common_label_requestProcessed(),
                new Feedback.LoadingCallback()
                {
                    @Override
                    public void onCancel()
                    {

                    }
                });

        deploymentStore.enableDisableDeployment(record, new SimpleCallback<DMRResponse>()
        {
            @Override
            public void onFailure(final Throwable caught)
            {
                loading.hide();
                Console.error(failed, caught.getMessage());
            }

            @Override
            public void onSuccess(DMRResponse response)
            {
                loading.hide();
                ModelNode result = response.get();
                if (result.isFailure())
                {
                    Console.error(failed, result.getFailureDescription());
                }
View Full Code Here


    @Override
    public void onAssignToServerGroup(final DeploymentRecord deployment, final boolean enable,
            Set<ServerGroupSelection> selection)
    {
        final PopupPanel loading = Feedback.loading(
                Console.CONSTANTS.common_label_plaseWait(),
                Console.CONSTANTS.common_label_requestProcessed(),
                new Feedback.LoadingCallback()
                {
                    @Override
                    public void onCancel()
                    {

                    }
                });

        Set<String> names = new HashSet<String>();
        for (ServerGroupSelection group : selection)
        { names.add(group.getName()); }

        deploymentStore.addToServerGroups(names, enable, deployment, new SimpleCallback<DMRResponse>()
        {
            @Override
            public void onFailure(final Throwable caught)
            {
                loading.hide();
                Console.error(Console.MESSAGES.addingFailed("Deployment " + deployment.getRuntimeName()),
                        caught.getMessage());
            }

            @Override
            public void onSuccess(DMRResponse response)
            {
                loading.hide();
                ModelNode result = response.get();
                if (result.isFailure())
                {
                    Console.error(Console.MESSAGES.addingFailed("Deployment " + deployment.getRuntimeName()),
                            result.getFailureDescription());
View Full Code Here

    public void onRemoveContent(final DeploymentRecord deployment)
    {
        assert contentRepository != null : "Contentrepository must not be null!";
        List<String> assignedGroups = contentRepository.getServerGroups(deployment);

        final PopupPanel loading = Feedback.loading(
                Console.CONSTANTS.common_label_plaseWait(),
                Console.CONSTANTS.common_label_requestProcessed(),
                new Feedback.LoadingCallback()
                {
                    @Override
                    public void onCancel()
                    {

                    }
                });

        ModelNode operation = new ModelNode();
        operation.get(OP).set(COMPOSITE);
        operation.get(ADDRESS).setEmptyList();

        List<ModelNode> steps = new LinkedList<ModelNode>();
        for (String group : assignedGroups)
        {
            ModelNode groupOp = new ModelNode();
            groupOp.get(OP).set(REMOVE);
            groupOp.get(ADDRESS).add("server-group", group);
            groupOp.get(ADDRESS).add("deployment", deployment.getName());
            steps.add(groupOp);
        }

        ModelNode removeContentOp = new ModelNode();
        removeContentOp.get(OP).set(REMOVE);
        removeContentOp.get(ADDRESS).add("deployment", deployment.getName());
        steps.add(removeContentOp);
        operation.get(STEPS).set(steps);
        dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>()
        {
            @Override
            public void onSuccess(DMRResponse dmrResponse)
            {
                loading.hide();

                ModelNode result = dmrResponse.get();

                if (result.isFailure())
                {
View Full Code Here

        err.getElement().getParentElement().setAttribute("style", "width:16px;vertical-align:middle");

        err.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                PopupPanel popup = new PopupPanel(true);
                popup.getElement().setAttribute("style", "z-index:20");
                popup.setWidget(new Label(input.getErrMessage()));
                popup.setStyleName("popup-hint");
                popup.setPopupPosition(err.getAbsoluteLeft()+16, err.getAbsoluteTop()+16);
                popup.show();
            }
        });
    }
View Full Code Here

        }
        return label;
    }

    private PopupPanel createPopup() {
        final PopupPanel popup = new PopupPanel();
        popup.setGlassEnabled( true );

        okButton.addClickHandler( new ClickHandler() {

            public void onClick(ClickEvent event) {
                executeOnValueChangeCommand();
                panel.clear();
                panel.add( textWidget );
                popup.hide();
            }
        } );

        HorizontalPanel horizontalPanel = new HorizontalPanel();
        horizontalPanel.add( enumDropDown );
        horizontalPanel.add( okButton );
        popup.add( horizontalPanel );
        return popup;
    }
View Full Code Here

        else
        {
            success = Console.MESSAGES.successEnabled(record.getRuntimeName());
            failed = Console.MESSAGES.failedToEnable(record.getRuntimeName());
        }
        final PopupPanel loading = Feedback.loading(
                Console.CONSTANTS.common_label_plaseWait(),
                Console.CONSTANTS.common_label_requestProcessed(),
                new Feedback.LoadingCallback()
                {
                    @Override
                    public void onCancel()
                    {

                    }
                });

        deploymentStore.enableDisableDeployment(record, new SimpleCallback<DMRResponse>()
        {
            @Override
            public void onFailure(final Throwable caught)
            {
                loading.hide();
                Console.error(failed, caught.getMessage());
            }

            @Override
            public void onSuccess(DMRResponse response)
            {
                loading.hide();
                ModelNode result = response.get();
                if (result.isFailure())
                {
                    Console.error(failed, result.getFailureDescription());
                }
View Full Code Here

  protected void performOperation() {
    performOperation( true );
  }

  protected void performOperation( boolean feedback ) {
    final PopupPanel popup = new PopupPanel( true, false ) {
      public void show() {
        // show glass pane
        super.show();
        if ( pageBackground == null ) {
          pageBackground = new FocusPanel() {
            public void onBrowserEvent( Event event ) {
              int type = event.getTypeInt();
              switch ( type ) {
                case Event.ONKEYDOWN: {
                  if ( (char) event.getKeyCode() == KeyCodes.KEY_ESCAPE ) {
                    event.stopPropagation();
                    hide();
                  }
                  return;
                }
              }
              super.onBrowserEvent( event );
            };
          };
          pageBackground.addClickHandler( new ClickHandler() {
            public void onClick( ClickEvent event ) {
              hide();
              pageBackground.setVisible( false );
              pageBackground.getElement().getStyle().setDisplay( Display.NONE );
            }
          } );
          RootPanel.get().add( pageBackground, 0, 0 );
        }
        pageBackground.setSize( "100%", Window.getClientHeight() + Window.getScrollTop() + "px" ); //$NON-NLS-1$ //$NON-NLS-2$
        pageBackground.setVisible( true );
        pageBackground.getElement().getStyle().setDisplay( Display.BLOCK );

        // hide <embeds>
        // TODO: migrate to GlassPane Listener
        FrameUtils.toggleEmbedVisibility( false );

        // Notify listeners that we're showing a dialog (hide PDFs, flash).
        GlassPane.getInstance().show();
      }

      public void hide( boolean autoClosed ) {
        super.hide( autoClosed );
        pageBackground.setVisible( false );
        GlassPane.getInstance().hide();
      }

      protected void onPreviewNativeEvent( final NativePreviewEvent event ) {
        // Switch on the event type
        int type = event.getTypeInt();
        switch ( type ) {
          case Event.ONKEYDOWN: {
            Event nativeEvent = Event.as( event.getNativeEvent() );
            if ( (char) nativeEvent.getKeyCode() == KeyCodes.KEY_ESCAPE ) {
              event.cancel();
              hide();
            }
            return;
          }
        }
      };
    };

    if ( popup.isShowing() ) {
      popup.hide();
      return;
    }

    String url = GWT.getHostPageBaseURL() + "api/plugin-manager/settings/new-toolbar-button"; //$NON-NLS-1$
    RequestBuilder rb = new RequestBuilder( RequestBuilder.GET, url );
    rb.setHeader( "Content-Type", "text/plain" ); //$NON-NLS-1$//$NON-NLS-2$
    rb.setHeader( "accept", "application/json" ); //$NON-NLS-1$//$NON-NLS-2$
    rb.setHeader( "If-Modified-Since", "01 Jan 1970 00:00:00 GMT" );
    try {
      rb.sendRequest( null, new RequestCallback() {

        @Override
        public void onError( Request request, Throwable exception ) {
          MessageDialogBox dialogBox = new MessageDialogBox( Messages.getString( "error" ), exception.getMessage(), //$NON-NLS-1$ //$NON-NLS-2$
              false, false, true );
          dialogBox.center();
        }

        @Override
        public void onResponseReceived( Request request, Response response ) {
          if ( response.getStatusCode() == 200 ) {
            JsArray<JsCreateNewConfig> jsarray = parseJson( JsonUtils.escapeJsonForEval( response.getText() ) );
            final ArrayList<JsCreateNewConfig> sorted = new ArrayList<JsCreateNewConfig>();
            for ( int i = 0; i < jsarray.length(); i++ ) {
              sorted.add( jsarray.get( i ) );
            }
            Collections.sort( sorted, new JsCreateNewConfigComparator() );
            popup.setStyleName( "newToolbarDropdown" );
            VerticalPanel buttonPanel = new VerticalPanel();
            popup.add( buttonPanel );
            for ( int i = 0; i < sorted.size(); i++ ) {
              final int finali = i;
              Button button = new Button( Messages.getString( sorted.get( i ).getLabel() ) );
              button.setStyleName( "pentaho-button" );
              button.getElement().addClassName( "newToolbarDropdownButton" );
              button.addClickHandler( new ClickHandler() {
                public void onClick( ClickEvent event ) {
                    if (sorted.get( finali ).getActionUrl().startsWith("javascript:")) {
                      doEvalJS(sorted.get( finali ).getActionUrl().substring("javascript:".length()));
                    } else {
                      SolutionBrowserPanel.getInstance().getContentTabPanel().showNewURLTab(
                        Messages.getString( sorted.get( finali ).getTabName() ),
                        Messages.getString( sorted.get( finali ).getTabName() ), sorted.get( finali ).getActionUrl(),
                        false );
                    }
                  popup.hide();
                }
              } );
              String name = sorted.get( i ).getName();
              if ("data-access".equals(name)) {
                  buttonPanel.add(new HTML("<hr style='color: #a7a7a7' />"));
              }
              buttonPanel.add( button );
            }
            popup.setPopupPosition( anchorWidget.getAbsoluteLeft(), anchorWidget.getAbsoluteTop()
                + anchorWidget.getOffsetHeight() );
            popup.show();
          } else {
            MessageDialogBox dialogBox =
                new MessageDialogBox( Messages.getString( "error" ), Messages.getString( "error" ), //$NON-NLS-1$ //$NON-NLS-2$
                    false, false, true );
            dialogBox.center();
View Full Code Here

public class Issue2855 extends AbstractIssue {

  @Override
  public Widget createIssue() {
    // Create the popup panel
    final PopupPanel popup = new PopupPanel();

    // Add buttons to call getters and setters
    Button toggleAutoHide = new Button("4. Toggle AutoHide",
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            popup.setAutoHideEnabled(!popup.isAutoHideEnabled());
          }
        });
    Button toggleModal = new Button("3. Toggle Modal", new ClickHandler() {
      public void onClick(ClickEvent event) {
        popup.setModal(!popup.isModal());
      }
    });
    Button isAutoHide = new Button("isAutoHide?", new ClickHandler() {
      public void onClick(ClickEvent event) {
        Window.alert("AutoHide: " + popup.isAutoHideEnabled());
      }
    });
    Button isModal = new Button("isModal?", new ClickHandler() {
      public void onClick(ClickEvent event) {
        Window.alert("Modal: " + popup.isModal());
      }
    });
    Button closeButton = new Button("Close", new ClickHandler() {
      public void onClick(ClickEvent event) {
        popup.hide();
      }
    });
    VerticalPanel vPanel = new VerticalPanel();
    vPanel.add(toggleModal);
    vPanel.add(toggleAutoHide);
    vPanel.add(isModal);
    vPanel.add(isAutoHide);
    vPanel.add(closeButton);
    popup.setWidget(vPanel);

    // Add control buttons
    Button showPopup = new Button("1. Show Popup", new ClickHandler() {
      public void onClick(ClickEvent event) {
        popup.center();
      }
    });
    Button clickable = new Button("2/4. Click Me", new ClickHandler() {
      public void onClick(ClickEvent event) {
        Window.alert("You got me!");
View Full Code Here

    Label label = new Label("Click to the right of this box while the popup "
        + "is visible >>>");
    label.getElement().getStyle().setProperty("border", "1px solid red");

    // Create a modal PopupPanel
    final PopupPanel popup = new PopupPanel(false, true);
    popup.setWidget(new Button("Hide Popup", new ClickHandler() {
      public void onClick(ClickEvent event) {
        popup.hide();
      }
    }));

    // Create a button to show the PopupPanel
    Button showPopupButton = new Button("Show Popup", new ClickHandler() {
      public void onClick(ClickEvent event) {
        popup.center();
      }
    });

    // Create a bunch of input elements to test
    // TODO(jlabanca): divide this out into a separate issue 2707
View Full Code Here

  @Override
  public Widget createIssue() {
    VerticalPanel panel = new VerticalPanel();
    panel.setSpacing(3);
    {
      PopupPanel popup = createButton(true, false, panel);
      Label partner0 = new Label("AutoHide Partner 0");
      Label partner1 = new Label("AutoHide Partner 1");
      popup.addAutoHidePartner(partner0.getElement());
      popup.addAutoHidePartner(partner1.getElement());

      HorizontalPanel hPanel = new HorizontalPanel();
      hPanel.setBorderWidth(1);
      hPanel.setSpacing(3);
      hPanel.add(partner0);
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.PopupPanel$ResizeAnimation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.