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

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


      final CategoryJavascriptObject categoryJson) {
    final String keyStr = categoryJson.getKeyStr();

    ClickHandler categoryClickHandler = getCategoryClickHandler(keyStr);

    Panel itemPanel = createShopItemPanel(categoryJson);
    itemPanel.addDomHandler(categoryClickHandler, ClickEvent.getType());
   
    //init background image
    final String backgroundBlobKey = categoryJson.getBackgroundBlobKey();

    initBackgroundImage(itemPanel, backgroundBlobKey);
View Full Code Here


  private <T extends ShopItem> ArrayList<Panel> createTiles(
      JsArray<T> arrayFromJson, Function<T, ? extends Panel> panelCreation) {
    ArrayList<Panel> result = new ArrayList<Panel>();
    for (int i = 0; i < arrayFromJson.length(); i++) {
      final T categoryJson = arrayFromJson.get(i);
      Panel itemPanel = panelCreation.apply(categoryJson);
      result.add(itemPanel);
    }

    return result;
  }
View Full Code Here

    public DecisionTableControlsWidget() {
        this( false );
    }

    public DecisionTableControlsWidget(final boolean isReadOnly) {
        Panel panel = new HorizontalPanel();

        // Add row button
        addRowButton = new Button( Constants.INSTANCE.AddRow(),
                                   new ClickHandler() {
                                       public void onClick(ClickEvent event) {
                                           if ( dtable != null ) {
                                               dtable.appendRow();
                                           }
                                       }
                                   } );
        addRowButton.setEnabled( !isReadOnly );
        panel.add( addRowButton );

        otherwiseButton = new Button( Constants.INSTANCE.Otherwise(),
                                      new ClickHandler() {
                                          public void onClick(ClickEvent event) {
                                              if ( dtable != null ) {
                                                  dtable.makeOtherwiseCell();
                                              }
                                          }
                                      } );
        otherwiseButton.setEnabled( false );
        panel.add( otherwiseButton );

        // Add row button
        analyzeButton = new Button( Constants.INSTANCE.Analyze(),
                                    new ClickHandler() {
                                        public void onClick(ClickEvent event) {
                                            if ( dtable != null ) {
                                                dtable.analyze();
                                            }
                                        }
                                    } );
        analyzeButton.setEnabled( !isReadOnly );
        panel.add( analyzeButton );

        initWidget( panel );
    }
View Full Code Here

  public Preloader createPreloader() {
    return new Preloader(getPreloaderBaseURL());
  }

  public PreloaderCallback getPreloaderCallback () {
    final Panel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
    logo.setStyleName("logo");   
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new PreloaderCallback() {

      @Override
View Full Code Here

  public Preloader createPreloader() {
    return new Preloader(getPreloaderBaseURL());
  }

  public PreloaderCallback getPreloaderCallback () {
    final Panel preloaderPanel = new VerticalPanel();
    preloaderPanel.setStyleName("gdx-preloader");
    final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
    logo.setStyleName("logo");   
    preloaderPanel.add(logo);
    final Panel meterPanel = new SimplePanel();
    meterPanel.setStyleName("gdx-meter");
    meterPanel.addStyleName("red");
    final InlineHTML meter = new InlineHTML();
    final Style meterStyle = meter.getElement().getStyle();
    meterStyle.setWidth(0, Unit.PCT);
    meterPanel.add(meter);
    preloaderPanel.add(meterPanel);
    getRootPanel().add(preloaderPanel);
    return new PreloaderCallback() {

      @Override
View Full Code Here

  public void onModuleLoad() {
    // Create a callback to be called when the visualization API
    // has been loaded.
    Runnable onLoadCallback = new GraphRunnable(this)  {
      public void run() {
        Panel panel = RootPanel.get();
        list   = new ArrayList<ArrayList<String>>();
        // DEFINISCO L' HEADER DEL GRAFICO
        h1     =  "Data";
        h2     =  "Temperatura(fahrenheit)";
        h1type  =  ColumnType.DATETIME;
        h2type  =  ColumnType.NUMBER;
        // Creo il grafico

        ScatterChart pie = new ScatterChart(createTable(), createScarredOptions());

        DecoratorPanel   dp        = new DecoratorPanel(); // panel about search
        VerticalPanel   hpv       = new VerticalPanel();//
        HorizontalPanel hpz       = new HorizontalPanel();

        // tab panel relativo al grafico,esportazione arff ecc..
        final TabPanel    tp        = new TabPanel();
        pieLayer.add(pie);
        tp.add(pieLayer,"Grafico");
        tp.selectTab(0);
        Runnable onLoadCallback = new Runnable()  {
          public void run() {
            // Creo la tabella.
            Table grid = new Table(createTable(),createTableOptions());
            Cgrid.add(grid);
            // aggiungo la tabella al tab panel.
            tp.add(Cgrid,"Dati");
            // Creo la text area relativa all'arff
            text = new TextArea();
            text.setWidth("700px");
            text.setVisibleLines(20);
            text.getElement().setId("copytxt");
            text.setReadOnly(true);
            // aggiungo la textarea al pannello
            export.add(text);
            // aggiungo il pannello al tabpanel
            tp.add(export,"Export to Arff");
          }


        };
        VisualizationUtils.loadVisualizationApi(onLoadCallback, Table.PACKAGE);
        //-----------
        // pannelli di ricerca
        HorizontalPanel typepanel_hpz    = new HorizontalPanel();
        HorizontalPanel typepanel_hpz2    = new HorizontalPanel();
        HorizontalPanel date_hp_hz_date1   = new HorizontalPanel();
        HorizontalPanel date_hp_hz_date2   = new HorizontalPanel();
        HorizontalPanel date_hp_hz_time1   = new HorizontalPanel();
        HorizontalPanel date_hp_hz_time2  = new HorizontalPanel();
        HorizontalPanel limit1_hp      = new HorizontalPanel();
        HorizontalPanel limit2_hp      = new HorizontalPanel();
        HorizontalPanel check_hp      = new HorizontalPanel();
        // check box lista aggiunte.
        blist.addItem("Data-Temperatura");
        blist.addItem("Data-Luce");
        blist.addItem("Luce-Temperatura");
        // lista dati grafici
        typepanel_hpz.add(new Label("Dati del  grafico"));
        typepanel_hpz.add(blist);

        blist2  =  getGraphList(Constant.DATA_TEMP);
        typepanel_hpz2.add(new Label("Tipi del  grafico"));
        typepanel_hpz2.add(blist2);

        hpv.add(new Label("Ricerca:"));
        hpv.add(typepanel_hpz);
        hpv.add(typepanel_hpz2);
        hpv.add(new Label("Filtri:"));
        date_hp.setVisible(false);
        temp_hp.setVisible(false);
        light_hp.setVisible(false);
        // VINCOLI DP
        // DATA FILTRO
        final CheckBox   chkdata       = new CheckBox();

        hpheaderdata.add(chkdata);
        hpheaderdata.add(new Label("Data"));
        hpv.add(hpheaderdata);
        //  END DATA FILTRO
        // DATA

        ComponentCreator.CreateDate(date_hp_hz_date1);
        ComponentCreator.CreateDate(date_hp_hz_date2);
        ComponentCreator.CreateTime(date_hp_hz_time1);
        ComponentCreator.CreateTime(date_hp_hz_time2);
        date_hp.add(new Label("Da:"));
        date_hp.add(date_hp_hz_date1)
        date_hp.add(date_hp_hz_time1);
        date_hp.add(new Label("A:"));
        date_hp.add(date_hp_hz_date2);
        date_hp.add(date_hp_hz_time2);
        hpv.add(date_hp);
        // FINE DATA
        // TEMP FILTRO
        final CheckBox check_temp = new CheckBox();

        hpheadertemp.add(check_temp);
        hpheadertemp.add(new Label("Temperatura"));
        hpv.add(hpheadertemp);
        // FINE FILTRO DI TEMPERATURA
        // FILTRO DI TEMPERATURA
        ComponentCreator.CreateTemp(temp_hp);
        hpv.add(temp_hp);
        //
        // LUCE FILTRO
        final CheckBox check_light = new CheckBox();
        hpv.add(check_light);

        hpheaderlight.add(check_light);
        hpheaderlight.add(new Label("Luce"));
        hpv.add(hpheaderlight);
        // FINE LUCE FILTRO.
        // LUCE DATA FILTRO .
        ComponentCreator.CreateLight(light_hp) ;// adding data.
        hpv.add(light_hp);
        limit1.setSize("50px", "12px");
        limit2.setSize("50px", "12px");
        // LUCE DATA.FILTRO FINE
        // LIMITI& NUMERO ELEMENTI
        Label     lb   =  new Label("Se questo è vuoto assume 0 come valore");
        Label     lb2 =  new Label("Se questo è vuoto assume 5000 come valore");
        Label     lb3 =  new Label("Mostra il numero totale degli elementi associati a questa ricerca");
        lb.getElement().getStyle().setFontSize(10.0, Unit.PX);
        lb2.getElement().getStyle().setFontSize(10.0, Unit.PX);
        limit1_hp.add(new Label("Riga di partenza"));
        limit1_hp.add(limit1);
        limit1_hp.add(lb);
        limit2_hp.add(new Label("Numero elementi "));
        limit2_hp.add(limit2);
        limit2_hp.add(lb2);
        check_hp.add(ck);
        check_hp.add(lb3);
        hpv.add(check_hp);
        hpv.add(limit1_hp);
        hpv.add(limit2_hp);
        // SEARCH.
        Button searchButton = new Button("Cerca");
        hpv.add(searchButton); // ADDING SERCH BUTTON.

        //VERTICAL PANEL
        // RESULT PANEL

        HTML html = new HTML("<hr>");
        hpv.add(html);
        hpv.add(notice);
        notice.setText("La pagina non contiene risultati.");
        dp.add(hpv);
        // FINE VP.
        hpz.add(dp);// SEARCHBAR
        hpz.add(tp);// PAGE DATA AND GRAPH

       

        panel.add(hpz);
        // EVENT
        loaded = false;
        searchButton.addClickHandler(getRoot());
            // setVisible da rootPanel modifica la visibility, non la proprietà display,
            // quindi elementi (es. GIF) continuano a pesare sulla pagina
View Full Code Here

     * Will open if existing. If not it will return false;
     */
    public boolean showIfOpen(String key) {
        if (openedTabs.containsKey(key)) {
            LoadingPopup.close();
            Panel tpi = (Panel) openedTabs.get(key);
            tabLayoutPanel.selectTab(tpi);
            return true;
        }
        return false;
    }
View Full Code Here

        }
        return false;
    }

    public void close(String key) {
        Panel tpi = openedTabs.remove(key);

        int widgetIndex = tabLayoutPanel.getWidgetIndex(tpi);
        if (widgetIndex == tabLayoutPanel.getSelectedIndex()) {
            if (widgetIndex > 0) {
                tabLayoutPanel.selectTab(widgetIndex - 1);
View Full Code Here

        summaryTable.addRow( summary );
    }

    public void showErrors(BuilderResult errors) {

        Panel err = new SimplePanel();

        PackageBuilderWidget.showBuilderErrors( errors,
                                                err );
    }
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

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.