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

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


  private FocusBehavior focusBehavior;
 
  public Carousel() {
    //Set up UI structure
    carouselDock = new DockPanel();
    imagePanel = new AbsolutePanel();
    imagePanel.setSize("100%", "100%");
    caption = new Label();
    carouselDock.add(caption, DockPanel.SOUTH);
    carouselDock.add(imagePanel, DockPanel.NORTH);
    carouselDock.setCellHeight(caption, "15");
View Full Code Here


  }
 
  public Carousel(boolean useDefaultMouseBehavior, boolean useDefaultFocusBehavior) {
    // Set up UI structure
    carouselDock = new DockPanel();
    imagePanel = new AbsolutePanel();
    imagePanel.setSize("100%", "100%");
    caption = new Label();
    carouselDock.add(caption, DockPanel.SOUTH);
    carouselDock.add(imagePanel, DockPanel.NORTH);
    carouselDock.setCellHeight(caption, "15");
View Full Code Here

  private FocusBehavior focusBehavior;
 
  public Carousel() {
    //Set up UI structure
    carouselDock = new DockPanel();
    imagePanel = new AbsolutePanel();
    imagePanel.setSize("100%", "100%");
    caption = new Label();
    carouselDock.add(caption, DockPanel.SOUTH);
    carouselDock.add(imagePanel, DockPanel.NORTH);
    carouselDock.setCellHeight(caption, "15");
View Full Code Here

        DecoratedTabPanel decoratedTabPanel = new DecoratedTabPanel();
        decoratedTabPanel.setAnimationEnabled(true);
        rootPanel.add(decoratedTabPanel, 10, 10);
        decoratedTabPanel.setSize("870px", "480px");

        AbsolutePanel absolutePanel = new AbsolutePanel();
        absolutePanel.setSize("847px", "425px");

        DecoratorPanel decoratorPanelWest = new DecoratorPanel();
        absolutePanel.add(decoratorPanelWest, 10, 10);
        decoratorPanelWest.setSize("240px", "400px");

        AbsolutePanel treePanel = new AbsolutePanel();
        treePanel.setSize("230px", "395px");
        decoratorPanelWest.setWidget(treePanel);

        ScrollPanel treeScrollPanel = new ScrollPanel();
        treePanel.add(treeScrollPanel, 10, 10);
        treeScrollPanel.setSize("210px", "375px");

        final Tree tree = getTree(images);
        treeScrollPanel.setWidget(tree);

        final DecoratorPanel decoratorPanelCenter = new DecoratorPanel();

        absolutePanel.add(decoratorPanelCenter, 256, 10);
        decoratorPanelCenter.setSize("400px", "402px");

        AbsolutePanel centerAbsolutePanel = new AbsolutePanel();
        centerAbsolutePanel.setSize("97%", "100%");

        this.header = new HTML("Select an item");
        this.header.setDirectionEstimator(true);
        centerAbsolutePanel.add(this.header, 10, 10);
        this.header.setSize("450px", "50px");
        this.header.setStyleName("header-style");

        this.details = new HTML("No item selected");
        centerAbsolutePanel.add(this.details, 10, 76);
        this.details.setSize("450px", "156px");

        HTML html = new HTML("<hr />", true);
        centerAbsolutePanel.add(html, 10, 43);
        html.setSize("380px", "15px");

        this.frame = new NamedFrame("download-frame");
        frame.setStyleName("download-frame");
        rootPanel.add(frame);

        this.exportButton = new Button("Export site", new ClickHandler() {

            public void onClick(ClickEvent event) {
                frame.setUrl(exportHref);
            }
        });
        this.exportButton.setEnabled(false);
        centerAbsolutePanel.add(this.exportButton, 10, 359);
        decoratorPanelCenter.setWidget(centerAbsolutePanel);
        centerAbsolutePanel.setSize("400px", "393px");

        DecoratorPanel decoratorPanelEast = new DecoratorPanel();
        absolutePanel.add(decoratorPanelEast, 672, 10);
        decoratorPanelEast.setSize("165px", "405px");
        AbsolutePanel absolutePanelImportLink = new AbsolutePanel();
        absolutePanelImportLink.setSize("162px", "395px");

        final Anchor importAnchor = new Anchor("Import site");
        absolutePanelImportLink.add(importAnchor, 10, 10);
        importAnchor.setWidth("90%");

        decoratorPanelEast.setWidget(absolutePanelImportLink);

        decoratedTabPanel.add(absolutePanel, "Export/Import sites", false);
View Full Code Here

        dialogBox.setText("Import site");
        dialogBox.setAnimationEnabled(true);
        dialogBox.setModal(true);
        dialogBox.setGlassEnabled(true);

        final AbsolutePanel absolutePanel = new AbsolutePanel();
        dialogBox.setWidget(absolutePanel);
        absolutePanel.setStyleName("status-panel");
        absolutePanel.setSize("400px", "220px");

        final Button importButton = new Button("Import");
        final Label importModeLabel = new Label("Import Mode:");
        final ListBox importModeListBox = new ListBox(false);
        importModeListBox.addItem("Conserve", "conserve");
        importModeListBox.addItem("Insert", "insert");
        importModeListBox.addItem("Merge", "merge");
        importModeListBox.addItem("Overwrite", "overwrite");
        importModeListBox.setSelectedIndex(2); // set default to 'merge'

        final HTML statusImg = new HTML("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", true);
        final Label statusLabel = new Label("status label");
        final Label headerLabel = new Label("Select file to import :");
        final AbsolutePanel statusPanel = new AbsolutePanel();
        headerLabel.setSize("380px", "39px");
        headerLabel.setStyleName("header-style");
        absolutePanel.add(headerLabel, 10, 10);

        final MultiUploader uploader = new GTNMultiUploader();
        uploader.setAvoidRepeatFiles(false);
        absolutePanel.add(uploader, 10, 46);
        uploader.setSize("380px", "32px");
        uploader.addOnChangeUploadHandler(new IUploader.OnChangeUploaderHandler() {

            @Override
            public void onChange(IUploader uploader) {
                // Nothing to do
                if (uploader.getFileName() != null) {
                    importButton.setEnabled(true);
                }
            }
        });

        // Add a finish handler which will notify user once the upload finishes
        uploader.addOnFinishUploadHandler(new IUploader.OnFinishUploaderHandler() {

            public void onFinish(IUploader uploader) {

                switch (uploader.getStatus()) {
                    case SUCCESS:
                        statusLabel.setText("File uploaded with success");
                        statusLabel.setStyleName("success-style");
                        statusImg.setStyleName("success-style-icon");
                        break;
                    case ERROR:
                        statusLabel.setText("File upload error");
                        statusLabel.setStyleName("error-style");
                        statusImg.setStyleName("error-style-icon");
                        break;
                    case CANCELED:
                        statusLabel.setText("File upload canceled");
                        statusLabel.setStyleName("warn-style");
                        statusImg.setStyleName("warn-style-icon");
                        break;
                    default:
                        statusLabel.setText("");
                        statusLabel.setStyleName("blank-style");
                        statusImg.setStyleName("blank-style");
                        break;
                }

                importModeListBox.setEnabled(true);
                importButton.setEnabled(true);
            }
        });
        // Add a start handler which will disable the UI until the upload finishes
        uploader.addOnStartUploadHandler(new IUploader.OnStartUploaderHandler() {

            boolean isShwon = false;

            public void onStart(IUploader uploader) {
                if (uploader.getStatus() == IUploadStatus.Status.INPROGRESS) {
                    statusLabel.setText("Process in progress...");
                    statusLabel.setStyleName("progress-style");
                    statusImg.setStyleName("progress-style-icon");
                    importModeListBox.setEnabled(false);
                    importButton.setEnabled(false);
                    if (!isShwon) {
                        statusPanel.setStyleName("status-panel");
                        statusPanel.setSize("380px", "0px");
                        absolutePanel.add(statusPanel, 10, 120);

                        Timer t = new Timer() {

                            int dx = 5;
                            int height = 0;

                            public void run() {
                                height += dx;
                                statusPanel.setHeight(height + "px");
                                if (height >= 45) {
                                    cancel(); // Stop the timer
                                }
                            }
                        };

                        // Schedule the timer to run once in 100 milliseconds.
                        t.scheduleRepeating(100);
                        isShwon = true;
                    }
                }
            }
        });
        // accept only zip files
        uploader.setValidExtensions("zip");
        // You can add customized parameters to servlet call
        uploader.setServletPath(UPLOAD_ACTION_URL + "?pc=" + getPortalContainerName());

        importModeListBox.setTitle("The import mode to use during import.");
        importModeListBox.addChangeHandler(new ChangeHandler() {
            @Override
            public void onChange(ChangeEvent changeEvent) {
                String url = UPLOAD_ACTION_URL + "?pc=" + getPortalContainerName() + "&importMode="
                        + importModeListBox.getValue(importModeListBox.getSelectedIndex());
                uploader.setServletPath(url);
            }
        });

        absolutePanel.add(importModeLabel, 10, 88);
        absolutePanel.add(importModeListBox, 95, 84);
        Button closeButton = new Button("Close", new ClickHandler() {

            public void onClick(ClickEvent event) {
                dialogBox.hide();
            }
        });
        absolutePanel.add(closeButton, 343, 188);

        statusImg.setStyleName("progress-style-icon");
        statusPanel.add(statusImg, 10, 10);
        statusImg.setSize("50px", "30px");

        statusPanel.add(statusLabel, 60, 15);
        statusLabel.setSize("300px", "25px");

        importButton.addClickHandler(new ClickHandler() {

            @Override
View Full Code Here

      
    // adds a widget to end of this partioned absolute panel
    public void add(Widget w) {
       if (nWidgets % WIDGETS_PER_PANEL == 0) {
          // last panel is full, time to add a new one
          subPanel = new AbsolutePanel();
          // Panel sits in upper left corner. Does nothing, can't
          // be seen. It's just a holder for other widgets.
          GChart.setOverflow(subPanel, "visible");
          subPanel.setPixelSize(0,0);
          root.add(subPanel, 0, 0);
View Full Code Here

      context.boundaryPanel.add(movablePanel, currentDraggableLocation.getLeft(),
          currentDraggableLocation.getTop());
      checkGWTIssue1813(movablePanel, context.boundaryPanel);
    } else {
      saveSelectedWidgetsLocationAndStyle();
      AbsolutePanel container = new AbsolutePanel();
      container.getElement().getStyle().setProperty("overflow", "visible");

      container.setPixelSize(context.draggable.getOffsetWidth(),
          context.draggable.getOffsetHeight());
      context.boundaryPanel.add(container, currentDraggableLocation.getLeft(),
          currentDraggableLocation.getTop());
      checkGWTIssue1813(container, context.boundaryPanel);

      int draggableAbsoluteLeft = context.draggable.getAbsoluteLeft();
      int draggableAbsoluteTop = context.draggable.getAbsoluteTop();
      HashMap<Widget, CoordinateLocation> widgetLocation = new HashMap<Widget, CoordinateLocation>();
      for (Widget widget : context.selectedWidgets) {
        widgetLocation.put(widget, new CoordinateLocation(widget.getAbsoluteLeft(),
            widget.getAbsoluteTop()));
      }

      context.dropController = getIntersectDropController(context.mouseX, context.mouseY);
      if (context.dropController != null) {
        context.dropController.onEnter(context);
      }

      for (Widget widget : context.selectedWidgets) {
        Location location = widgetLocation.get(widget);
        int relativeX = location.getLeft() - draggableAbsoluteLeft;
        int relativeY = location.getTop() - draggableAbsoluteTop;
        container.add(widget, relativeX, relativeY);
      }
      movablePanel = container;
    }
    movablePanel.addStyleName(DragClientBundle.INSTANCE.css().movablePanel());
    calcBoundaryOffset();
View Full Code Here

   *
   * @param context the current drag context
   * @return a new drag proxy
   */
  protected Widget newDragProxy(DragContext context) {
    AbsolutePanel container = new AbsolutePanel();
    container.getElement().getStyle().setProperty("overflow", "visible");

    WidgetArea draggableArea = new WidgetArea(context.draggable, null);
    for (Widget widget : context.selectedWidgets) {
      WidgetArea widgetArea = new WidgetArea(widget, null);
      Widget proxy = new SimplePanel();
      proxy.setPixelSize(widget.getOffsetWidth(), widget.getOffsetHeight());
      proxy.addStyleName(DragClientBundle.INSTANCE.css().proxy());
      container.add(proxy, widgetArea.getLeft() - draggableArea.getLeft(),
          widgetArea.getTop() - draggableArea.getTop());
    }

    return container;
  }
View Full Code Here

        //Each Action is a row in a vertical panel
        final VerticalPanel actionsPanel = new VerticalPanel();

        //Wire-up DnD for Actions. All DnD related widgets must be contained in the AbsolutePanel
        AbsolutePanel actionsBoundaryPanel = new AbsolutePanel();
        PickupDragController actionsDragController = new PickupDragController( actionsBoundaryPanel,
                                                                               false );
        actionsDragController.setBehaviorConstrainedToBoundaryPanel( false );
        VerticalPanelDropController actionsDropController = new VerticalPanelDropController( actionsPanel );
        actionsDragController.registerDropController( actionsDropController );

        //Add DnD container to main Conditions container
        actionsBoundaryPanel.add( actionsPanel );
        this.actionsConfigWidget.add( actionsBoundaryPanel );

        //Add a DragHandler to handle the actions resulting from the drag operation
        actionsDragController.addDragHandler( new ActionDragHandler( actionsPanel,
                                                                     model,
View Full Code Here

        //Each Pattern is a row in a vertical panel
        final VerticalPanel patternsPanel = new VerticalPanel();

        //Wire-up DnD for Patterns. All DnD related widgets must be contained in the AbsolutePanel
        AbsolutePanel patternsBoundaryPanel = new AbsolutePanel();
        PickupDragController patternsDragController = new PickupDragController( patternsBoundaryPanel,
                                                                                false );
        patternsDragController.setBehaviorConstrainedToBoundaryPanel( false );
        VerticalPanelDropController widgetDropController = new VerticalPanelDropController( patternsPanel );
        patternsDragController.registerDropController( widgetDropController );

        //Add DnD container to main Conditions container
        conditionsConfigWidget.add( patternsBoundaryPanel );
        patternsBoundaryPanel.add( patternsPanel );

        //Add a DragHandler to handle the actions resulting from the drag operation
        patternsDragController.addDragHandler( new PatternDragHandler( patternsPanel,
                                                                       model,
                                                                       dtable ) );

        List<CompositeColumn<? extends BaseColumn>> columns = model.getConditions();
        boolean arePatternsDraggable = columns.size() > 1 && !isReadOnly;
        for ( CompositeColumn<?> column : columns ) {
            if ( column instanceof Pattern52 ) {
                Pattern52 p = (Pattern52) column;
                VerticalPanel patternPanel = new VerticalPanel();
                VerticalPanel conditionsPanel = new VerticalPanel();
                HorizontalPanel patternHeaderPanel = new HorizontalPanel();
                patternHeaderPanel.setStylePrimaryName( GuidedDecisionTableResources.INSTANCE.css().patternSectionHeader() );
                Label patternLabel = makePatternLabel( p );
                patternHeaderPanel.add( patternLabel );
                patternPanel.add( patternHeaderPanel );
                patternsPanel.add( patternPanel );

                //Wire-up DnD for Conditions. All DnD related widgets must be contained in the AbsolutePanel
                AbsolutePanel conditionsBoundaryPanel = new AbsolutePanel();
                PickupDragController conditionsDragController = new PickupDragController( conditionsBoundaryPanel,
                                                                                          false );
                conditionsDragController.setBehaviorConstrainedToBoundaryPanel( false );
                VerticalPanelDropController conditionsDropController = new VerticalPanelDropController( conditionsPanel );
                conditionsDragController.registerDropController( conditionsDropController );

                //Add DnD container to main Conditions container
                conditionsBoundaryPanel.add( conditionsPanel );
                patternPanel.add( conditionsBoundaryPanel );

                //Add a DragHandler to handle the actions resulting from the drag operation
                conditionsDragController.addDragHandler( new ConditionDragHandler( conditionsPanel,
                                                                                   p,
View Full Code Here

TOP

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

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.