Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.FocusPanel


     * @param inStream
     *            the view.
     */
    public CustomStreamPanel(final Stream inStream)
    {
        FocusPanel container = new FocusPanel();
        container.addStyleName(StaticResourceBundle.INSTANCE.coreCss().filter());

        FlowPanel panel = new FlowPanel();

        labelContainer = new FlowPanel();
        labelContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().filterLabel());
        label = new Label(inStream.getName());
        labelContainer.add(label);
        stream = inStream;

        panel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().streamListItem());
        readOnly = stream.getReadOnly();

        container.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                updateHistory();
            }
        });

        panel.add(labelContainer);

        moveHandle = new Label("move");
        moveHandle.addStyleName(StaticResourceBundle.INSTANCE.coreCss().moveHandle());
        panel.add(moveHandle);

        InlineLabel seperator = new InlineLabel();
        seperator.addStyleName(StaticResourceBundle.INSTANCE.coreCss().filterSeperator());
        panel.add(seperator);

        seperator.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                updateHistory();
            }
        });

        if (!readOnly)
        {
            Anchor editButton = new Anchor("edit");
            editButton.addClickHandler(new ClickHandler()
            {
                public void onClick(final ClickEvent event)
                {
                    Session.getInstance().getEventBus().notifyObservers(new HideNotificationEvent());
                    Dialog.showCentered(new CustomStreamDialogContent(stream));
                    event.stopPropagation();
                }
            });
            editButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().editButton());
            panel.add(editButton);

        }

        Session.getInstance().getEventBus().addObserver(SwitchedToActivityDetailViewEvent.class,
                new Observer<SwitchedToActivityDetailViewEvent>()
                {
                    public void update(final SwitchedToActivityDetailViewEvent arg1)
                    {
                        unActivate();
                    }
                });

        Session.getInstance().getEventBus().addObserver(StreamRequestEvent.class, new Observer<StreamRequestEvent>()
        {
            public void update(final StreamRequestEvent arg1)
            {
                unActivate();
            }
        });

        container.add(panel);
        initWidget(container);
    }
View Full Code Here


                    resultsPanelContainer.setVisible(event.getResponse().getPagedSet().size() > 0);
                    String historyToken = "";

                    for (ModelView result : event.getResponse().getPagedSet())
                    {
                        final FocusPanel itemContainer = new FocusPanel();
                        final FlowPanel itemPanel = new FlowPanel();
                        final Hyperlink name = new Hyperlink();
                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().globalSearchItemName());
                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsisChild());

                        if (result instanceof PersonModelView)
                        {
                            final PersonModelView person = (PersonModelView) result;
                            itemPanel.add(AvatarLinkPanel.create(person, Size.Small, false));
                            name.setText(person.getDisplayName());
                            name.setTitle(person.getDisplayName());
                            historyToken = Session.getInstance().generateUrl(
                                    new CreateUrlRequest(Page.PEOPLE, person.getAccountId()));

                            itemContainer.addClickHandler(new ClickHandler()
                            {
                                public void onClick(final ClickEvent event)
                                {
                                    ArrayList<String> views = new ArrayList<String>();
                                    views.add(person.getAccountId());
                                    eventBus.notifyObservers(new UpdateHistoryEvent(new CreateUrlRequest(Page.PEOPLE,
                                            views)));
                                }
                            });

                        }
                        else if (result instanceof DomainGroupModelView)
                        {
                            final DomainGroupModelView group = (DomainGroupModelView) result;
                            itemPanel.add(new AvatarLinkPanel(EntityType.GROUP, group.getShortName(), group
                                    .getAvatarId(), Size.Small, false));
                            name.setText(group.getName());
                            name.setTitle(group.getName());
                            historyToken = Session.getInstance().generateUrl(
                                    new CreateUrlRequest(Page.GROUPS, group.getShortName()));

                            itemContainer.addClickHandler(new ClickHandler()
                            {
                                public void onClick(final ClickEvent event)
                                {
                                    ArrayList<String> views = new ArrayList<String>();
                                    views.add(group.getShortName());
                                    eventBus.notifyObservers(new UpdateHistoryEvent(new CreateUrlRequest(Page.GROUPS,
                                            views)));
                                }
                            });
                        }

                        itemContainer.addMouseOverHandler(new MouseOverHandler()
                        {
                            public void onMouseOver(final MouseOverEvent arg0)
                            {
                                selectItem(itemContainer);
                            }
                        });

                        name.setTargetHistoryToken(historyToken);
                        itemPanel.add(name);

                        itemContainer.add(itemPanel);
                        resultsPanel.add(itemContainer);

                        if (activeItem == null)
                        {
                            selectItem(itemContainer);
                        }
                    }

                    if (event.getResponse().getTotal() > event.getResponse().getPagedSet().size())
                    {
                        final FocusPanel itemContainer = new FocusPanel();
                        final FlowPanel itemPanel = new FlowPanel();

                        itemContainer.addStyleName(StaticResourceBundle.INSTANCE.coreCss().searchResultsMoreButton());

                        itemPanel.add(new Label("See more results"));

                        itemContainer.addClickHandler(new ClickHandler()
                        {
                            public void onClick(final ClickEvent event)
                            {
                                eventBus.notifyObservers(new UpdateHistoryEvent(new CreateUrlRequest(Page.SEARCH,
                                        generateParams(searchTerm.getText()), false)));
                            }
                        });

                        itemContainer.addMouseOverHandler(new MouseOverHandler()
                        {
                            public void onMouseOver(final MouseOverEvent arg0)
                            {
                                selectItem(itemContainer);
                            }
                        });

                        itemContainer.add(itemPanel);
                        resultsPanel.add(itemContainer);
                    }

                }
            }
View Full Code Here

                    resultsPanel.clear();
                    resultsPanelContainer.setVisible(event.getResponse().getPagedSet().size() > 0);

                    for (ModelView result : event.getResponse().getPagedSet())
                    {
                        final FocusPanel itemContainer = new FocusPanel();
                        final FlowPanel itemPanel = new FlowPanel();
                        final Anchor name = new Anchor();
                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().bookmarkSearchName());
                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsis());

                        if (result instanceof PersonModelView)
                        {
                            final PersonModelView person = (PersonModelView) result;
                            itemPanel.add(AvatarLinkPanel.create(person, Size.VerySmall, false));
                            name.setText(person.getDisplayName());
                            name.setTitle(person.getDisplayName());
                            itemContainer.addClickHandler(new ClickHandler()
                            {
                                public void onClick(final ClickEvent event)
                                {
                                    StreamBookmarksModel.getInstance().insert(person.getStreamId());
                                }
                            });

                        }
                        else if (result instanceof DomainGroupModelView)
                        {
                            final DomainGroupModelView group = (DomainGroupModelView) result;
                            itemPanel.add(new AvatarLinkPanel(EntityType.GROUP, group.getShortName(), group
                                    .getAvatarId(), Size.VerySmall, false));
                            name.setText(group.getName());
                            name.setTitle(group.getName());
                            itemContainer.addClickHandler(new ClickHandler()
                            {
                                public void onClick(final ClickEvent event)
                                {
                                    StreamBookmarksModel.getInstance().insert(group.getStreamId());
                                }
                            });
                        }

                        itemContainer.addMouseOverHandler(new MouseOverHandler()
                        {
                            public void onMouseOver(final MouseOverEvent arg0)
                            {
                                selectItem(itemContainer);
                            }
                        });

                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().bookmarkNameLink());
                        name.addStyleName(StaticResourceBundle.INSTANCE.coreCss().ellipsis());
                        itemPanel.add(name);

                        itemContainer.add(itemPanel);
                        resultsPanel.add(itemContainer);

                        if (activeItem == null)
                        {
                            selectItem(itemContainer);
View Full Code Here

    invokeAllAccessibleMethods(new DeckPanel() {});
    invokeAllAccessibleMethods(new DecoratorPanel() {});
    invokeAllAccessibleMethods(new DockLayoutPanel(Unit.PX) {});
    invokeAllAccessibleMethods(new DockPanel() {});
    invokeAllAccessibleMethods(new FlowPanel() {});
    invokeAllAccessibleMethods(new FocusPanel() {});
    invokeAllAccessibleMethods(new HorizontalPanel() {});
    invokeAllAccessibleMethods(new HTMLPanel("") {});
    invokeAllAccessibleMethods(new LayoutPanel() {});
    invokeAllAccessibleMethods(new PopupPanel() {});
    invokeAllAccessibleMethods(new RenderablePanel("") {});
View Full Code Here

        table.clear();
        if (urls != null && !urls.isEmpty()) {
            isEmpty = false;
            for (int row = 0; row < urls.size(); row++) {
                final String url = urls.get(row);
                final FocusPanel labelPanel = createLabelPanel(url);
                table.setWidget(row, 0, labelPanel);
                Element rowElem = table.getRowFormatter().getElement(row);
                table.setWidget(row, 1, createDeleteButton(rowElem, url));
            }
        } else {
View Full Code Here

            table.setWidget(0, 0, new Label(i18n.NoFilesFound()));
        }
    }

    private FocusPanel createLabelPanel(final String url) {
        final FocusPanel panel = new FocusPanel();
        panel.setStyleName("fbFilesDataPanel");
        panel.addFocusHandler(new FocusHandler() {
            @Override
            public void onFocus(FocusEvent event) {
                if (panel.getStyleName().equals("fbFilesDataPanelSelected")) {
                    panel.setStyleName("fbFilesDataPanel");
                    setSelection(null);
                } else {
                    deselectAllLabels();
                    panel.setStyleName("fbFilesDataPanelSelected");
                    setSelection(url);
                }
            }
        });
        panel.setWidget(new Label(toFileName(url)));
        return panel;
    }
View Full Code Here

        return url.substring(url.lastIndexOf('/'));
    }
   
    public void addNewFile(String url) {
        if (!contains(url)) {
            final FocusPanel labelPanel = createLabelPanel(url);
            if (isEmpty) {
                table.clear();
            }
            int row = table.getRowCount();
            table.setWidget(row, 0, labelPanel);
            Element rowElem = table.getRowFormatter().getElement(row);
            table.setWidget(row, 1, createDeleteButton(rowElem, url));
            labelPanel.setFocus(true);
            setSelection(url);
        }
    }
View Full Code Here

    }
   
    private boolean contains(String url) {
        String fileName = toFileName(url);
        for (int row = 0; row < table.getRowCount(); row++) {
            FocusPanel labelPanel = (FocusPanel) table.getWidget(row, 0);
            if (labelPanel != null && labelPanel.getWidget() != null) {
                Label label = (Label) labelPanel.getWidget();
                if (label.getText().equals(fileName)) {
                    return true;
                }
            }
        }
View Full Code Here

        setupComponent();
    }
   
    private void setupComponent() {
        final HorizontalPanel wrapper = new HorizontalPanel();
        clickable = new FocusPanel();
       
        clickable.add(new Label(item.title +
                " (" + item.author.name + " " +  item.author.familyName + ")"));
       
        // TODO: show complete info
View Full Code Here

            setupComponent();
        }
       
        private void setupComponent() {
            final HorizontalPanel wrapper = new HorizontalPanel();
            clickable = new FocusPanel();
           
            clickable.add(new Label(user.name + " " + user.familyName));
            wrapper.add(clickable);
           
            this.showAnchor = new Anchor("show");
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.FocusPanel

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.