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

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


                    public void onClick(ClickEvent w) {
                        String f = b.getItemText(b.getSelectedIndex());
                        vf.getFieldValues().add(new VerifyField(f,
                                "",
                                "=="));
                        FlexTable data = render(vf);
                        outer.setWidget(1,
                                0,
                                data);
                        pop.hide();
                    }
                });
                pop.addRow(ok);
                pop.show();

            }
        });

        ab.add( add );
        outer.setWidget( 0,
                0,
                ab );
        initWidget( outer );

        FlexTable data = render( vf );
        outer.setWidget( 1,
                0,
                data );

    }
View Full Code Here


                data );

    }

    private FlexTable render(final VerifyFact vf) {
        FlexTable data = new FlexTable();
        for ( int i = 0; i < vf.getFieldValues().size(); i++ ) {
            final VerifyField fld = (VerifyField) vf.getFieldValues().get( i );
            data.setWidget( i,
                    1,
                    new SmallLabel( fld.getFieldName() + ":" ) );
            data.getFlexCellFormatter().setHorizontalAlignment( i,
                    1,
                    HasHorizontalAlignment.ALIGN_RIGHT );

            final ListBox opr = new ListBox();
            opr.addItem( TestScenarioConstants.INSTANCE.equalsScenario(),
                    "==" );
            opr.addItem( TestScenarioConstants.INSTANCE.doesNotEqualScenario(),
                    "!=" );
            if ( fld.getOperator().equals( "==" ) ) {
                opr.setSelectedIndex( 0 );
            } else {
                opr.setSelectedIndex( 1 );
            }
            opr.addChangeHandler( new ChangeHandler() {
                public void onChange(ChangeEvent event) {
                    fld.setOperator( opr.getValue( opr.getSelectedIndex() ) );
                }
            } );

            data.setWidget( i,
                    2,
                    opr );
            Widget cellEditor = new VerifyFieldConstraintEditor( type,
                    new ValueChanged() {
                        public void valueChanged(String newValue) {
                            fld.setExpected( newValue );
                        }

                    },
                    fld,
                    dmo,
                    this.scenario,
                    this.executionTrace );

            data.setWidget( i,
                    3,
                    cellEditor );

            Image del = CommonAltedImages.INSTANCE.DeleteItemSmall();
            del.setAltText(TestScenarioConstants.INSTANCE.RemoveThisFieldExpectation());
            del.setTitle(TestScenarioConstants.INSTANCE.RemoveThisFieldExpectation());
            del.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent w) {
                    if (Window.confirm(TestScenarioConstants.INSTANCE.AreYouSureYouWantToRemoveThisFieldExpectation(
                            fld.getFieldName()))) {
                        vf.getFieldValues().remove(fld);
                        FlexTable data = render(vf);
                        outer.setWidget(1,
                                0,
                                data);
                    }
                }
            });
            data.setWidget( i,
                    4,
                    del );

            if ( showResults && fld.getSuccessResult() != null ) {
                if ( !fld.getSuccessResult().booleanValue() ) {
                    data.setWidget( i,
                            0,
                            new Image( CommonImages.INSTANCE.warning() ) );
                    data.setWidget( i,
                            5,
                            new HTML( TestScenarioConstants.INSTANCE.ActualResult( fld.getActualResult() ) ) );

                    data.getCellFormatter().addStyleName( i,
                            5,
                            "testErrorValue" ); //NON-NLS

                } else {
                    data.setWidget( i,
                            0,
                            new Image( TestScenarioImages.INSTANCE.testPassed() ) );
                }
            }
View Full Code Here

                    public void onClick( ClickEvent w ) {
                        String f = b.getItemText( b.getSelectedIndex() );
                        vf.getFieldValues().add( new VerifyField( f,
                                                                  "",
                                                                  "==" ) );
                        FlexTable data = render( vf );
                        outer.setWidget( 1,
                                         0,
                                         data );
                        pop.hide();
                    }
                } );
                pop.addRow( ok );
                pop.show();

            }
        } );

        ab.add( add );
        outer.setWidget( 0,
                         0,
                         ab );
        initWidget( outer );

        FlexTable data = render( vf );
        outer.setWidget( 1,
                         0,
                         data );

    }
View Full Code Here

                         data );

    }

    private FlexTable render( final VerifyFact vf ) {
        FlexTable data = new FlexTable();
        for ( int i = 0; i < vf.getFieldValues().size(); i++ ) {
            final VerifyField fld = (VerifyField) vf.getFieldValues().get( i );
            data.setWidget( i,
                            1,
                            new SmallLabel( fld.getFieldName() + ":" ) );
            data.getFlexCellFormatter().setHorizontalAlignment( i,
                                                                1,
                                                                HasHorizontalAlignment.ALIGN_RIGHT );

            final ListBox opr = new ListBox();
            opr.addItem( TestScenarioConstants.INSTANCE.equalsScenario(),
                         "==" );
            opr.addItem( TestScenarioConstants.INSTANCE.doesNotEqualScenario(),
                         "!=" );
            if ( fld.getOperator().equals( "==" ) ) {
                opr.setSelectedIndex( 0 );
            } else {
                opr.setSelectedIndex( 1 );
            }
            opr.addChangeHandler( new ChangeHandler() {
                public void onChange( ChangeEvent event ) {
                    fld.setOperator( opr.getValue( opr.getSelectedIndex() ) );
                }
            } );

            data.setWidget( i,
                            2,
                            opr );
            Widget cellEditor = new VerifyFieldConstraintEditor( type,
                                                                 new ValueChanged() {
                                                                     public void valueChanged( String newValue ) {
                                                                         fld.setExpected( newValue );
                                                                     }

                                                                 },
                                                                 fld,
                                                                 oracle,
                                                                 this.scenario,
                                                                 this.executionTrace );

            data.setWidget( i,
                            3,
                            cellEditor );

            Image del = CommonAltedImages.INSTANCE.DeleteItemSmall();
            del.setAltText( TestScenarioConstants.INSTANCE.RemoveThisFieldExpectation() );
            del.setTitle( TestScenarioConstants.INSTANCE.RemoveThisFieldExpectation() );
            del.addClickHandler( new ClickHandler() {
                public void onClick( ClickEvent w ) {
                    if ( Window.confirm( TestScenarioConstants.INSTANCE.AreYouSureYouWantToRemoveThisFieldExpectation(
                            fld.getFieldName() ) ) ) {
                        vf.getFieldValues().remove( fld );
                        FlexTable data = render( vf );
                        outer.setWidget( 1,
                                         0,
                                         data );
                    }
                }
            } );
            data.setWidget( i,
                            4,
                            del );

            if ( showResults && fld.getSuccessResult() != null ) {
                if ( !fld.getSuccessResult().booleanValue() ) {
                    data.setWidget( i,
                                    0,
                                    new Image( CommonImages.INSTANCE.warning() ) );
                    data.setWidget( i,
                                    5,
                                    new HTML( TestScenarioConstants.INSTANCE.ActualResult( fld.getActualResult() ) ) );

                    data.getCellFormatter().addStyleName( i,
                                                          5,
                                                          "testErrorValue" ); //NON-NLS

                } else {
                    data.setWidget( i,
                                    0,
                                    new Image( TestScenarioImages.INSTANCE.testPassed() ) );
                }
            }
View Full Code Here

 
  public ModelDetailsView() {
  super(TitlePanel.QUERY_TITLE);
    contentDetailsPanel.add(createResultsPanel());
   
    detailsTable = new FlexTable();
    detailsTable.setCellSpacing(0);
    detailsTable.setWidth("100%");
    detailsTable.addStyleName("contacts-ListContainer");
    detailsTable.getColumnFormatter().addStyleName(1, "add-contact-input");
   
View Full Code Here

  private VerticalPanel createSelectPanel() {
    VerticalPanel searchPanel = new VerticalPanel();   
    searchPanel.setStyleName("pannel-Border");
    searchPanel.setWidth("100%");
   
    FlexTable selectTable = new FlexTable();
    selectTable.getColumnFormatter().setWidth(0, "150em");
    selectTable.setWidget(0, 0, new Label("Query application"));
    selectTable.setWidget(0, 1, queryAppButton);
    queryAppButton.setWidth("2cm");
   
    selectTable.setWidget(1, 0, new Label("Composite application"));
    selectTable.setWidget(1, 1, compAppButton);
    compAppButton.setWidth("2cm");
   
    selectTable.setWidget(2, 0, new Label("Annotation application"));
    selectTable.setWidget(2, 1, annotAppButton);
    annotAppButton.setWidth("2cm");
   
    searchPanel.add(selectTable);   
    return searchPanel;
  }
View Full Code Here

        if(lbl != null) {
            displayComponentPanel.remove(lbl);
        }
        markerMap.remove(markString);

        FlexTable tooltip = markerTooltipMap.get(markString);
        if(tooltip != null) {
            displayComponentPanel.remove(tooltip);
        }
        markerTooltipMap.remove(markString);
    }
View Full Code Here

        if(markerMap.get(markString) != null){
            Label lbl = markerMap.get(markString);
            lbl.setVisible(true);
            displayComponentPanel.setWidgetPosition(lbl, (int)x-lbl.getOffsetWidth()/2, (int)y-lbl.getOffsetHeight());

            FlexTable tooltip = markerTooltipMap.get(markString);
            tooltip.setVisible(true);

            int posX = (int)x-lbl.getOffsetWidth()-10;
            int posY = (int)y-tooltip.getOffsetHeight()-lbl.getOffsetHeight()-10;

            //Check if right border is reached, if so, the move the tooltip left
            if(posX+tooltip.getOffsetWidth() > displayComponentPanel.getOffsetWidth()) {
                posX -= tooltip.getOffsetWidth()-50;
            }

            displayComponentPanel.setWidgetPosition(tooltip, posX, posY);
            tooltip.setVisible(false);
        } else {
            String m[] = markString.split("_");
            Long time = Long.parseLong(m[0]);
            String caption = m[1];
            String description = m[2];

            Label lbl = new Label(caption);
            lbl.setStyleName(CLASSNAME_MARKER);
            lbl.addStyleName(CLASSNAME_MARKER+"-"+caption);

            displayComponentPanel.add(lbl);
            displayComponentPanel.setWidgetPosition(lbl, (int)x-lbl.getOffsetWidth()/2, (int)y-lbl.getOffsetHeight());

            markerMap.put(markString, lbl);

            DateTimeFormat formatter = DateTimeFormat.getFormat("MMM d, ''yy");

            FlexTable tooltip = new FlexTable();
            tooltip.setVisible(true);
            tooltip.setStyleName(CLASSNAME_MARKERTOOLTIP);
            tooltip.setBorderWidth(0);
            tooltip.setCellSpacing(0);
            tooltip.setCellPadding(0);

            tooltip.getRowFormatter().setStyleName(0, "top");
            tooltip.getCellFormatter().setStyleName(0, 0, "topLeft");
            tooltip.getCellFormatter().setStyleName(0, 1, "topMiddle");
            tooltip.getCellFormatter().setStyleName(0, 2, "topRight");

            tooltip.getRowFormatter().setStyleName(1, "middle");
            tooltip.getCellFormatter().setStyleName(1, 0, "middleLeft");
            tooltip.getCellFormatter().setStyleName(1, 1, "content");
            tooltip.getCellFormatter().setStyleName(1, 2, "middleRight");

            tooltip.getRowFormatter().setStyleName(2, "bottom");
            tooltip.getCellFormatter().setStyleName(2, 0, "bottomLeft");
            tooltip.getCellFormatter().setStyleName(2, 1, "bottomMiddle");
            tooltip.getCellFormatter().setStyleName(2, 2, "bottomRight");

            HTML content = new HTML(
                    "<span class=date>"+formatter.format(new Date(time))+"</span> <br/>"+
                    "<span class=text>"+description+"</span>"
            );

            tooltip.setWidget(1, 1, content);

            displayComponentPanel.add(tooltip);
            markerTooltipMap.put(markString, tooltip);

            int posX = (int)x-lbl.getOffsetWidth()-10;
            int posY = (int)y-tooltip.getOffsetHeight()-lbl.getOffsetHeight()-10;

            //Check if right border is reached, if so, the move the tooltip left
            if(posX+tooltip.getOffsetWidth() > displayComponentPanel.getOffsetWidth()) {
                posX -= tooltip.getOffsetWidth()-50;
            }

            displayComponentPanel.setWidgetPosition(tooltip, posX, posY);
            tooltip.setVisible(false);
        }
    }
View Full Code Here

                hideAllMarkerTooltips();

                // Over a marker
                String markerId = coordinateIsOverMarker(x, y);
                if (markerId != null) {
                    FlexTable markerTooltip = markerTooltipMap.get(markerId);
                    markerTooltip.setVisible(true);
                    return;
                }

                // Handle graph selectors
                for(int g=0; g<widget.getNumGraphs(); g++){
View Full Code Here

    setHorizontalAlignment(VerticalPanel.ALIGN_LEFT);
    setWidth("100%");
   
    add(resultsLabel);
   
    resultsTable = new FlexTable()
    resultsTable.setStylePrimaryName("resultsTable");   
    add(resultsTable);
  }
View Full Code Here

TOP

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

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.