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

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


                              fieldSelector( val ) );
            layout.setWidget( i,
                              2,
                              valueEditor( val ) );
            final int idx = i;
            Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
            remove.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
                        model.removeField( idx );
                        setModified( true );
                        getModeller().refreshWidget();

                        //Signal possible change in Template variables
                        TemplateVariablesChangedEvent tvce = new TemplateVariablesChangedEvent( getModeller().getModel() );
                        getEventBus().fireEventFromSource( tvce,
                                                           getModeller().getModel() );
                    }
                }
            } );
            if ( !this.readOnly ) {
                layout.setWidget( i,
                                  3,
                                  remove );
            }

        }

        if ( model.getFieldValues().length == 0 ) {
            HorizontalPanel h = new HorizontalPanel();
            h.add( getSetterLabel() );
            if ( !this.readOnly ) {
                Image image = GuidedRuleEditorImages508.INSTANCE.Edit();
                image.setAltText( Constants.INSTANCE.AddFirstNewField() );
                image.setTitle( Constants.INSTANCE.AddFirstNewField() );
                image.addClickHandler( new ClickHandler() {

                    public void onClick( ClickEvent sender ) {
                        showAddFieldPopup( sender );
                    }
                } );
View Full Code Here


     */
    public void initWidget() {
        layout.removeAllRows();
        currentLayoutRow = 0;

        Image addPattern = GuidedRuleEditorImages508.INSTANCE.NewItem();
        addPattern.setTitle( Constants.INSTANCE.AddAConditionToThisRule() );
        addPattern.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                showConditionSelector( null );
            }
        } );

        layout.getColumnFormatter().setWidth( 0,
                                              "20px" );
        layout.getColumnFormatter().setWidth( 1,
                                              "20px" );
        layout.getColumnFormatter().setWidth( 2,
                                              "48px" );
        layout.getColumnFormatter().setWidth( 4,
                                              "64px" );

        if ( this.showLHS() ) {
            layout.setWidget( currentLayoutRow,
                              0,
                              new SmallLabel( "<b>" + Constants.INSTANCE.WHEN() + "</b>" ) );
            layout.getFlexCellFormatter().setColSpan( currentLayoutRow,
                                                      0,
                                                      4 );

            if ( !lockLHS() ) {
                layout.setWidget( currentLayoutRow,
                                  1,
                                  addPattern );
            }
            currentLayoutRow++;

            renderLhs( this.model );
        }

        if ( this.showRHS() ) {
            layout.setWidget( currentLayoutRow,
                              0,
                              new SmallLabel( "<b>" + Constants.INSTANCE.THEN() + "</b>" ) );
            layout.getFlexCellFormatter().setColSpan( currentLayoutRow,
                                                      0,
                                                      4 );

            Image addAction = GuidedRuleEditorImages508.INSTANCE.NewItem();
            addAction.setTitle( Constants.INSTANCE.AddAnActionToThisRule() );
            addAction.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    showActionSelector( (Widget) event.getSource(),
                                        null );
                }
View Full Code Here

        initWidget();
        makeDirty();
    }

    private Widget getAddAttribute() {
        Image add = GuidedRuleEditorImages508.INSTANCE.NewItem();
        add.setTitle( Constants.INSTANCE.AddAnOptionToTheRuleToModifyItsBehaviorWhenEvaluatedOrExecuted() );

        add.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                showAttributeSelector();
            }
        } );
View Full Code Here

            layout.getFlexCellFormatter().setWidth( currentLayoutRow,
                                                    3,
                                                    "100%" );

            if ( !w.isFactTypeKnown() ) {
                final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
                image.setTitle( Constants.INSTANCE.InvalidPatternSectionDisabled() );
                this.addLineIcon( currentLayoutRow,
                                  0,
                                  image );
            }
View Full Code Here

            layout.getFlexCellFormatter().setWidth( currentLayoutRow,
                                                    3,
                                                    "100%" );

            if ( !w.isFactTypeKnown() ) {
                final Image image = GuidedRuleEditorImages508.INSTANCE.Error();
                image.setTitle( Constants.INSTANCE.InvalidPatternSectionDisabled() );
                this.addLineIcon( currentLayoutRow,
                                  0,
                                  image );
            }
View Full Code Here

     */
    private Widget wrapLHSWidget( final RuleModel model,
                                  int i,
                                  RuleModellerWidget w ) {
        final DirtyableFlexTable wrapper = new DirtyableFlexTable();
        final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
        remove.setTitle( Constants.INSTANCE.RemoveThisENTIREConditionAndAllTheFieldConstraintsThatBelongToIt() );
        final int idx = i;
        remove.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                if ( Window.confirm( Constants.INSTANCE.RemoveThisEntireConditionQ() ) ) {
                    if ( model.removeLhsItem( idx ) ) {
                        refreshWidget();
View Full Code Here

     */
    private Widget wrapRHSWidget( final RuleModel model,
                                  int i,
                                  RuleModellerWidget w ) {
        final DirtyableFlexTable wrapper = new DirtyableFlexTable();
        final Image remove = GuidedRuleEditorImages508.INSTANCE.DeleteItemSmall();
        remove.setTitle( Constants.INSTANCE.RemoveThisAction() );
        final int idx = i;
        remove.addClickHandler( new ClickHandler() {

            public void onClick( ClickEvent event ) {
                if ( Window.confirm( Constants.INSTANCE.RemoveThisItem() ) ) {
                    model.removeRhsItem( idx );
                    refreshWidget();
View Full Code Here

                                            ClickHandler moveDownListener,
                                            ClickHandler moveUpListener ) {

        final DirtyableHorizontalPane hp = new DirtyableHorizontalPane();

        Image addPattern = CommonAltedImages.INSTANCE.NewItemBelow();
        addPattern.setTitle( title );
        addPattern.addClickHandler( addBelowListener );

        Image moveDown = CommonAltedImages.INSTANCE.MoveDown();
        moveDown.setTitle( Constants.INSTANCE.MoveDown() );
        moveDown.addClickHandler( moveDownListener );

        Image moveUp = CommonAltedImages.INSTANCE.MoveUp();
        moveUp.setTitle( Constants.INSTANCE.MoveUp() );
        moveUp.addClickHandler( moveUpListener );

        hp.add( addPattern );
        hp.add( moveDown );
        hp.add( moveUp );
View Full Code Here

        return textArea;
    }

    private Widget createEditIcon() {

        Image btn;
        if ( !this.readOnly ) {
            btn = GuidedRuleEditorImages508.INSTANCE.Edit();
            btn.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    final FreeFormLinePopup popup = new FreeFormLinePopup( Constants.INSTANCE.FreeFormDrl(),
                                                                           action.getText() );
                    popup.addOKClickHandler( new ClickHandler() {

                        public void onClick( ClickEvent event ) {
                            action.setText( popup.getText() );
                            textArea.setText( action.getText() );
                            setModified( true );
                            popup.hide();
                        }

                    } );
                    popup.show();
                }

            } );
        } else {
            btn = new Image( GuidedRuleEditorResources.INSTANCE.images().editDisabled() );
        }

        return btn;
    }
View Full Code Here

    private Widget getSetterLabel() {
        HorizontalPanel horiz = new HorizontalPanel();

        if ( model.getState() == ActionCallMethod.TYPE_UNDEFINED ) {
            Image edit = GuidedRuleEditorImages508.INSTANCE.AddFieldToFact();
            edit.setAltText( Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue() );
            edit.setTitle( Constants.INSTANCE.AddAnotherFieldToThisSoYouCanSetItsValue() );
            edit.addClickHandler( new ClickHandler() {

                public void onClick( ClickEvent event ) {
                    Widget w = (Widget) event.getSource();
                    showAddFieldPopup( w );
View Full Code Here

TOP

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

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.