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

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


     * {@inheritDoc}
     */
    public void render(final Panel renderContainer, final ItemRenderer itemRenderer,
            final PagedSet<? extends Serializable> items, final String noItemsMessage)
    {
        Panel left = new FlowPanel();
        left.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionColLeft());
        left.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionCol());
        Panel right = new FlowPanel();
        right.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionColRight());
        right.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionCol());

        int count = 0;

        if (items.getTotal() == 0)
        {
            Label noItemsMessageLabel = new Label(noItemsMessage);
            noItemsMessageLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemEmpty());
            renderContainer.add(noItemsMessageLabel);
        }
        else
        {
            renderContainer.add(left);
            renderContainer.add(right);
        }
        double halfwayPoint = items.getPagedSet().size() / 2.0;

        for (Serializable item : items.getPagedSet())
        {
            if (count >= halfwayPoint)
            {
                right.add(itemRenderer.render(item));
            }
            else
            {
                left.add(itemRenderer.render(item));
            }
View Full Code Here


            {
                return new InlineHyperlink(name, url);
            }
            else
            {
                Panel main = new FlowPanel();
                main.addStyleName(StaticResourceBundle.INSTANCE.coreCss().inlinePanel());
                main.add(new InlineLabel(label)); // omit trailing space, since that's handled by CSS margins
                main.add(new InlineHyperlink(name, url));
                return main;
            }
        }
        else
        {
View Full Code Here

        groupPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().listItem());
        groupPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().pendingGroup());

        // -- buttons panel (left side) --

        final Panel buttonsPanel = new FlowPanel();
        buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().pendingGroupButtons());
        groupPanel.add(buttonsPanel);

        final Label confirmButton = new Label("Confirm");
        confirmButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().approveButton());
        buttonsPanel.add(confirmButton);

        final Label denyButton = new Label("Deny");
        denyButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().denyButton());
        buttonsPanel.add(denyButton);

        // -- group info (right side) --

        FlowPanel groupAbout = new FlowPanel();
        groupAbout.addStyleName(StaticResourceBundle.INSTANCE.coreCss().description());
        groupPanel.add(groupAbout);

        Label groupName = new Label(group.getName());
        groupName.addStyleName(StaticResourceBundle.INSTANCE.coreCss().displayName());
        groupAbout.add(groupName);

        Label groupDescription = new Label(group.getDescription());
        groupDescription.addStyleName(StaticResourceBundle.INSTANCE.coreCss().pendingGroupDescription());
        groupAbout.add(groupDescription);

        FlowPanel groupMetaData = new FlowPanel();
        groupMetaData.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowers());
        groupMetaData.add(new InlineLabel(new DateFormatter().timeAgo(group.getDateAdded(), true)));
        insertActionSeparator(groupMetaData);
        groupMetaData.add(new InlineLabel("By: "));
        String url =
                Session.getInstance().generateUrl(
                        new CreateUrlRequest(Page.PEOPLE, group.getPersonCreatedByAccountId()));
        groupMetaData.add(new InlineHyperlink(group.getPersonCreatedByDisplayName(), url));
       
        // Display Business Area (BA) information
        insertActionSeparator(groupMetaData);
        groupMetaData.add(new InlineLabel("BA: "));
        Label baLabel = new InlineLabel(group.getPersonCreatedByCompanyName());
        baLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData());
        groupMetaData.add(baLabel);
        insertActionSeparator(groupMetaData);
       
        groupMetaData.add(new InlineLabel("Privacy Setting: "));
        Label label = new InlineLabel(group.isPublic() ? "Public" : "Private");
        label.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemFollowersData());
        groupMetaData.add(label);

        groupAbout.add(groupMetaData);

        // -- actions --

        confirmButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitActive());

                PendingGroupsModel.getInstance().update(new ReviewPendingGroupRequest(group.getShortName(), true));
            }
        });

        denyButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                if (new WidgetJSNIFacadeImpl().confirm("Are you sure you want to deny creation of this group?"))
                {
                    buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitActive());

                    PendingGroupsModel.getInstance()
                            .update(new ReviewPendingGroupRequest(group.getShortName(), false));
                }
            }
View Full Code Here

        String resourceUrl = props.get("resourceUrl");
        String resourceTitle = props.get("resourceTitle");
        String siteUrl = props.get("siteUrl");
        String siteTitle = props.get("siteTitle");

        Panel main = new FlowPanel();
        main.addStyleName(StaticResourceBundle.INSTANCE.coreCss().inlinePanel());

        main.add(new InlineLabel("commented on"));
        main.add(new Anchor(resourceTitle, resourceUrl));
        if (resourceTitle != null && !resourceTitle.isEmpty())
        {
            if (siteUrl != null && !siteUrl.isEmpty())
            {
                main.add(new InlineLabel("from"));
                main.add(new Anchor(siteTitle, siteUrl));
            }
            else
            {
                main.add(new InlineLabel(" from " + siteTitle));
            }
        }

        return main;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Panel render(final PersonModelView item)
    {
        Panel panel = new FlowPanel();
        panel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().pendingGroupMembershipItem());

        // -- build UI --

        // buttons panel (left side)

        final Panel buttonsPanel = new FlowPanel();
        buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().pendingButtons());

        final Label approveButton = new Label("Approve");
        approveButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().approveButton());
        buttonsPanel.add(approveButton);

        final Label denyButton = new Label("Deny");
        denyButton.addStyleName(StaticResourceBundle.INSTANCE.coreCss().denyButton());
        buttonsPanel.add(denyButton);

        // person panel (right side)
        panel.add(new PersonPanel(item, false, true));
        panel.add(buttonsPanel);

        // -- wire events --

        approveButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitActive());

                GroupMembersModel.getInstance().insert(
                        new SetFollowingStatusRequest(item.getAccountId(), groupShortname, EntityType.GROUP, false,
                                Follower.FollowerStatus.FOLLOWING));
            }
        });

        denyButton.addClickHandler(new ClickHandler()
        {
            public void onClick(final ClickEvent event)
            {
                if (new WidgetJSNIFacadeImpl().confirm("Are you sure you want to deny this user membership?"))
                {
                    buttonsPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().waitActive());

                     GroupMembershipRequestModel.getInstance().delete(
                            new RequestForGroupMembershipRequest(groupId, item.getEntityId()));
                }
            }
View Full Code Here

        radioButtonGroup.clearGroup();
        radioButtonGroup.addRadioButton("Public", "Allow all users to view this profile.", "true", Boolean.TRUE);
        BasicRadioButtonFormElement privateButton = radioButtonGroup.addRadioButton("Private",
                "Restrict access to users approved by this group's coordinators.", "false", Boolean.FALSE);

        Panel extraInstructions = new FlowPanel();
        extraInstructions.addStyleName(StaticResourceBundle.INSTANCE.coreCss().groupPrivateExtraNote());
        extraInstructions.add(new InlineLabel("Please Note: "));
        extraInstructions.add(new InlineLabel(
                "This group's name and description will be visible whenever employees browse or search profiles."));
        privateButton.addToInstructions(extraInstructions);

        form.addFormElement(radioButtonGroup);
View Full Code Here

     * {@inheritDoc}
     */
    public void render(final Panel renderContainer, final ItemRenderer itemRenderer,
            final PagedSet< ? extends Serializable> items, final String noItemsMessage)
    {
        Panel left = new FlowPanel();
        left.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionColLeft());
        left.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionCol());

        Panel middle = new FlowPanel();
        middle.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionColMiddle());
        middle.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionCol());

        Panel right = new FlowPanel();
        right.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionColRight());
        right.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionCol());

        if (items.getTotal() == 0)
        {
            Label noItemsMessageLabel = new Label(noItemsMessage);
            noItemsMessageLabel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().connectionItemEmpty());
            renderContainer.add(noItemsMessageLabel);
        }
        else
        {
            renderContainer.add(left);
            renderContainer.add(middle);
            renderContainer.add(right);
        }
        double thirdCol = items.getPagedSet().size() * 2.0 / 3.0;
        double secondCol = items.getPagedSet().size() / 3.0;

        int count = 0;
        for (Serializable item : items.getPagedSet())
        {
            if (count >= thirdCol)
            {
                right.add(itemRenderer.render(item));
            }
            else if (count >= secondCol)
            {
                middle.add(itemRenderer.render(item));
            }
View Full Code Here

            });
            body.add(more);
        }

        // timestamp and actions
        Panel timestampActions = new FlowPanel();
        timestampActions.addStyleName(StaticResourceBundle.INSTANCE.coreCss().commentTimestamp());
        body.add(timestampActions);

        DateFormatter dateFormatter = new DateFormatter(new Date());
        Label dateLink = new InlineLabel(dateFormatter.timeAgo(comment.getTimeSent()));
        dateLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().commentTimestamp());
        timestampActions.add(dateLink);

        Panel actionsPanel = new FlowPanel();
        timestampActions.add(actionsPanel);

        if (comment.isDeletable())
        {
            Label sep = new InlineLabel("\u2219");
            sep.addStyleName(StaticResourceBundle.INSTANCE.coreCss().actionLinkSeparator());
            actionsPanel.add(sep);

            Label deleteLink = new InlineLabel("Delete");
            deleteLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().delete());
            deleteLink.addStyleName(StaticResourceBundle.INSTANCE.coreCss().linkedLabel());

            actionsPanel.add(deleteLink);

            deleteLink.addClickHandler(new ClickHandler()
            {
                public void onClick(final ClickEvent event)
                {
View Full Code Here

    /**
     * Shows a "not found" message.
     */
    private void showNotFound()
    {
        Panel errorReport = new FlowPanel();
        errorReport.addStyleName(StaticResourceBundle.INSTANCE.coreCss().warningReport());

        FlowPanel centeringPanel = new FlowPanel();
        centeringPanel.addStyleName(StaticResourceBundle.INSTANCE.coreCss().warningReportContainer());
        centeringPanel.add(errorReport);
        add(centeringPanel);

        FlowPanel msgPanel = new FlowPanel();

        Label msgHeader = new Label("Activity not found");
        msgHeader.addStyleName(StaticResourceBundle.INSTANCE.coreCss().warningMessage());

        Label msgText = new Label("The activity you were looking for has already been deleted or could not be found.");
        FlowPanel text = new FlowPanel();
        text.add(msgText);
        text.addStyleName(StaticResourceBundle.INSTANCE.coreCss().errorMessageText());

        msgPanel.add(msgHeader);
        msgPanel.add(msgText);

        errorReport.add(msgPanel);
        Session.getInstance().getTimer().removeTimerJob("getUnseenActivityJob");

    }
View Full Code Here

     * @param message
     *            the messa.ge
     */
    private void appendActivity(final ActivityDTO message)
    {
        Panel newActivity = renderer.render(message);
        newActivity.setVisible(false);
        streamPanel.insert(newActivity, 0);
        EffectsFacade.nativeFadeIn(newActivity.getElement(), true);
    }
View Full Code Here

TOP

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

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.