Package org.uberfire.client.common

Examples of org.uberfire.client.common.ImageButton


    private Widget editCondition( final Pattern52 origPattern,
                                  final ConditionCol52 origCol ) {
        Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
        edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration() );
        return new ImageButton( edit,
                                GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        ConditionPopup dialog = new ConditionPopup( model,
                                                                                    oracle,
View Full Code Here


    private Widget editCondition( final BRLConditionColumn origCol ) {
        Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
        edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration() );
        if ( origCol instanceof LimitedEntryBRLConditionColumn ) {
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            LimitedEntryBRLConditionColumnViewImpl popup = new LimitedEntryBRLConditionColumnViewImpl( path,
                                                                                                                                       model,
                                                                                                                                       oracle,
                                                                                                                                       ruleNameService,
                                                                                                                                       (LimitedEntryBRLConditionColumn) origCol,
                                                                                                                                       eventBus,
                                                                                                                                       false,
                                                                                                                                       isReadOnly );
                                            popup.setPresenter( LIMITED_ENTRY_BRL_CONDITION_PRESENTER );
                                            popup.show();
                                        }
                                    } );
        }
        return new ImageButton( edit,
                                GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        BRLConditionColumnViewImpl popup = new BRLConditionColumnViewImpl( path,
                                                                                                           model,
View Full Code Here

    private Widget removeCondition( final ConditionCol52 c ) {
        Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
        image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn() );
        if ( c instanceof LimitedEntryBRLConditionColumn ) {
            return new ImageButton( image,
                                    GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            if ( !canConditionBeDeleted( (LimitedEntryBRLConditionColumn) c ) ) {
                                                Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );
                                                return;
                                            }
                                            String cm = GuidedDecisionTableConstants.INSTANCE.DeleteConditionColumnWarning0( c.getHeader() );
                                            if ( Window.confirm( cm ) ) {
                                                dtable.deleteColumn( (LimitedEntryBRLConditionColumn) c );
                                                refreshConditionsWidget();
                                            }
                                        }
                                    } );

        } else if ( c instanceof BRLConditionColumn ) {
            return new ImageButton( image,
                                    GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            if ( !canConditionBeDeleted( (BRLConditionColumn) c ) ) {
                                                Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );
                                                return;
                                            }
                                            String cm = GuidedDecisionTableConstants.INSTANCE.DeleteConditionColumnWarning0( c.getHeader() );
                                            if ( Window.confirm( cm ) ) {
                                                dtable.deleteColumn( (BRLConditionColumn) c );
                                                refreshConditionsWidget();
                                            }
                                        }
                                    } );

        }
        return new ImageButton( image,
                                GuidedDecisionTableConstants.INSTANCE.RemoveThisConditionColumn(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        if ( !canConditionBeDeleted( c ) ) {
                                            Window.alert( GuidedDecisionTableConstants.INSTANCE.UnableToDeleteConditionColumn0( c.getHeader() ) );
View Full Code Here

    private Widget removeAttr( final AttributeCol52 at ) {
        Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
        image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisAttribute() );

        return new ImageButton( image,
                                GuidedDecisionTableConstants.INSTANCE.RemoveThisAttribute(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        String ms = GuidedDecisionTableConstants.INSTANCE.DeleteActionColumnWarning( at.getAttribute() );
                                        if ( Window.confirm( ms ) ) {
View Full Code Here

    private Widget removeMeta( final MetadataCol52 md ) {
        Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
        image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisMetadata() );

        return new ImageButton( image,
                                GuidedDecisionTableConstants.INSTANCE.RemoveThisMetadata(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        String ms = GuidedDecisionTableConstants.INSTANCE.DeleteActionColumnWarning( md.getMetadata() );
                                        if ( Window.confirm( ms ) ) {
View Full Code Here

        HorizontalPanel pattern = new HorizontalPanel();
        pattern.add( patternLabel );
        doPatternLabel();

        //Pattern selector
        ImageButton changePattern = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
                                                     GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
                                                     GuidedDecisionTableConstants.INSTANCE.ChooseAnExistingPatternThatThisColumnAddsTo(),
                                                     new ClickHandler() {
                                                         public void onClick( ClickEvent w ) {
                                                             showChangePattern( w );
                                                         }
                                                     } );
        changePattern.setEnabled( !isReadOnly );
        pattern.add( changePattern );

        addAttribute( GuidedDecisionTableConstants.INSTANCE.Pattern(),
                      pattern );

        //Radio buttons for Calculation Type
        switch ( model.getTableFormat() ) {
            case EXTENDED_ENTRY:
                HorizontalPanel valueTypes = new HorizontalPanel();
                valueTypes.add( literal );
                valueTypes.add( formula );
                valueTypes.add( predicate );
                addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.CalculationType()).append(GuidedDecisionTableConstants.COLON).toString(),
                              valueTypes );

                switch ( editingCol.getConstraintValueType() ) {
                    case BaseSingleFieldConstraint.TYPE_LITERAL:
                        literal.setValue( true );
                        break;
                    case BaseSingleFieldConstraint.TYPE_RET_VALUE:
                        formula.setValue( true );
                        break;
                    case BaseSingleFieldConstraint.TYPE_PREDICATE:
                        predicate.setValue( true );
                }

                if ( !isReadOnly ) {
                    literal.addClickHandler( new ClickHandler() {
                        public void onClick( ClickEvent w ) {
                            editingCol.setFactField( null );
                            applyConsTypeChange( BaseSingleFieldConstraint.TYPE_LITERAL );
                        }
                    } );
                }

                if ( !isReadOnly ) {
                    formula.addClickHandler( new ClickHandler() {
                        public void onClick( ClickEvent w ) {
                            editingCol.setFactField( null );
                            applyConsTypeChange( BaseSingleFieldConstraint.TYPE_RET_VALUE );
                        }
                    } );
                }

                if ( !isReadOnly ) {
                    predicate.addClickHandler( new ClickHandler() {
                        public void onClick( ClickEvent w ) {
                            editingCol.setFactField( null );
                            applyConsTypeChange( BaseSingleFieldConstraint.TYPE_PREDICATE );
                        }
                    } );
                }

                break;

            case LIMITED_ENTRY:
                binding.setEnabled( !isReadOnly );
        }

        //Fact field
        HorizontalPanel field = new HorizontalPanel();
        fieldLabel.setEnabled( !isReadOnly );
        field.add( fieldLabel );
        field.add( fieldLabelInterpolationInfo );
        this.editField = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
                                          GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
                                          GuidedDecisionTableConstants.INSTANCE.EditTheFieldThatThisColumnOperatesOn(),
                                          new ClickHandler() {
                                              public void onClick( ClickEvent w ) {
                                                  showFieldChange();
                                              }
                                          } );
        editField.setEnabled( !isReadOnly );
        field.add( editField );
        addAttribute( new StringBuilder(GuidedDecisionTableConstants.INSTANCE.Field()).append(GuidedDecisionTableConstants.COLON).toString(),
                      field );
        doFieldLabel();

        //Operator
        HorizontalPanel operator = new HorizontalPanel();
        operator.add( operatorLabel );
        this.editOp = new ImageButton( GuidedDecisionTableImageResources508.INSTANCE.Edit(),
                                       GuidedDecisionTableImageResources508.INSTANCE.EditDisabled(),
                                       GuidedDecisionTableConstants.INSTANCE.EditTheOperatorThatIsUsedToCompareDataWithThisField(),
                                       new ClickHandler() {
                                           public void onClick( ClickEvent w ) {
                                               showOperatorChange();
View Full Code Here

        //Initialise drop-down data
        getDropDownData();

        //Show an editor for the constraint value type
        if ( constraint.getConstraintValueType() == SingleFieldConstraint.TYPE_UNDEFINED ) {
            ImageButton clickme = new ImageButton( GuidedRuleEditorImages508.INSTANCE.Edit(),
                                                   GuidedRuleEditorImages508.INSTANCE.EditDisabled(),
                                                   Constants.INSTANCE.Edit(),
                                                   new ClickHandler() {
                                                       public void onClick( ClickEvent event ) {
                                                           showTypeChoice( (Widget) event.getSource(),
                                                                           constraint );
                                                       }
                                                   } );
            clickme.setEnabled( !this.readOnly );
            constraintWidget = clickme;

        } else {
            switch ( constraint.getConstraintValueType() ) {
                case SingleFieldConstraint.TYPE_LITERAL:
View Full Code Here

        if ( c instanceof ActionWorkItemSetFieldCol52 ) {
            final ActionWorkItemSetFieldCol52 awisf = (ActionWorkItemSetFieldCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionWorkItemSetFieldPopup ed = new ActionWorkItemSetFieldPopup( model,
                                                                                                              oracle,
                                                                                                              new GenericColumnCommand() {
                                                                                                                  public void execute( DTColumnConfig52 column ) {
                                                                                                                      dtable.updateColumn( awisf,
                                                                                                                                           (ActionWorkItemSetFieldCol52) column );
                                                                                                                      refreshActionsWidget();
                                                                                                                  }
                                                                                                              },
                                                                                                              awisf,
                                                                                                              false,
                                                                                                              isReadOnly );
                                            ed.show();
                                        }
                                    } );

        } else if ( c instanceof ActionSetFieldCol52 ) {
            final ActionSetFieldCol52 asf = (ActionSetFieldCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionSetFieldPopup ed = new ActionSetFieldPopup( model,
                                                                                              oracle,
                                                                                              new GenericColumnCommand() {
                                                                                                  public void execute( DTColumnConfig52 column ) {
                                                                                                      dtable.updateColumn( asf,
                                                                                                                           (ActionSetFieldCol52) column );
                                                                                                      refreshActionsWidget();
                                                                                                  }
                                                                                              },
                                                                                              asf,
                                                                                              false,
                                                                                              isReadOnly );
                                            ed.show();
                                        }
                                    } );

        } else if ( c instanceof ActionWorkItemInsertFactCol52 ) {
            final ActionWorkItemInsertFactCol52 awiif = (ActionWorkItemInsertFactCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionWorkItemInsertFactPopup ed = new ActionWorkItemInsertFactPopup( model,
                                                                                                                  oracle,
                                                                                                                  new GenericColumnCommand() {
                                                                                                                      public void execute( DTColumnConfig52 column ) {
                                                                                                                          dtable.updateColumn( awiif,
                                                                                                                                               (ActionWorkItemInsertFactCol52) column );
                                                                                                                          refreshActionsWidget();
                                                                                                                      }
                                                                                                                  },
                                                                                                                  awiif,
                                                                                                                  false,
                                                                                                                  isReadOnly );
                                            ed.show();
                                        }
                                    } );

        } else if ( c instanceof ActionInsertFactCol52 ) {
            final ActionInsertFactCol52 asf = (ActionInsertFactCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionInsertFactPopup ed = new ActionInsertFactPopup( model,
                                                                                                  oracle,
                                                                                                  new GenericColumnCommand() {
                                                                                                      public void execute( DTColumnConfig52 column ) {
                                                                                                          dtable.updateColumn( asf,
                                                                                                                               (ActionInsertFactCol52) column );
                                                                                                          refreshActionsWidget();
                                                                                                      }
                                                                                                  },
                                                                                                  asf,
                                                                                                  false,
                                                                                                  isReadOnly );
                                            ed.show();
                                        }
                                    } );

        } else if ( c instanceof ActionRetractFactCol52 ) {
            final ActionRetractFactCol52 arf = (ActionRetractFactCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionRetractFactPopup ed = new ActionRetractFactPopup( model,
                                                                                                    new GenericColumnCommand() {
                                                                                                        public void execute( DTColumnConfig52 column ) {
                                                                                                            dtable.updateColumn( arf,
                                                                                                                                 (ActionRetractFactCol52) column );
                                                                                                            refreshActionsWidget();
                                                                                                        }
                                                                                                    },
                                                                                                    arf,
                                                                                                    false,
                                                                                                    isReadOnly );
                                            ed.show();
                                        }
                                    } );

        } else if ( c instanceof ActionWorkItemCol52 ) {
            final ActionWorkItemCol52 awi = (ActionWorkItemCol52) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            ActionWorkItemPopup popup = new ActionWorkItemPopup( path,
                                                                                                 model,
                                                                                                 GuidedDecisionTableWidget.this,
                                                                                                 new GenericColumnCommand() {
                                                                                                     public void execute( DTColumnConfig52 column ) {
                                                                                                         dtable.updateColumn( awi,
                                                                                                                              (ActionWorkItemCol52) column );
                                                                                                         refreshActionsWidget();
                                                                                                     }
                                                                                                 },
                                                                                                 awi,
                                                                                                 workItemDefinitions,
                                                                                                 false,
                                                                                                 isReadOnly );
                                            popup.show();
                                        }
                                    } );

        } else if ( c instanceof LimitedEntryBRLActionColumn ) {
            final LimitedEntryBRLActionColumn column = (LimitedEntryBRLActionColumn) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            LimitedEntryBRLActionColumnViewImpl popup = new LimitedEntryBRLActionColumnViewImpl( path,
                                                                                                                                 model,
                                                                                                                                 oracle,
                                                                                                                                 ruleNameService,
                                                                                                                                 column,
                                                                                                                                 eventBus,
                                                                                                                                 false,
                                                                                                                                 isReadOnly );
                                            popup.setPresenter( LIMITED_ENTRY_BRL_ACTION_PRESENTER );
                                            popup.show();
                                        }
                                    } );

        } else if ( c instanceof BRLActionColumn ) {
            final BRLActionColumn column = (BRLActionColumn) c;
            Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
            edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration() );
            return new ImageButton( edit,
                                    GuidedDecisionTableConstants.INSTANCE.EditThisActionColumnConfiguration(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            BRLActionColumnViewImpl popup = new BRLActionColumnViewImpl( path,
                                                                                                         model,
View Full Code Here

    private Widget removeAction( final ActionCol52 c ) {
        if ( c instanceof LimitedEntryBRLActionColumn ) {
            Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
            image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn() );
            return new ImageButton( image,
                                    GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            String cm = GuidedDecisionTableConstants.INSTANCE.DeleteActionColumnWarning( c.getHeader() );
                                            if ( Window.confirm( cm ) ) {
                                                dtable.deleteColumn( (LimitedEntryBRLActionColumn) c );
                                                refreshActionsWidget();
                                            }
                                        }
                                    } );

        } else if ( c instanceof BRLActionColumn ) {
            Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
            image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn() );
            return new ImageButton( image,
                                    GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn(),
                                    new ClickHandler() {
                                        public void onClick( ClickEvent w ) {
                                            String cm = GuidedDecisionTableConstants.INSTANCE.DeleteActionColumnWarning( c.getHeader() );
                                            if ( Window.confirm( cm ) ) {
                                                dtable.deleteColumn( (BRLActionColumn) c );
                                                refreshActionsWidget();
                                            }
                                        }
                                    } );

        }
        Image image = GuidedDecisionTableImageResources508.INSTANCE.DeleteItemSmall();
        image.setAltText( GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn() );
        return new ImageButton( image,
                                GuidedDecisionTableConstants.INSTANCE.RemoveThisActionColumn(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        String cm = GuidedDecisionTableConstants.INSTANCE.DeleteActionColumnWarning( c.getHeader() );
                                        if ( Window.confirm( cm ) ) {
View Full Code Here

    private Widget editCondition( final Pattern52 origPattern,
                                  final ConditionCol52 origCol ) {
        Image edit = GuidedDecisionTableImageResources508.INSTANCE.Edit();
        edit.setAltText( GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration() );
        return new ImageButton( edit,
                                GuidedDecisionTableConstants.INSTANCE.EditThisColumnsConfiguration(),
                                new ClickHandler() {
                                    public void onClick( ClickEvent w ) {
                                        ConditionPopup dialog = new ConditionPopup( model,
                                                                                    oracle,
View Full Code Here

TOP

Related Classes of org.uberfire.client.common.ImageButton

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.