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 = (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

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

    public DiscussionWidget(final Artifact artifact, boolean readOnly) {
        this.artifact = artifact;
        this.readOnly = readOnly;

        DecoratedDisclosurePanel discussionPanel = new DecoratedDisclosurePanel( constants.Discussion() );
        discussionPanel.setWidth( "100%" );

        commentList.setWidth( "100%" );
        VerticalPanel discussionLayout = new VerticalPanel();
        discussionLayout.setWidth( "90%" );
        discussionLayout.add( commentList );

        newCommentLayout.setWidth( "100%" );
        refreshDiscussion();
        discussionLayout.add( newCommentLayout );
        showNewCommentButton();

        discussionPanel.setContent( discussionLayout );

        pushNotify = new ServerPushNotification() {
            public void messageReceived(PushResponse response) {
                if ( "discussion".equals( response.messageType ) && artifact.getUuid().equals( response.message ) ) {
                    System.err.println( "Refreshing discussion..." );
View Full Code Here

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

    private void initRuleflowViewer() {
        RuleFlowContentModel rfcm = (RuleFlowContentModel) asset.getContent();

        if ( rfcm != null && rfcm.getXml() != null && rfcm.getNodes() != null ) {
            try {
                parameterPanel = new DecoratedDisclosurePanel( constants.Parameters() );
                parameterPanel.ensureDebugId( "cwDisclosurePanel" );
                parameterPanel.setWidth( "100%" );
                parameterPanel.setOpen( false );

                FormStyleLayout parametersForm = new FormStyleLayout();
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

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

                         boolean readOnly) {

        text = getTextArea();
        text.setEnabled(!readOnly);

        DecoratedDisclosurePanel disclosurePanel = getDisclosurePanel();

        disclosurePanel.setContent(text);

        disclosurePanel.addOpenHandler(new OpenHandler<DisclosurePanel>() {
            public void onOpen(OpenEvent<DisclosurePanel> event) {
                loadData(artifact);
            }
        });

        disclosurePanel.setOpen(false);

        initWidget(disclosurePanel);
    }
View Full Code Here

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

        initWidget(disclosurePanel);
    }

    private DecoratedDisclosurePanel getDisclosurePanel() {
        DecoratedDisclosurePanel disclosurePanel = new DecoratedDisclosurePanel(constants.Description());
        disclosurePanel.setWidth("100%");
        return disclosurePanel;
    }
View Full Code Here

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

    public DiscussionWidget(final Artifact artifact, boolean readOnly) {
        this.artifact = artifact;
        this.readOnly = readOnly;

        DecoratedDisclosurePanel discussionPanel = new DecoratedDisclosurePanel(constants.Discussion());
        discussionPanel.setWidth("100%");

        commentList.setWidth("100%");
        VerticalPanel discussionLayout = new VerticalPanel();
        discussionLayout.setWidth("90%");

        newCommentLayout.setWidth("100%");
        refreshDiscussion();
        showNewCommentButton();

        discussionLayout.add(newCommentLayout);
        discussionLayout.add(commentList);
       
        discussionPanel.setContent(discussionLayout);

        pushNotify = new ServerPushNotification() {
            public void messageReceived(PushResponse response) {
                if ("discussion".equals(response.messageType) && artifact.getUuid().equals(response.message)) {
                    System.err.println("Refreshing discussion...");
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
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.