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

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


    int rowCount = sourceTable.getRowCount();
    VkStateHelper.getInstance().setDesignerMode(true);
    for(int i = 0; i < rowCount; i++) {
      for(int j = 0, colNum = 0, columnCount = sourceTable.getCellCount(i); j < columnCount; j++, colNum++) {
        targetTable.makeCell(i, j);
        Panel sourcePanel = (Panel) sourceTable.getWidget(i, j);
        Panel targetPanel = (Panel) targetTable.getWidget(i, j);
        for(Widget k : sourcePanel) {
          IVkWidget currentWidget = ((IVkWidget) k);
          Widget newWidget = VkStateHelper.getInstance().getEngine().getWidget(currentWidget.getWidgetName());
          VkStateHelper.getInstance().getWidgetEngineMapping().getEngineMap().get(currentWidget.getWidgetName()).deepClone((Widget) currentWidget, newWidget);
          targetPanel.add(newWidget);
        }
      }
      DOM.setElementAttribute(targetTable.getRowFormatter().getElement(i), "height", DOM.getElementAttribute(sourceTable.getRowFormatter().getElement(i), "height"));
    }
    VkStateHelper.getInstance().setDesignerMode(false);//because it would be false when this would be called from VkAbstractWidgetEngine#deepClone
View Full Code Here


  private static int index = 0;

  @Override
  public void onModuleLoad()
  {
    final Panel root = RootPanel.get();

    final Button button1 = new Button("RPC 1");
    final Button button2 = new Button("RPC 2");

    button1.addClickHandler(new ClickHandler()
    {
      @Override
      public void onClick(final ClickEvent event)
      {
        GWT.<Rpc1ServiceAsync> create(Rpc1Service.class).getString(index++,
            new WindowAlertAsyncCallback());
      }
    });

    button2.addClickHandler(new ClickHandler()
    {
      @Override
      public void onClick(final ClickEvent event)
      {
        GWT.<Rpc2ServiceAsync> create(Rpc2Service.class).getString(index++,
            new WindowAlertAsyncCallback());
      }
    });

    root.add(button1);
    root.add(button2);
  }
View Full Code Here

    public DecisionTableControlsWidget(final AbstractDecisionTableWidget dtable,
                                       final GuidedDecisionTable52 model,
                                       final UserSecurityContext userSecurityContext,
                                       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 );

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

        // Analyse 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 );

        // Audit Log button
        auditLogButton = new Button( Constants.INSTANCE.DecisionTableAuditLog(),
                                     new ClickHandler() {
                                         public void onClick(ClickEvent event) {
                                             if ( dtable != null ) {
                                                 AuditLog log = new AuditLog( dtable.model,
                                                                              userSecurityContext );
                                                 log.show();
                                             }
                                         }
                                     } );
        auditLogButton.setEnabled( !isReadOnly );
        panel.add( auditLogButton );

        initWidget( panel );
    }
View Full Code Here

                        constraints.put( connectionRef,
                                         constraint );
                    }
                } );

                Panel panel = new HorizontalPanel();
                panel.add( new Label( constants.Priority() ) );
                panel.add( priorityTextBox );
                panel.add( new Label( constants.ValueRuleFlow() ) );
                panel.add( constraintTextBox );

                parametersForm.addAttribute( constraint.getName(),
                                             panel );
            }
        }
View Full Code Here

                        if (dtable != null) {
                            dtable.appendRow();
                        }
                    }
                });
        Panel panel = new HorizontalPanel();
        panel.add(btnAddRow);

        btnOtherwise = new Button("Otherwise",
                new ClickHandler() {

                    public void onClick(ClickEvent event) {
                        if (dtable != null) {
                            dtable.makeOtherwiseCell();
                        }
                    }
                });
        btnOtherwise.setEnabled(false);

        panel.add(btnOtherwise);

        initWidget(panel);

    }
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;
            ImageButton del = new ImageButton(GuvnorImages.INSTANCE.DeleteItemSmall(),
                                         constants.AElementToDelInCollectionList(),
                                         new ClickHandler() {
                                             public void onClick(ClickEvent w) {
                                                 field.collectionFieldList.remove( index );
                                                 calculateValueFromList();
                                                 refreshEditor();
                                             }
                                         } );

            hpanel.add( del );

            ImageButton addPattern = new ImageButton( GuvnorImages.INSTANCE.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 );
            ImageButton moveDown = new ImageButton( GuvnorImages.INSTANCE.SuffleDown() );
            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 );

            ImageButton moveUp = new ImageButton( GuvnorImages.INSTANCE.SuffleUp() );
            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 ) {
            ImageButton add = new ImageButton( GuvnorImages.INSTANCE.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

        presenter.onClose();
    }

    public void showErrors(BuilderResult errors) {

        Panel err = new SimplePanel();

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

    {
      uiInvalidateables.add((UIInvalidatable) widget);
    }

    Container container = null;
    Panel panel = null;
    if (widget instanceof Container)
    {
      container = (Container) widget;
    }
    else if (widget instanceof TabPanel)
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 onFailure(Throwable caught) {
              Window.alert("Can't get all categories except one because of error " + caught);
            }
          });
         
          final Panel panel = parent.getOutputPanel();
         
          panel.add(leftArrow);
          panel.add(carouselContainer);
          panel.add(rightArrow);

          final ArrayList<Photo> photos = new ArrayList<Photo>(goods
              .length());
          for (int i = 0; i < goods.length(); i++) {
            GoodJavascriptObject good = goods.get(i);
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.