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

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


        summaryTable.addRow( summary );
    }

    public void showErrors( BuilderResult errors ) {

        Panel err = new SimplePanel();

        PackageBuilderWidget.showBuilderErrors(
                errors,
                err,
                clientFactory );
View Full Code Here


        return box;
    }

    private Widget listEditor(final ValueChanged changed) {
        Panel panel = new VerticalPanel();
        int i = 0;
        for ( final FieldData f : this.field.collectionFieldList ) {

            DirtyableHorizontalPane hpanel = new DirtyableHorizontalPane();

            FieldDataConstraintEditor fieldElement = new FieldDataConstraintEditor( f.collectionType,
                                                                                    new ValueChanged() {
                                                                                        public void valueChanged(String newValue) {
                                                                                            f.setValue( newValue );
                                                                                            calculateValueFromList();
                                                                                            makeDirty();
                                                                                        }
                                                                                    },
                                                                                    f,
                                                                                    givenFact,
                                                                                    sce,
                                                                                    scenario,
                                                                                    executionTrace );
            hpanel.add( fieldElement );
            final int index = i;
            Image del = new ImageButton( images.deleteItemSmall(),
                                         constants.AElementToDelInCollectionList(),
                                         new ClickHandler() {
                                             public void onClick(ClickEvent w) {
                                                 field.collectionFieldList.remove( index );
                                                 calculateValueFromList();
                                                 refreshEditor();
                                             }
                                         } );

            hpanel.add( del );

            Image addPattern = new ImageButton( images.newItemBelow() );
            addPattern.setTitle( constants.AddElementBelow() );

            addPattern.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    FieldData newFieldData = new FieldData();
                    newFieldData.setName( field.getName() );
                    newFieldData.collectionType = field.collectionType;
                    field.collectionFieldList.add( index + 1,
                                                   newFieldData );
                    calculateValueFromList();
                    refreshEditor();
                }
            } );
            hpanel.add( addPattern );
            Image moveDown = new ImageButton( images.shuffleDown() );
            moveDown.setTitle( constants.MoveDownListMove() );
            moveDown.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    if ( index < field.collectionFieldList.size() - 1 ) {
                        FieldData onMyLine = field.collectionFieldList.get( index );
                        FieldData onDown = field.collectionFieldList.get( index + 1 );
                        field.collectionFieldList.set( index + 1,
                                                       onMyLine );
                        field.collectionFieldList.set( index,
                                                       onDown );
                        calculateValueFromList();
                        refreshEditor();
                    }
                }
            } );
            hpanel.add( moveDown );

            Image moveUp = new ImageButton( images.shuffleUp() );
            moveUp.setTitle( constants.MoveUpList() );
            moveUp.addClickHandler( new ClickHandler() {
                public void onClick(ClickEvent sender) {
                    if ( index > 0 ) {
                        FieldData oneUp = field.collectionFieldList.get( index - 1 );
                        FieldData onMyLine = field.collectionFieldList.get( index );
                        field.collectionFieldList.set( index,
                                                       oneUp );
                        field.collectionFieldList.set( index - 1,
                                                       onMyLine );
                        calculateValueFromList();
                        refreshEditor();
                    }
                }
            } );
            hpanel.add( moveUp );
            panel.add( hpanel );
            i++;
        }

        if ( this.field.collectionFieldList.size() == 0 ) {
            Image add = new ImageButton( images.newItem(),
                                         constants.AElementToAddInCollectionList(),
                                         new ClickHandler() {
                                             public void onClick(ClickEvent w) {
                                                 FieldData newFieldData = new FieldData();
                                                 newFieldData.setName( field.getName() );
                                                 newFieldData.collectionType = field.collectionType;
                                                 field.collectionFieldList.add( newFieldData );
                                                 calculateValueFromList();
                                                 refreshEditor();
                                             }
                                         } );
            panel.add( add );
        }
        return panel;
    }
View Full Code Here

   */
  public void onModuleLoad() {
    try {

      // Some random contents to make the tree interesting.
      Panel contents = createSchoolNavBar();
      FastTree.addDefaultCSS();

      // The actual pinned panel.
      final CollapsiblePanel pinned = new CollapsiblePanel();
      RootPanel.get("pinned-panel").add(pinned);
View Full Code Here

  // matches the chart data.
  private static final String DATA_SOURCE =
      "http://spreadsheets.google.com/tq?key=tRC7Qb0eZXwKXmnnPOmNj3g&pub=1";

  public Widget getWidget() {
    Panel result = new VerticalPanel();
    PieDemo pieDemo = new PieDemo();
    Widget pieWidget = pieDemo.getWidget();
    result.add(pieWidget);
   
    Toolbar toolbar = new Toolbar();
   
    Component component = Component.create();
    component.setType(Type.HTMLCODE);
    component.setDataSource(DATA_SOURCE);
    component.setGadget(GADGET);
    toolbar.addComponent(component);

    component = Component.create();
    component.setType(Type.CSV);
    component.setDataSource(DATA_SOURCE);
    component.setGadget(GADGET);
    toolbar.addComponent(component);
   
    component = Component.create();
    component.setType(Type.HTML);
    component.setDataSource(DATA_SOURCE);
    component.setGadget(GADGET);
    toolbar.addComponent(component);   

    component = Component.create();
    component.setType(Type.IGOOGLE);
    component.setDataSource(DATA_SOURCE);
    component.setGadget(GADGET);
    toolbar.addComponent(component);
   
    result.add(toolbar);

    return result;
  }
View Full Code Here

  private TrafficOverlay trafficInfo;

  private boolean trafficShown;

  public TrafficOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(40.652513, -73.936615), 12);
    map.setSize("640px", "480px");
    panel.add(map);
    Button toggleTraffic = new Button("Toggle Traffic");
    toggleTraffic.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (trafficShown) {
          map.removeOverlay(trafficInfo);
        } else {
          map.addOverlay(trafficInfo);
        }
        trafficShown = !trafficShown;
      }
    });
    panel.add(toggleTraffic);
    final Label changeLabel = new Label();
    panel.add(changeLabel);
    initWidget(panel);
    trafficInfo = new TrafficOverlay();
    trafficInfo.addTrafficOverlayChangedHandler(new TrafficOverlayChangedHandler() {

      public void onChanged(TrafficOverlayChangedEvent event) {
View Full Code Here

  private final MapWidget map;
  private final Button removeAddButton;
  private final Button showHideButton;

  public KmlOverlayDemo() {
    Panel panel = new FlowPanel();
    map = new MapWidget(LatLng.newInstance(41.875696, -87.624207), 11);
    map.setSize("640px", "480px");
    map.setUIToDefault();
    panel.add(map);

    // Toggle the visibility of the overlays by
    // adding and removing the overlay.
    removeAddButton = new Button("Add KML Overlay");
    // Toggle the visibility of the overlays
    // using the show() and hide() methods
    showHideButton = new Button("Hide");
    removeAddButton.setEnabled(false);
    removeAddButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        toggleOverlay();
      }
    });
    panel.add(removeAddButton);

    showHideButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (geoXml == null) {
          return;
        }
        if (geoXml.isHidden()) {
          geoXml.setVisible(true);
          showHideButton.setText("Hide");
        } else {
          geoXml.setVisible(false);
          showHideButton.setText("Show");
        }
      }
    });

    panel.add(showHideButton);
    initWidget(panel);

    GeoXmlOverlay.load(KML_DEMO_URI, new GeoXmlLoadCallback() {

      @Override
View Full Code Here

  private boolean geoXmlShown;
  private MapWidget map;
  private Button toggleButton;

  public GeoRssOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(49.496675, -102.65625), 3);
    map.setSize("640px", "480px");
    map.setUIToDefault();
    panel.add(map);
    toggleButton = new Button("Toggle Markers");
    toggleButton.setEnabled(false);
    toggleButton.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (geoXml == null) {
          return;
        }
        if (geoXmlShown) {
          map.removeOverlay(geoXml);
        } else {
          map.addOverlay(geoXml);
        }
        geoXmlShown = !geoXmlShown;
      }
    });
    panel.add(toggleButton);
    initWidget(panel);

    GeoXmlOverlay.load(
        "http://api.flickr.com/services/feeds/groups_pool.gne?id=322338@N20&format=rss_200&georss=1",
        new GeoXmlLoadCallback() {
View Full Code Here

  }

  private MapWidget map;

  public EarthPluginDemo() {
    Panel panel = new FlowPanel();
    map = new MapWidget(LatLng.newInstance(37.42317, -122.08364), 16);
    map.setSize("500px", "500px");
    map.setUIToDefault();
    map.addMapType(MapType.getEarthMap());
    map.setCurrentMapType(MapType.getEarthMap());
    panel.add(map);
    initWidget(panel);
    map.getEarthInstance(new EarthInstanceHandler() {

      public void onEarthInstance(EarthInstanceEvent event) {
        final JavaScriptObject earth = event.getEarthInstance();
View Full Code Here

    MarkerOptions opt = MarkerOptions.newInstance();
    opt.setDraggable(true);
    marker = new Marker(ATLANTA, opt);

    Panel hp1 = createActionButtons();

    HorizontalPanel hp2 = createListenerListBox();

    // Make a spacer
    HorizontalPanel hp3 = new HorizontalPanel();
View Full Code Here

  private StreetviewOverlay svOverlay;

  private boolean svShown;

  public StreetviewOverlayDemo() {
    Panel panel = new FlowPanel();

    map = new MapWidget(LatLng.newInstance(40.652513, -73.936615), 12);
    map.setSize("640px", "480px");
    panel.add(map);
    Button toggleStreetview = new Button("Toggle Street View Overlay");
    toggleStreetview.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        if (svShown) {
          map.removeOverlay(svOverlay);
        } else {
          map.addOverlay(svOverlay);
        }
        svShown = !svShown;
      }
    });
    panel.add(toggleStreetview);
    final Label changeLabel = new Label();
    panel.add(changeLabel);
    initWidget(panel);
    svOverlay = new StreetviewOverlay();
    svOverlay.addStreetviewOverlayChangedHandler(new StreetviewOverlayChangedHandler() {

      public void onChanged(StreetviewOverlayChangedEvent event) {
View Full Code Here

TOP

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

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.