Package org.drools.guvnor.client.common

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


        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) {
View Full Code Here


                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( " " ) ); // 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( " " ) ); // 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 {
View Full Code Here

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

        Image image = new Image(images.systemSearch());
        image.setAltText(constants.SystemSearch());
        FormStyleLayout layout = new FormStyleLayout(image,
                "" );

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

            }
        } );

        HorizontalPanel srch = new HorizontalPanel();

        final SimplePanel resultsP = new SimplePanel();
        final ClickHandler cl = new ClickHandler() {
            public void onClick( ClickEvent event ) {
                resultsP.clear();
                QueryPagedTable table = new QueryPagedTable(
                        searchBox.getValue(),
                        archiveBox.getValue(),
                        caseSensitiveBox.getValue(),
                        clientFactory );
                resultsP.add( table );
            }
        };
        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 );

        caseSensitiveBox = new CheckBox();
        caseSensitiveBox.setValue( false );
        layout.addAttribute( constants.IsSearchCaseSensitive(),
                caseSensitiveBox );

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

        HorizontalPanel searchTitle = new HorizontalPanel();
        searchTitle.add( new Image( images.information() ) );
        searchTitle.add( new Label( constants.EnterSearchString() ) );
View Full Code Here

        //fields.add(new Label("upload:"));
        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 String                initialCategory;

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

        final SimplePanel buildResults = new SimplePanel();
View Full Code Here

    private final EditItemEvent openItem;
    private Constants constants = ((Constants) GWT.create(Constants.class));


    public QuickFindWidget(EditItemEvent editEvent) {
        layout = new FormStyleLayout("images/system_search.png", ""); //NON-NLS

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

        parameterPanel = new Panel();
        parameterPanel.setCollapsible(true);
        parameterPanel.setTitle(constants.Parameters());

        FormStyleLayout parametersForm = new FormStyleLayout();
        parametersForm.setHeight("120px"); // NON-NLS
        parameterPanel.add(parametersForm);

        ruleFlowViewer = new RuleFlowViewer(rfcm, parametersForm);

      } catch (Exception e) {
View Full Code Here

    private Constants constants = ((Constants) GWT.create(Constants.class));

    public RuleAttributeWidget(RuleModeller parent, RuleModel model) {
        this.parent = parent;
        this.model = model;
        FormStyleLayout layout = new FormStyleLayout();
        //Adding metadata here, seems redundant to add a new widget for metadata. Model does handle meta data separate.
        RuleMetadata[] meta = model.metadataList;
        if (meta.length > 0) {
            HorizontalPanel hp = new HorizontalPanel();
            //hp.add(new HTML("  "));
            hp.add(new SmallLabel(constants.Metadata2()));
            //attributeConfigWidget.add(hp);
            layout.addRow(hp);
        }
        for (int i = 0; i < meta.length; i++) {
            RuleMetadata rmd = meta[i];
            layout.addAttribute(rmd.attributeName, getEditorWidget(rmd, i));
        }
        RuleAttribute[] attrs = model.attributes;
        if (attrs.length > 0) {
            HorizontalPanel hp = new HorizontalPanel();
            //hp.add(new HTML("&nbsp;&nbsp;"));
            hp.add(new SmallLabel(constants.Attributes1()));
            //attributeConfigWidget.add(hp);
            layout.addRow(hp);
        }
        for (int i = 0; i < attrs.length; i++) {
            RuleAttribute at = attrs[i];
            layout.addAttribute(at.attributeName, getEditorWidget(at, i));
        }

        initWidget(layout);
    }
View Full Code Here

                put( constants.CheckinComment(),
                     new MetaDataQuery( "drools:checkinComment" ) ); //NON-NLS
            }
        };

        FormStyleLayout fm = new FormStyleLayout();
        for ( Iterator 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.addChangeListener( new ChangeListener() {
                public void onChange(Widget w) {
                    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.addClickListener( new ClickListener() {
            public void onClick(Widget w) {
                resultsP.clear();
                AssetItemGrid grid = new AssetItemGrid( openItem,
                                                        "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 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 );
        p.add( fm );
        p.setCollapsed( true );
        layout.add( p );
    }
View Full Code Here

        p.setCollapsible( true );
        p.setTitle( constants.TextSearch() );

        p.setCollapsed( 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%" );
        p.add( ts );

        final SimplePanel resultsP = new SimplePanel();
        final ClickListener cl = new ClickListener() {
            public void onClick(Widget w) {
                if ( tx.getText().equals( "" ) ) {
                    Window.alert( constants.PleaseEnterSomeSearchText() );
                    return;
                }
                resultsP.clear();
                AssetItemGrid grid = new AssetItemGrid( openItem,
                                                        "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.addClickListener( cl );
        tx.addKeyboardListener( new KeyboardListenerAdapter() {
            @Override
            public void onKeyUp(Widget sender,
                                char keyCode,
                                int modifiers) {
                if ( keyCode == KeyboardListener.KEY_ENTER ) {
                    cl.onClick( sender );
                }
            }
        } );
        ts.addRow( resultsP );
        layout.add( p );
    }
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.