Package org.drools.guvnor.client.common

Examples of org.drools.guvnor.client.common.FormStyleLayout


                parameterPanel = new DecoratedDisclosurePanel( constants.Parameters() );
                parameterPanel.ensureDebugId( "cwDisclosurePanel" );
                parameterPanel.setWidth( "100%" );
                parameterPanel.setOpen( false );

                FormStyleLayout parametersForm = new FormStyleLayout();
                parametersForm.setHeight( "120px" );
                parameterPanel.setContent( parametersForm );

                ruleFlowViewer = new RuleFlowViewer( rfcm,
                                                     parametersForm );
            } catch ( Exception e ) {
View Full Code Here


        fields.add( up );
        fields.add( ok );

        form.add( fields );

        layout = new FormStyleLayout( getIcon(),
                                      formName );

        if ( !this.asset.isreadonly ) layout.addAttribute( constants.UploadNewVersion(),
                                                           form );
View Full Code Here

    private CheckBox              archiveBox;

    public QuickFindWidget(OpenItemCommand editEvent) {
        this.editEvent = editEvent;

        FormStyleLayout layout = new FormStyleLayout(images.systemSearch(),
                "");

        searchBox = new SuggestBox( new SuggestOracle() {
            public void requestSuggestions(Request r,
                                           Callback cb) {
                loadShortList( r.getQuery(),
                               r,
                               cb );

            }
        } );

        final SimplePanel resultsP = new SimplePanel();

        HorizontalPanel srch = new HorizontalPanel();
        final ClickHandler cl = new ClickHandler() {
            public void onClick(ClickEvent event) {
                resultsP.clear();
                AssetItemGrid grid = new AssetItemGrid(QuickFindWidget.this.editEvent,
                                                        "searchresults",
                                                        new AssetItemGridDataLoader() { //NON-NLS
                                                            public void loadData(int startRow,
                                                                                 int numberOfRows,
                                                                                 GenericCallback<TableDataResult> cb) {
                                                                RepositoryServiceFactory.getService().quickFindAsset( searchBox.getText(),
                                                                                                                      archiveBox.getValue(),
                                                                                                                      startRow,
                                                                                                                      numberOfRows,
                                                                                                                      cb );
                                                            }
                                                        } );
                resultsP.add( grid );

            }
        };

        searchBox.addKeyUpHandler( new KeyUpHandler() {
            public void onKeyUp(KeyUpEvent event) {
                if ( event.getNativeKeyCode() == KeyCodes.KEY_ENTER ) {
                    cl.onClick( null );
                }
            }
        } );
        srch.add( searchBox );
        layout.addAttribute( constants.FindItemsWithANameMatching(),
                             srch );

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

        Button go = new Button( constants.Search() );
        go.addClickHandler( cl );
        layout.addAttribute( "",
                             go );

        FlexTable listPanel = new FlexTable();
        listPanel.setWidget( 0,
                             0,
                             new HTML( Format.format( "<img src='{0}'/>&nbsp;{1}",
                                                      images.information().getURL(),
                                                      constants.EnterSearchString()

                             ) ) ); //NON-NLS

        PrettyFormLayout pfl = new PrettyFormLayout();
        pfl.startSection();
        pfl.addRow(listPanel);
        pfl.addRow( resultsP );

        pfl.endSection();
        layout.addRow( pfl );

        initWidget(layout);
    }
View Full Code Here

        fields.add( up );
        fields.add( ok );

        form.add( fields );

        layout = new FormStyleLayout( getIcon(),
                                      formName );

        if ( !this.asset.isreadonly ) layout.addAttribute( constants.UploadNewVersion(),
                                                           form );
View Full Code Here

        advancedDisclosure.setContent( this.currentSection );
        layout.add( advancedDisclosure );
    }

    private void startSection(String name) {
        currentSection = new FormStyleLayout();
        currentSectionName = name;
    }
View Full Code Here

    private final FormStyleLayout builtInSelectorLayout   = new FormStyleLayout();
    private final FormStyleLayout customSelectorLayout    = new FormStyleLayout();
    private String                buildMode               = "buildWholePackage";

    public PackageBuilderWidget(final PackageConfigData conf) {
        layout = new FormStyleLayout();
        this.conf = conf;

        final SimplePanel buildResults = new SimplePanel();

        RadioButton wholePackageRadioButton = new RadioButton( "action",
View Full Code Here

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

        FormStyleLayout ts = new FormStyleLayout();
        final TextBox tx = new TextBox();
        ts.addAttribute( constants.SearchFor(),
                         tx );
        Button go = new Button();
        go.setText( constants.Search1() );
        ts.addAttribute( "",
                         go );
        ts.setWidth( "100%" );
        advancedDisclosure.setContent( ts );

        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();
                AssetItemGrid grid = new AssetItemGrid(editEvent,
                                                        "searchresults",
                                                        new AssetItemGridDataLoader() { //NON-NLS
                                                            public void loadData(int startRow,
                                                                                 int numberOfRows,
                                                                                 GenericCallback cb) {
                                                                RepositoryServiceFactory.getService().queryFullText( tx.getText(),
                                                                                                                     false,
                                                                                                                     startRow,
                                                                                                                     numberOfRows,
                                                                                                                     cb );
                                                            }
                                                        } );
                resultsP.add( grid );
            }

        };

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

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

                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();
                AssetItemGrid grid = new AssetItemGrid(editEvent,
                                                        "searchresults",
                                                        new AssetItemGridDataLoader() { //NON-NLS
                                                            public void loadData(int startRow,
                                                                                 int numberOfRows,
                                                                                 GenericCallback cb) {
                                                                MetaDataQuery[] mdq = new MetaDataQuery[atts.size()];
                                                                int i = 0;
                                                                for ( Iterator<String> iterator = atts.keySet().iterator(); iterator.hasNext(); ) {
                                                                    String name = (String) iterator.next();
                                                                    mdq[i] = (MetaDataQuery) atts.get( name );
                                                                    i++;
                                                                }
                                                                try {
                                                                    RepositoryServiceFactory.getService().queryMetaData( mdq,
                                                                                                                         getDate( createdAfter ),
                                                                                                                         getDate( createdBefore ),
                                                                                                                         getDate( lastModAfter ),
                                                                                                                         getDate( lastModBefore ),
                                                                                                                         false,
                                                                                                                         startRow,
                                                                                                                         numberOfRows,
                                                                                                                         cb );
                                                                } catch ( IllegalArgumentException e ) {
                                                                    ErrorPopup.showMessage( Format.format( constants.BadDateFormatPleaseTryAgainTryTheFormatOf0(),
                                                                                                           Preferences.getStringPref( "drools.dateformat" ) ) );
                                                                }
                                                            }

                                                            private Date getDate(final DatePickerTextBox datePicker) {
                                                                try {
                                                                    return datePicker.getDate();
                                                                } catch ( IllegalArgumentException e ) {
                                                                    datePicker.clear();
                                                                    throw e;
                                                                }
                                                            }
                                                        } );
                resultsP.add( grid );
            }
        } );
        fm.addRow( resultsP );
        advancedDisclosure.setContent( fm );

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

        this.edit = edit;
    }

    public VerifierResultWidget(AnalysisReport report,
                                boolean showFactUsage) {
        FormStyleLayout layout = new FormStyleLayout();

        Tree tree = new Tree();

        TreeItem errors = doMessageLines( constants.Errors(),
                                          images.error(),
                                          report.errors );
        tree.addItem( errors );

        TreeItem warnings = doMessageLines( constants.Warnings(),
                                            images.warning(),
                                            report.warnings );
        tree.addItem( warnings );

        TreeItem notes = doMessageLines( constants.Notes(),
                                         images.note(),
                                         report.notes );
        tree.addItem( notes );

        if ( showFactUsage ) {
            tree.addItem( new FactUsagesItem( report.factUsages ) );
        }

        tree.addCloseHandler( new CloseHandler<TreeItem>() {
            public void onClose(CloseEvent<TreeItem> event) {
                swapTitleWithUserObject( event.getTarget() );
            }
        } );
        tree.addOpenHandler( new OpenHandler<TreeItem>() {
            public void onOpen(OpenEvent<TreeItem> event) {
                swapTitleWithUserObject( event.getTarget() );
            }
        } );
        layout.addRow( tree );

        initWidget( layout );
    }
View Full Code Here

                parameterPanel = new DecoratedDisclosurePanel( constants.Parameters() );
                parameterPanel.ensureDebugId( "cwDisclosurePanel" );
                parameterPanel.setWidth( "100%" );
                parameterPanel.setOpen( false );

                FormStyleLayout parametersForm = new FormStyleLayout();
                parametersForm.setHeight( "120px" );
                parameterPanel.setContent( parametersForm );

                ruleFlowViewer = new RuleFlowViewer( rfcm,
                                                     parametersForm );
            } catch ( Exception e ) {
View Full Code Here

TOP

Related Classes of org.drools.guvnor.client.common.FormStyleLayout

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.