Examples of DecoratedDisclosurePanel


Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        layout.add( advancedDisclosure );
    }

    private void doTextSearch() {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( constants.TextSearch() );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setOpen( true );

        VerticalPanel container = new VerticalPanel();
        VerticalPanel criteria = new VerticalPanel();

        FormStyleLayout ts = new FormStyleLayout();
        final TextBox tx = new TextBox();
        ts.addAttribute( constants.SearchFor(),
                         tx );

        final CheckBox archiveBox = new CheckBox();
        archiveBox.setValue( false );
        ts.addAttribute( constants.IncludeArchivedAssetsInResults(),
                         archiveBox );

        Button go = new Button();
        go.setText( constants.Search1() );
        ts.addAttribute( "",
                         go );
        ts.setWidth( "100%" );

        final SimplePanel resultsP = new SimplePanel();
        final ClickHandler cl = new ClickHandler() {

            public void onClick(ClickEvent arg0) {
                if ( tx.getText().equals( "" ) ) {
                    Window.alert( constants.PleaseEnterSomeSearchText() );
                    return;
                }
                resultsP.clear();
                QueryPagedTable table = new QueryPagedTable(
                                                             tx.getText(),
                                                             archiveBox.getValue(),
                                                             clientFactory );
                resultsP.add( table );
            }

        };

        go.addClickHandler( cl );
        tx.addKeyPressHandler( new KeyPressHandler() {
            public void onKeyPress(KeyPressEvent event) {
                if ( event.getCharCode() == KeyCodes.KEY_ENTER ) {
                    cl.onClick( null );
                }
            }
        } );

        criteria.add( ts );
        container.add( criteria );
        container.add( resultsP );
        advancedDisclosure.setContent( container );
        layout.add( advancedDisclosure );
    }
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        advancedDisclosure.setContent( container );
        layout.add( advancedDisclosure );
    }

    private void doMetaSearch() {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( constants.AttributeSearch() );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setOpen( true );

        VerticalPanel container = new VerticalPanel();
        VerticalPanel criteria = new VerticalPanel();

        final Map<String, MetaDataQuery> atts = new HashMap<String, MetaDataQuery>() {
            private static final long serialVersionUID = 510l;

            {
                put( constants.CreatedBy(),
                        new MetaDataQuery( "drools:creator" ) ); // NON-NLS
                put( constants.Format1(),
                        new MetaDataQuery( "drools:format" ) ); // NON-NLS
                put( constants.Subject(),
                        new MetaDataQuery( "drools:subject" ) ); // NON-NLS
                put( constants.Type1(),
                        new MetaDataQuery( "drools:type" ) ); // NON-NLS
                put( constants.ExternalLink(),
                        new MetaDataQuery( "drools:relation" ) ); // NON-NLS
                put( constants.Source(),
                        new MetaDataQuery( "drools:source" ) ); // NON-NLS
                put( constants.Description1(),
                        new MetaDataQuery( "drools:description" ) ); // NON-NLS
                put( constants.LastModifiedBy(),
                        new MetaDataQuery( "drools:lastContributor" ) ); // NON-NLS
                put( constants.CheckinComment(),
                        new MetaDataQuery( "drools:checkinComment" ) ); // NON-NLS
            }
        };

        FormStyleLayout fm = new FormStyleLayout();
        for ( String fieldName : atts.keySet() ) {
            final MetaDataQuery q = atts.get( fieldName );
            final TextBox box = new TextBox();
            box.setTitle( constants.WildCardsSearchTip() );
            fm.addAttribute( fieldName
                                     + ":",
                             box );
            box.addChangeHandler( new ChangeHandler() {
                public void onChange(ChangeEvent arg0) {
                    q.valueList = box.getText();
                }
            } );
        }

        HorizontalPanel created = new HorizontalPanel();
        created.add( new SmallLabel( constants.AfterColon() ) );
        final DatePickerTextBox createdAfter = new DatePickerTextBox( "" );
        created.add( createdAfter );

        created.add( new SmallLabel( "&nbsp;" ) ); // NON-NLS

        created.add( new SmallLabel( constants.BeforeColon() ) );
        final DatePickerTextBox createdBefore = new DatePickerTextBox( "" );
        created.add( createdBefore );

        fm.addAttribute( constants.DateCreated1(),
                         created );

        HorizontalPanel lastMod = new HorizontalPanel();
        lastMod.add( new SmallLabel( constants.AfterColon() ) );
        final DatePickerTextBox lastModAfter = new DatePickerTextBox( "" );
        lastMod.add( lastModAfter );

        lastMod.add( new SmallLabel( "&nbsp;" ) ); // NON-NLS

        lastMod.add( new SmallLabel( constants.BeforeColon() ) );
        final DatePickerTextBox lastModBefore = new DatePickerTextBox( "" );
        lastMod.add( lastModBefore );

        fm.addAttribute( constants.LastModified1(),
                         lastMod );

        final SimplePanel resultsP = new SimplePanel();
        Button search = new Button( constants.Search() );
        fm.addAttribute( "",
                         search );
        search.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent arg0) {
                resultsP.clear();
                try {
                    List<MetaDataQuery> metadata = new ArrayList<MetaDataQuery>();
                    metadata.addAll( atts.values() );
                    QueryPagedTable table = new QueryPagedTable( metadata,
                                                                 getDate( createdAfter ),
                                                                 getDate( createdBefore ),
                                                                 getDate( lastModAfter ),
                                                                 getDate( lastModBefore ),
                                                                 false,
                                                                 clientFactory );
                    resultsP.add( table );
                } catch ( IllegalArgumentException e ) {
                    ErrorPopup.showMessage( constants.BadDateFormatPleaseTryAgainTryTheFormatOf0(
                            ApplicationPreferences.getDroolsDateFormat() ) );
                }
            }

            private Date getDate(final DatePickerTextBox datePicker) {
                try {
                    return datePicker.getDate();
                } catch ( IllegalArgumentException e ) {
                    datePicker.clear();
                    throw e;
                }
            }
        } );

        criteria.add( fm );
        container.add( criteria );
        container.add( resultsP );
        advancedDisclosure.setContent( container );

        layout.add( advancedDisclosure );
    }
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        configureColumnsNote.addRow( new HTML( AbstractImagePrototype.create( DroolsGuvnorImageResources.INSTANCE.information() ).getHTML()
                                               + "&nbsp;"
                                               + Constants.INSTANCE.ConfigureColumnsNote() ) );
        configureColumnsNote.endSection();

        DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel( Constants.INSTANCE.DecisionTable() );
        disclosurePanel.setWidth( "100%" );
        disclosurePanel.setTitle( Constants.INSTANCE.DecisionTable() );

        VerticalPanel config = new VerticalPanel();
        config.setWidth( "100%" );
        disclosurePanel.add( config );

        //Can't add new columns if the asset is read-only
        if ( !isReadOnly ) {
            config.add( newColumn() );
        }

        DecoratedDisclosurePanel conditions = new DecoratedDisclosurePanel( Constants.INSTANCE.ConditionColumns() );
        conditions.setOpen( false );
        conditions.setWidth( "75%" );
        conditions.add( getConditions() );
        config.add( conditions );

        DecoratedDisclosurePanel actions = new DecoratedDisclosurePanel( Constants.INSTANCE.ActionColumns() );
        actions.setOpen( false );
        actions.setWidth( "75%" );
        actions.add( getActions() );
        config.add( actions );

        DecoratedDisclosurePanel options = new DecoratedDisclosurePanel( Constants.INSTANCE.Options() );
        options.setOpen( false );
        options.setWidth( "75%" );
        options.add( getAttributes() );
        config.add( options );

        layout.add( disclosurePanel );
        layout.add( configureColumnsNote );
        layout.add( dtableContainer );
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        configureColumnsNote.addRow( new HTML( AbstractImagePrototype.create( DroolsGuvnorImages.INSTANCE.information() ).getHTML()
                                               + "&nbsp;"
                                               + Constants.INSTANCE.ConfigureColumnsNote() ) );
        configureColumnsNote.endSection();

        DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel( Constants.INSTANCE.DecisionTable() );
        disclosurePanel.setWidth( "100%" );
        disclosurePanel.setTitle( Constants.INSTANCE.DecisionTable() );

        VerticalPanel config = new VerticalPanel();
        config.setWidth( "100%" );
        disclosurePanel.add( config );

        //Can't add new columns if the asset is read-only
        if ( !isReadOnly ) {
            config.add( newColumn() );
        }

        DecoratedDisclosurePanel conditions = new DecoratedDisclosurePanel( Constants.INSTANCE.ConditionColumns() );
        conditions.setOpen( false );
        conditions.setWidth( "75%" );
        conditions.add( getConditions() );
        config.add( conditions );

        DecoratedDisclosurePanel actions = new DecoratedDisclosurePanel( Constants.INSTANCE.ActionColumns() );
        actions.setOpen( false );
        actions.setWidth( "75%" );
        actions.add( getActions() );
        config.add( actions );

        DecoratedDisclosurePanel options = new DecoratedDisclosurePanel( Constants.INSTANCE.Options() );
        options.setOpen( false );
        options.setWidth( "75%" );
        options.add( getAttributes() );
        config.add( options );

        layout.add( disclosurePanel );
        layout.add( configureColumnsNote );
        layout.add( dtable );
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        configureColumnsNote.addRow( new HTML( AbstractImagePrototype.create( DroolsGuvnorImageResources.INSTANCE.information() ).getHTML()
                                               + "&nbsp;"
                                               + Constants.INSTANCE.ConfigureColumnsNote() ) );
        configureColumnsNote.endSection();

        DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel( Constants.INSTANCE.DecisionTable() );
        disclosurePanel.setWidth( "100%" );
        disclosurePanel.setTitle( Constants.INSTANCE.DecisionTable() );

        VerticalPanel config = new VerticalPanel();
        config.setWidth( "100%" );
        disclosurePanel.add( config );

        //Can't add new columns if the asset is read-only
        if ( !isReadOnly ) {
            config.add( newColumn() );
        }

        DecoratedDisclosurePanel conditions = new DecoratedDisclosurePanel( Constants.INSTANCE.ConditionColumns() );
        conditions.setOpen( false );
        conditions.setWidth( "75%" );
        conditions.add( getConditions() );
        config.add( conditions );

        DecoratedDisclosurePanel actions = new DecoratedDisclosurePanel( Constants.INSTANCE.ActionColumns() );
        actions.setOpen( false );
        actions.setWidth( "75%" );
        actions.add( getActions() );
        config.add( actions );

        DecoratedDisclosurePanel options = new DecoratedDisclosurePanel( Constants.INSTANCE.Options() );
        options.setOpen( false );
        options.setWidth( "75%" );
        options.add( getAttributes() );
        config.add( options );

        layout.add( disclosurePanel );
        layout.add( configureColumnsNote );
        layout.add( dtableContainer );
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

            this.clientFactory = clientFactory;
            this.globalEventBus = globalEventBus;
            layout = new VerticalPanel();
            ScorecardModel scorecardModel = (ScorecardModel) asset.getContent();

            DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel("Scorecard " + " ( " + asset.getName() + " )");
            disclosurePanel.setWidth("100%");
            disclosurePanel.setTitle(Constants.INSTANCE.Scorecard());
            disclosurePanel.setOpen(true);

            DecoratedDisclosurePanel configPanel = new DecoratedDisclosurePanel("Setup Parameters");
            configPanel.setWidth("95%");
            configPanel.setOpen(true);
            configPanel.add(getScorecardProperties());
            VerticalPanel config = new VerticalPanel();

            DecoratedDisclosurePanel characteristicsPanel = new DecoratedDisclosurePanel("Characteristics");
            characteristicsPanel.setOpen(scorecardModel.getCharacteristics().size() > 0);
            characteristicsPanel.setWidth("95%");
            characteristicsPanel.add(getCharacteristics());

            config.setWidth("100%");
            config.add(configPanel);
            config.add(characteristicsPanel);
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        initWidget( layout );
        setWidth( "100%" );
    }

    private void doQuickFind() {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( constants.NameSearch() );
        advancedDisclosure.ensureDebugId( "cwDisclosurePanel" );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setContent( new QuickFindWidget( clientFactory ) );
        advancedDisclosure.setOpen( true );

        layout.add( advancedDisclosure );
    }
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        layout.add( advancedDisclosure );
    }

    private void doTextSearch() {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( constants.TextSearch() );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setOpen( true );

        VerticalPanel container = new VerticalPanel();
        VerticalPanel criteria = new VerticalPanel();

        FormStyleLayout ts = new FormStyleLayout();
        final TextBox tx = new TextBox();
        ts.addAttribute( constants.SearchFor(),
                         tx );

        final CheckBox archiveBox = new CheckBox();
        archiveBox.setValue( false );
        ts.addAttribute( constants.IncludeArchivedAssetsInResults(),
                         archiveBox );

        Button go = new Button();
        go.setText( constants.Search1() );
        ts.addAttribute( "",
                         go );
        ts.setWidth( "100%" );

        final SimplePanel resultsP = new SimplePanel();
        final ClickHandler cl = new ClickHandler() {

            public void onClick(ClickEvent arg0) {
                if ( tx.getText().equals( "" ) ) {
                    Window.alert( constants.PleaseEnterSomeSearchText() );
                    return;
                }
                resultsP.clear();
                QueryPagedTable table = new QueryPagedTable(
                                                             tx.getText(),
                                                             archiveBox.getValue(),
                                                             clientFactory );
                resultsP.add( table );
            }

        };

        go.addClickHandler( cl );
        tx.addKeyPressHandler( new KeyPressHandler() {
            public void onKeyPress(KeyPressEvent event) {
                if ( event.getCharCode() == KeyCodes.KEY_ENTER ) {
                    cl.onClick( null );
                }
            }
        } );

        criteria.add( ts );
        container.add( criteria );
        container.add( resultsP );
        advancedDisclosure.setContent( container );
        layout.add( advancedDisclosure );
    }
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        advancedDisclosure.setContent( container );
        layout.add( advancedDisclosure );
    }

    private void doMetaSearch() {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( constants.AttributeSearch() );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setOpen( true );

        VerticalPanel container = new VerticalPanel();
        VerticalPanel criteria = new VerticalPanel();

        final Map<String, MetaDataQuery> atts = new HashMap<String, MetaDataQuery>() {
            private static final long serialVersionUID = 510l;

            {
                put( constants.CreatedBy(),
                        new MetaDataQuery( "drools:creator" ) ); // NON-NLS
                put( constants.Format1(),
                        new MetaDataQuery( "drools:format" ) ); // NON-NLS
                put( constants.Subject(),
                        new MetaDataQuery( "drools:subject" ) ); // NON-NLS
                put( constants.Type1(),
                        new MetaDataQuery( "drools:type" ) ); // NON-NLS
                put( constants.ExternalLink(),
                        new MetaDataQuery( "drools:relation" ) ); // NON-NLS
                put( constants.Source(),
                        new MetaDataQuery( "drools:source" ) ); // NON-NLS
                put( constants.Description1(),
                        new MetaDataQuery( "drools:description" ) ); // NON-NLS
                put( constants.LastModifiedBy(),
                        new MetaDataQuery( "drools:lastContributor" ) ); // NON-NLS
                put( constants.CheckinComment(),
                        new MetaDataQuery( "drools:checkinComment" ) ); // NON-NLS
            }
        };

        FormStyleLayout fm = new FormStyleLayout();
        for ( Iterator<String> iterator = atts.keySet().iterator(); iterator.hasNext(); ) {
            String fieldName = (String) iterator.next();
            final MetaDataQuery q = (MetaDataQuery) atts.get( fieldName );
            final TextBox box = new TextBox();
            box.setTitle( constants.WildCardsSearchTip() );
            fm.addAttribute( fieldName
                                     + ":",
                             box );
            box.addChangeHandler( new ChangeHandler() {
                public void onChange(ChangeEvent arg0) {
                    q.valueList = box.getText();
                }
            } );
        }

        HorizontalPanel created = new HorizontalPanel();
        created.add( new SmallLabel( constants.AfterColon() ) );
        final DatePickerTextBox createdAfter = new DatePickerTextBox( "" );
        created.add( createdAfter );

        created.add( new SmallLabel( "&nbsp;" ) ); // NON-NLS

        created.add( new SmallLabel( constants.BeforeColon() ) );
        final DatePickerTextBox createdBefore = new DatePickerTextBox( "" );
        created.add( createdBefore );

        fm.addAttribute( constants.DateCreated1(),
                         created );

        HorizontalPanel lastMod = new HorizontalPanel();
        lastMod.add( new SmallLabel( constants.AfterColon() ) );
        final DatePickerTextBox lastModAfter = new DatePickerTextBox( "" );
        lastMod.add( lastModAfter );

        lastMod.add( new SmallLabel( "&nbsp;" ) ); // NON-NLS

        lastMod.add( new SmallLabel( constants.BeforeColon() ) );
        final DatePickerTextBox lastModBefore = new DatePickerTextBox( "" );
        lastMod.add( lastModBefore );

        fm.addAttribute( constants.LastModified1(),
                         lastMod );

        final SimplePanel resultsP = new SimplePanel();
        Button search = new Button( constants.Search() );
        fm.addAttribute( "",
                         search );
        search.addClickHandler( new ClickHandler() {
            public void onClick(ClickEvent arg0) {
                resultsP.clear();
                try {
                    List<MetaDataQuery> metadata = new ArrayList<MetaDataQuery>();
                    metadata.addAll( atts.values() );
                    QueryPagedTable table = new QueryPagedTable( metadata,
                                                                 getDate( createdAfter ),
                                                                 getDate( createdBefore ),
                                                                 getDate( lastModAfter ),
                                                                 getDate( lastModBefore ),
                                                                 false,
                                                                 clientFactory );
                    resultsP.add( table );
                } catch ( IllegalArgumentException e ) {
                    ErrorPopup.showMessage( constants.BadDateFormatPleaseTryAgainTryTheFormatOf0(
                            ApplicationPreferences.getDroolsDateFormat() ) );
                }
            }

            private Date getDate(final DatePickerTextBox datePicker) {
                try {
                    return datePicker.getDate();
                } catch ( IllegalArgumentException e ) {
                    datePicker.clear();
                    throw e;
                }
            }
        } );

        criteria.add( fm );
        container.add( criteria );
        container.add( resultsP );
        advancedDisclosure.setContent( container );

        layout.add( advancedDisclosure );
    }
View Full Code Here

Examples of org.drools.guvnor.client.util.DecoratedDisclosurePanel

        this.currentSection.addAttribute( string,
                widget );
    }

    private void endSection(boolean collapsed) {
        DecoratedDisclosurePanel advancedDisclosure = new DecoratedDisclosurePanel( currentSectionName );
        advancedDisclosure.setWidth( "100%" );
        advancedDisclosure.setOpen( !collapsed );
        advancedDisclosure.setContent( this.currentSection );
        layout.add( advancedDisclosure );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.