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

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


  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


        return box;
    }

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

            DirtyableHorizontalPane hpanel = new DirtyableHorizontalPane();

            FieldDataConstraintEditor fieldDataConstraintEditor = helper.createFieldDataConstraintEditor( f );
            fieldDataConstraintEditor.addValueChangeHandler( new ValueChangeHandler<String>() {
                @Override
                public void onValueChange(ValueChangeEvent<String> stringValueChangeEvent) {
                    f.setValue( stringValueChangeEvent.getValue() );
                    calculateValueFromList();
                    makeDirty();
                }
            } );
            hpanel.add( fieldDataConstraintEditor );
            final int index = i;

            hpanel.add( new ImageButton( DroolsGuvnorImages.INSTANCE.deleteItemSmall(),
                                         Constants.INSTANCE.AElementToDelInCollectionList(),
                                         new ClickHandler() {
                                             public void onClick(ClickEvent w) {
                                                 field.collectionFieldList.remove( index );
                                                 calculateValueFromList();
                                                 renderEditor();
                                             }
                                         } ) );

            Image addPattern = new ImageButton( DroolsGuvnorImages.INSTANCE.newItemBelow() );
            addPattern.setTitle( Constants.INSTANCE.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();
                    renderEditor();
                }
            } );
            hpanel.add( addPattern );
            Image moveDown = new ImageButton( DroolsGuvnorImages.INSTANCE.shuffleDown() );
            moveDown.setTitle( Constants.INSTANCE.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();
                        renderEditor();
                    }
                }
            } );
            hpanel.add( moveDown );

            Image moveUp = new ImageButton( DroolsGuvnorImages.INSTANCE.shuffleUp() );
            moveUp.setTitle( Constants.INSTANCE.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();
                        renderEditor();
                    }
                }
            } );
            hpanel.add( moveUp );
            panel.add( hpanel );
            i++;
        }

        if ( this.field.collectionFieldList.size() == 0 ) {
            Image add = new ImageButton( DroolsGuvnorImages.INSTANCE.newItem(),
                                         Constants.INSTANCE.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();
                                                 renderEditor();
                                             }
                                         } );
            panel.add( add );
        }
        return panel;
    }
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() ) {
            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(),
                                         Format.format( constants.AElementToDelInCollectionList(),
                                                        "tt" ),
                                         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(),
                                         Format.format( constants.AElementToAddInCollectionList(),
                                                        "tt" ),
                                         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

     *
     * @return the result as a widget.
     */
    public Panel render(final ModelView result)
    {
        Panel resultWidget;

        if (result instanceof PersonModelView)
        {
            resultWidget = (Panel) personRenderer.render((PersonModelView) result);
        }
        else if (result instanceof DomainGroupModelView)
        {
            resultWidget = (Panel) groupRenderer.render((DomainGroupModelView) result);
        }
        else
        {
            resultWidget = new FlowPanel();
            resultWidget.add(new Label("Unknown Result Type"));
        }

        Object[] resultArr = result.getFieldMatch().getMatchedFieldKeys().toArray();

        FlowPanel matchedWidget = new FlowPanel();

        if (resultArr.length > 0)
        {
            Label resultsLbl = new Label("Matches found in: ");
            matchedWidget.add(resultsLbl);
            matchedWidget.addStyleName(StaticResourceBundle.INSTANCE.coreCss().searchMetadata());
            resultWidget.add(matchedWidget);
        }

        for (int i = 0; i < resultArr.length; i++)
        {
            Label keyLabel = new Label(humanReadableMetadataKeys.get(resultArr[i]));
View Full Code Here

        options.add(addToStartPage);
        options.add(bookmarkStream);

        if (EntityType.GROUP == streamType)
        {
            Panel panel = new FlowPanel();
            panel.add(notifyViaEmail);
            subscribeAllButton = new RadioButton("whichPosts", "All posts to this stream");
            subscribeAllButton.setValue(true);
            subscribeAllButton.setEnabled(false);
            subscribeCoordButton = new RadioButton("whichPosts", "Only posts from coordinators of this stream");
            subscribeCoordButton.setEnabled(false);
            panel.add(subscribeAllButton);
            panel.add(subscribeCoordButton);
            options.add(panel);

            notifyViaEmail.addClickHandler(new ClickHandler()
            {
                public void onClick(final ClickEvent inEvent)
View Full Code Here

     */
    private AvatarLinkPanel(final EntityType entityType,
            final String entityUniqueId, final Size size,
                final AvatarWidget avatar, final boolean allowBadge)
    {
        Panel main = new FlowPanel();
        main.addStyleName(StaticResourceBundle.INSTANCE.coreCss().avatar());
        initWidget(main);

        Page page;
        switch (entityType)
        {
        case PERSON:
            page = Page.PEOPLE;
            break;
        case GROUP:
            page = Page.GROUPS;
            break;
        default:
            // this should never happen
            return;
        }

        String linkUrl = Session.getInstance().generateUrl(
                new CreateUrlRequest(page, entityUniqueId));

        Hyperlink link = new InlineHyperlink("", linkUrl);
        main.add(link);
        // Manipulate HTML to put the
        // class, whose CSS includes a badge image,
        // within the anchor tag for the gwt-InlineHyperlink
        if (allowBadge)
        {
View Full Code Here

                followPanel.addStyleName(style.followControlsPanel());
                main.add(followPanel);
            }
            else
            {
                Panel panel = new FlowPanel();
                panel.addStyleName(style.followControlsPanel());
                panel.addStyleName(style.multi());
                panel.add(followPanel);

                final Label block = new Label();
                block.addStyleName(style.blockButton());
                block.setTitle("Block this suggestion");
                block.addClickHandler(new ClickHandler()
                {
                    public void onClick(final ClickEvent arg0)
                    {
                        if (jsniFacade.confirm("Are you sure you want to block this suggestion?"))
                        {
                            BlockedSuggestionModel.getInstance().insert(inStreamDTO.getStreamScopeId());
                            removeFromParent();
                        }
                    }
                });

                panel.add(block);
                main.add(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.