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

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


    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


      }
    }
  }

  private Panel getDetailsPanel(final Dto related, final Hyperlink link, final String fieldId, final ModuleDto moduleDtoRelated) {
    final PopupPanel popup = getDetailsPopup(related, fieldId, moduleDtoRelated);
    final Label details = new Label(" [details]");

    details.addMouseOverHandler(new MouseOverHandler() {
      @Override
      public void onMouseOver(MouseOverEvent event) {
        int left = link.getAbsoluteLeft();
        int top = link.getAbsoluteTop() + 16;
        popup.setPopupPosition(left, top);
        popup.show();
      }
    });

    details.addMouseOutHandler(new MouseOutHandler() {
      @Override
      public void onMouseOut(MouseOutEvent event) {
        popup.hide();
      }
    });

    final Panel panel = new HorizontalPanel();
    panel.add(link);
View Full Code Here

    return panel;
  }

  private PopupPanel getDetailsPopup(final Dto related, final String fieldId, final ModuleDto moduleDtoRelated) {
    final PopupPanel popup = new PopupPanel(true);

    String html = "";

    for (final String key : related.getAllPreviewableFieldsSorted()) {
      final Serializable value = related.get(key);
      final String label = moduleDtoRelated.getFieldById(key).getLabel();
      html += "<li>" + label + ": " + value.toString() + "</li>";
    }

    popup.add(new HTML("<ul>" + html + "</ul>"));

    return popup;
  }
View Full Code Here

    private final int N = 10;
    private final  PopupPanel popup;
    private final  static ProgressMonitor _instance = new ProgressMonitor();
   
    private ProgressMonitor() {
        popup = new PopupPanel();
        popup.addStyleName("progressMonitor");
       
       
        header = new HTML();
        bar = new FlexTable();
View Full Code Here

        this.position = position;
    }

    public void handleException(Object source, ValidationException exception) {
        final Widget w = (Widget) source;
        final PopupPanel p = new PopupPanel(false);
        popups.put( source, p );
        p.setStyleName("gwittir-ValidationPopup");
        p.setWidget(new Label(this.getMessage(exception)));
        p.setPopupPosition( -5000, -5000 );
        p.show();
        if(this.position == BOTTOM) {
            p.setPopupPosition(w.getAbsoluteLeft(),
                w.getAbsoluteTop() + w.getOffsetHeight());
        } else if(this.position == RIGHT) {
            p.setPopupPosition(w.getAbsoluteLeft() + w.getOffsetWidth(),
                w.getAbsoluteTop());
        } else if(this.position == LEFT) {
            p.setPopupPosition(w.getAbsoluteLeft() - p.getOffsetWidth(),
                w.getAbsoluteTop());
        } else if(this.position == TOP) {
            p.setPopupPosition(w.getAbsoluteLeft(),
                w.getAbsoluteTop() - p.getOffsetHeight());
        }
        if( w instanceof SourcesPropertyChangeEvents ){
            GWT.log( "is PCE", null);
            PropertyChangeListener attachListener = new PropertyChangeListener(){
                public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
                    if( ((Boolean)propertyChangeEvent.getNewValue()).booleanValue()  ){
                        p.setVisible( true );
                    } else {
                        p.setVisible( false );
                    }
                }
               
            };
             listeners.put(w, attachListener );
View Full Code Here

            ((SourcesPropertyChangeEvents)w).addPropertyChangeListener("visible", attachListener);
        }
    }

    public void resolve(Object source) {
        PopupPanel p = (PopupPanel) popups.get( source );
        if( p != null ){
            p.hide();
            popups.remove( source );
            if( listeners.containsKey( source ) ){
                try{
                    ((SourcesPropertyChangeEvents) source)
                    .removePropertyChangeListener("attach",
View Full Code Here

                if(field.getHelpText() != null) {
                    label.addClickListener(
                        new ClickListener() {
                            public void onClick(Widget widget) {
                                final PopupPanel p = new PopupPanel(true);
                                p.setStyleName("gwittir-GridForm-Help");
                                p.setWidget(new HTML(field.getHelpText()));
                                p.setPopupPosition(
                                    widget.getAbsoluteLeft(),
                                    widget.getAbsoluteTop()
                                    + widget.getOffsetHeight());
                                p.show();
                            }
                        });
                }

                i++;
View Full Code Here

                break;
            }
        }

        // Create a popup to show the full size image.
        final PopupPanel imagePopup = new PopupPanel(true);
        imagePopup.addCloseHandler(new CloseHandler<PopupPanel>() {
            public void onClose(CloseEvent<PopupPanel> event) {
                if (event.isAutoClosed())
                    hidePhoto();
            }
        });
        // Scale to the size of the browser window's client area.
        double scaleFactor = photo.getScaleFactor(Window.getClientWidth(),
                Window.getClientHeight());
        final int width = (int) (photo.getWidth() * scaleFactor);
        Image image = new Image(photo.getURL(width));
        FocusPanel focusPanel = new FocusPanel(image);
        focusPanel.addKeyDownHandler(new KeyDownHandler() {
            public void onKeyDown(KeyDownEvent event) {
                switch (event.getNativeKeyCode()) {
                case KeyCodes.KEY_RIGHT:
                    showNearbyPhoto(true);
                    break;
                case KeyCodes.KEY_LEFT:
                    showNearbyPhoto(false);
                    break;
                case KeyCodes.KEY_ESCAPE:
                    hidePhoto();
                    break;
                }
            }
        });
        imagePopup.setWidget(focusPanel);
        image.setPixelSize(width, (int) (photo.getHeight() * scaleFactor));
        final Element imageElement = image.getElement();
        focusPanel.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                showNearbyPhoto(event.getRelativeX(imageElement) >= width / 2);
            }
        });

        imagePopup.setGlassEnabled(true);
        imagePopup.center();
        focusPanel.setFocus(true);
    }
View Full Code Here

    vp.add(topTen);
    topTen.addClickHandler(new ClickHandler() {

      public void onClick(ClickEvent event) {
        Grid g = null;
        PopupPanel pop = null;
        if (g == null) {
          pop = new PopupPanel();
          pop.setAutoHideEnabled(true);
          g = new Grid(11, 3);
          g.setText(0, 0, "Top");
          g.setText(0, 1, "Initial Angle");
          g.setText(0, 2, "Circles hit");
          pop.add(g);
        }
        for (int i = 0; i < results.size(); i++) {
          g.setText(i + 1, 0, i + 1 + "");
          g.setText(i + 1, 1, results.get(i).getInitialAngle() + "");
          g.setText(i + 1, 2, results.get(i).printHitSequence());
        }
        pop.show();
        pop.center();

      }
    });

    final CheckBox angleLimitBox = new CheckBox("0-120 instead of 0-360");
View Full Code Here

    handler.add(new DataPoint(12, -6.6));

    // create the plot
    SimplePlot plot = new SimplePlot(model, plotOptions);

        final PopupPanel popup = new PopupPanel();
          final Label label = new Label();
          popup.add(label);

    // add hover listener
    plot.addHoverListener(new PlotHoverListener() {
      public void onPlotHover(Plot plot, PlotPosition position, PlotItem item) {
        if(position != null){
          positionLabel.setText("position: ("+position.getX()+","+position.getY()+")");
        }
        if (item != null) {
            String text = "x: " + item.getDataPoint().getX() + ", y: " + item.getDataPoint().getY();

          selectedPointLabel
              .setText(text);

                  label.setText(text);
                  popup.setPopupPosition(item.getPageX() + 10, item.getPageY() - 25);
                  popup.show();
        } else {
          selectedPointLabel.setText(INSTRUCTIONS);
          popup.hide();
        }
      }
    }, false);

    // put it on a panel
View Full Code Here

TOP

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

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.