Package org.eurekastreams.web.client.ui.common.autocomplete

Examples of org.eurekastreams.web.client.ui.common.autocomplete.AutoCompleteEntityDropDownPanel


            this.add(postTo);

            this.add(mine);
            this.add(other);

            autoComplete = new AutoCompleteEntityDropDownPanel("/resources/autocomplete/entities/");

            autoComplete.setOnItemSelectedCommand(new AutoCompleteEntityDropDownPanel.OnItemSelectedCommand()
            {
                public void itemSelected(final JavaScriptObject obj)
                {
View Full Code Here


            uniqueKeys.add(scope.getUniqueKey());
        }

        scopeListPanel = new StreamScopeListPanel(inScopes);

        final AutoCompleteEntityDropDownPanel autoComplete = new AutoCompleteEntityDropDownPanel(inAutoCompleteUrl);
        autoComplete.setMaxLength(inMaxLength);
        autoComplete.setOnItemSelectedCommand(new AutoCompleteEntityDropDownPanel.OnItemSelectedCommand()
        {
            public void itemSelected(final JavaScriptObject obj)
            {
                if (!getEntityType(obj.toString()).equals("NOTSET"))
                {
                    EventBus.getInstance().notifyObservers(
                            new StreamScopeAddedEvent(new StreamScope(getDisplayName(obj.toString()), ScopeType
                                    .valueOf(getEntityType(obj.toString())), getUniqueId(obj.toString()), Long
                                    .parseLong(getStreamScopeId(obj.toString())))));
                }
            }
        });

        EventBus.getInstance().addObserver(StreamScopeAddedEvent.getEvent(), new Observer<StreamScopeAddedEvent>()
        {
            public void update(final StreamScopeAddedEvent obj)
            {
                uniqueKeys.add(obj.getScope().getUniqueKey());
                autoComplete.clearText();

                if (!allowMultiple || uniqueKeys.size() >= maxItems)
                {
                    autoComplete.setVisible(false);
                    instructions.setVisible(false);
                }
            }
        });

        EventBus.getInstance().addObserver(StreamScopeDeletedEvent.getEvent(), new Observer<StreamScopeDeletedEvent>()
        {
            public void update(final StreamScopeDeletedEvent obj)
            {
                uniqueKeys.remove(obj.getScope().getUniqueKey());
                if (!allowMultiple || uniqueKeys.size() < maxItems)
                {
                    autoComplete.setVisible(true);
                    instructions.setVisible(true);
                }
            }
        });

        if ((!allowMultiple && !inScopes.isEmpty()) || uniqueKeys.size() >= maxItems)
        {
            autoComplete.setVisible(false);
            instructions.setVisible(false);
        }

        this.add(listMembers);
        this.add(scopeListPanel);
View Full Code Here

TOP

Related Classes of org.eurekastreams.web.client.ui.common.autocomplete.AutoCompleteEntityDropDownPanel

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.