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

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


    /** Creates a new instance of SoftVerticalScroll */
    public SoftHorizontalScrollbar(SoftScrollArea target) {
        this.target = target;
        this.base = new SimplePanel();

        Panel horizontal = new HorizontalPanel();
        this.base.setWidget(horizontal);
        super.initWidget(this.base);
        this.higherTarget.setWidget(this.higher);
        this.barTarget.setWidget(this.bar);
        this.lowerTarget.setWidget(this.lower);

        horizontal.add(lowerTarget);
        horizontal.add(barTarget);
        horizontal.add(higherTarget);
        this.setStyleName("gwittir-SoftHorizontalScrollbar");
        this.bar.setStyleName("bar");
        this.lower.setStyleName("lower");
        this.higher.setStyleName("higher");
        DOM.setStyleAttribute(this.lower.getElement(), "overflow", "hidden");
View Full Code Here


   */
  public void onModuleLoad() {
    try {

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

      // The panel.
      final CollapsiblePanel panel = new CollapsiblePanel();
View Full Code Here

   */
  public void onModuleLoad() {
    try {

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

      // The panel.
      final CollapsiblePanel panel = new CollapsiblePanel();
      String value = Location.getParameter("collapsed");
View Full Code Here

     */
   
    parent.append("<h2>Add a common GWT button</h2>");
   
    //create a GWT Panel wrapping YUI Node parent
    Panel gwtParent = parent.asHTMLPanel(); //GWTUtil.YUI2GWT(Y, parent);
   
    gwtParent.add(new Button("gwtbutton1"));    
   
    /*
     * second usecase, put YUI widgets inside GWT panel
     */   
    HorizontalPanel hpanel1 = new HorizontalPanel();
   
    //create a YUI button not rendered
    org.sgx.yuigwt.yui.widget.button.Button yuibutton1 = Y.newButton(ButtonConfig.create().label("YUIButton1"));
   
    //create a GWT widget wrapping our YUI button
    Widget yuiButtonGwtized = GWTUtil.YUI2GWT(Y, yuibutton1);
   
    hpanel1.add(yuiButtonGwtized);
   

   
    //another much simpler way - use yuiWidget.render(gwtWidget) with GWT HTML widget
//    HTML gwt1 = new HTML("<button>asdasd</button>");
//    hpanel1.add(gwt1);
//    Y.newButton(ButtonConfig.create().label("YUIButton2")).render(gwt1);
   
   
    gwtParent.add(hpanel1);
   
   
    parent.append("<h2>Now include a full GWT Widget made with GWT designer in the YUI parent Node: </h2>");
   
    GwtWidgetSnippet1 gwtPanel1 = new GwtWidgetSnippet1();
    gwtParent.add(gwtPanel1);
   
  }
});
}
View Full Code Here

     
  @Override
  protected Widget initialize(final MapWidget map) {
    //GWT.log("initialize DrawingToolsControls with map=" + map);
    final HandlerManager bus = this.eventBus;
    Panel container = new FlowPanel();
      lineButton = new Image(ToolResources.INSTANCE.lineUp());
        lineButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent clickEvent) {
            //GWT.log("create polyline...");
            bus.fireEvent(new CreatePolyLineEvent());
          }
        });
       
        shapeButton = new Image(ToolResources.INSTANCE.polygonUp());
        shapeButton.addClickHandler(new ClickHandler() {
          public void onClick(ClickEvent clickEvent) {
            //GWT.log("create polygon...");
            bus.fireEvent(new CreatePolygonEvent());
          }
        });
       
        HTML debug = new HTML("debug");
        debug.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
          //GWT.log("Report on stored polylines"); 
          eventBus.fireEvent(new DebugEvent());
        }
      });
      
      container.add(lineButton);
      container.add(shapeButton);
      //container.add(debug);
     
      bind();
     
      return container;
View Full Code Here

   * Creates a table and a view and shows both next to each other.
   *
   * @return a panel with two tables.
   */
  private Widget createDataView() {
    Panel panel = new HorizontalPanel();
    DataTable table = DataTable.create();

    /* create a table with 3 columns */
    table.addColumn(ColumnType.NUMBER, "x");
    table.addColumn(ColumnType.NUMBER, "x * x");
    table.addColumn(ColumnType.NUMBER, "sqrt(x)");
    table.addRows(10);
    for (int i = 0; i < table.getNumberOfRows(); i++) {
      table.setValue(i, 0, i);
      table.setValue(i, 1, i * i);
      table.setValue(i, 2, Math.sqrt(i));
    }
    /* Add original table */
    Panel flowPanel = new FlowPanel();
    panel.add(flowPanel);
    flowPanel.add(new Label("Original DataTable:"));
    Table chart = new Table();
    flowPanel.add(chart);
    chart.draw(table);

    flowPanel = new FlowPanel();
    flowPanel.add(new Label("DataView with columns 2 and 1:"));
    /* create a view on this table, with columns 2 and 1 */
    Table viewChart = new Table();
    DataView view = DataView.create(table);
    view.setColumns(new int[] {2, 1});
    flowPanel.add(viewChart);
    panel.add(flowPanel);
    viewChart.draw(view);

    return panel;
  }
View Full Code Here

   *
   * @return panel with a table.
   */
  private Widget createTable() {
    final String noSelectionString = "<i>No rows selected.</i>";
    final Panel panel = new FlowPanel();
    final HTML label = new HTML(noSelectionString);
    panel.add(new HTML("<h2>Table visualization with selection support</h2>"));
    panel.add(label);
    // Read data from spreadsheet
    String dataUrl = "http://spreadsheets.google.com/tq?key=prll1aQH05yQqp_DKPP9TNg&pub=1";
    Query.Options queryOptions = Query.Options.create();
    queryOptions.setSendMethod(SendMethod.SCRIPT_INJECTION);
    Query query = Query.create(dataUrl, queryOptions);
    query.send(new Callback() {

      public void onResponse(QueryResponse response) {
        if (response.isError()) {
          Window.alert("Error in query: " + response.getMessage() + ' '
              + response.getDetailedMessage());
          return;
        }

        final Table viz = new Table();
        panel.add(viz);
        Options options = Table.Options.create();
        options.setShowRowNumber(true);
        DataTable dataTable = response.getDataTable();
        ArrowFormat formatter = createFormatter();
        formatter.format(dataTable, 1);
View Full Code Here

  protected void init(MealPreferences preferences) {
    initDishes(preferences);

    // Create a table with a checklist of all available dishes based on the
    // user's dietary preferences.
    Panel p = new DockLayoutPanel(Unit.PX);
    p.setWidth("100%");

    FlexTable ft = new FlexTable();

    int index = 0;
    for (String dish : dishes) {
      CheckBox cb = new CheckBox();
      final String dishCopy = dish;
      cb.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          Window.alert("Your order of " + dishCopy + " will be right up.");
        }
      });
      ft.setWidget(index, 0, cb);
      ft.setHTML(index, 1, dish);
      index++;
    }
    p.add(ft);
    RootLayoutPanel.get().add(p);
  }
View Full Code Here

      @Override
      public void onSuccess(Bridge result) {
       
        workouts.addAll(result.workouts);
       
        Panel piePanel = RootPanel.get("WorkoutHistory");
        PieChart pie = new PieChart(createTableDailyWorkout(), createWorkoutPieOptions());

        piePanel.add(pie);
      }

     

      @Override
View Full Code Here

          Carbs+=meal.totalCarbohydrates();
          Fat+=meal.totalFatGrams();


       
        Panel piePanel = RootPanel.get("DailyMealComposition");
       

        // Create a pie chart visualization.
        PieChart pie = new PieChart(createTableDailyMealComposition(), createDailyMealCompositionPieOptions());

        piePanel.add(pie);
      }

      @Override
      public void onFailure(Throwable caught) {
        // TODO Auto-generated method stub
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.