Search in sources :

Example 56 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project perun by CESNET.

the class SelfSponsoredUsersTabItem method draw.

@Override
public Widget draw() {
    VerticalPanel vp = new VerticalPanel();
    vp.setSize("100%", "100%");
    if (user.isSponsoredUser()) {
        // SERVICE TYPE user
        this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(user.getFullNameWithTitles().trim()) + ": Sponsors");
        // request
        final GetUsersBySpecificUser request = new GetUsersBySpecificUser(userId);
        // menu
        TabMenu menu = new TabMenu();
        vp.add(menu);
        vp.setCellHeight(menu, "30px");
        menu.addWidget(UiElements.getRefreshButton(this));
        // table
        CellTable<User> table;
        if (session.isPerunAdmin()) {
            table = request.getTable(new FieldUpdater<User, String>() {

                public void update(int i, User user, String s) {
                    session.getTabManager().addTab(new SelfDetailTabItem(user));
                }
            });
        } else {
            table = request.getTable();
        }
        table.addStyleName("perun-table");
        table.setWidth("100%");
        ScrollPanel sp = new ScrollPanel(table);
        sp.addStyleName("perun-tableScrollPanel");
        vp.add(sp);
        session.getUiElements().resizePerunTable(sp, 350, this);
    } else {
        // PERSON TYPE user
        this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(user.getFullNameWithTitles().trim()) + ": Sponsored users");
        // request
        final GetSpecificUsersByUser request = new GetSpecificUsersByUser(userId);
        request.setHideService(true);
        // menu
        TabMenu menu = new TabMenu();
        vp.add(menu);
        vp.setCellHeight(menu, "30px");
        menu.addWidget(UiElements.getRefreshButton(this));
        // table
        CellTable<User> table;
        if (session.isPerunAdmin()) {
            table = request.getTable(new FieldUpdater<User, String>() {

                public void update(int i, User user, String s) {
                    session.getTabManager().addTab(new SelfDetailTabItem(user));
                }
            });
        } else {
            table = request.getTable();
        }
        table.addStyleName("perun-table");
        table.setWidth("100%");
        ScrollPanel sp = new ScrollPanel(table);
        sp.addStyleName("perun-tableScrollPanel");
        vp.add(sp);
        session.getUiElements().resizePerunTable(sp, 350, this);
    }
    contentWidget.setWidget(vp);
    return getWidget();
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) FieldUpdater(com.google.gwt.cell.client.FieldUpdater) User(cz.metacentrum.perun.webgui.model.User) GetUsersBySpecificUser(cz.metacentrum.perun.webgui.json.usersManager.GetUsersBySpecificUser) GetSpecificUsersByUser(cz.metacentrum.perun.webgui.json.usersManager.GetSpecificUsersByUser) GetSpecificUsersByUser(cz.metacentrum.perun.webgui.json.usersManager.GetSpecificUsersByUser) GetUsersBySpecificUser(cz.metacentrum.perun.webgui.json.usersManager.GetUsersBySpecificUser) ScrollPanel(com.google.gwt.user.client.ui.ScrollPanel) TabMenu(cz.metacentrum.perun.webgui.widgets.TabMenu)

Example 57 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project perun by CESNET.

the class UserExtSourceDetailTabItem method draw.

public Widget draw() {
    this.titleWidget.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin().trim()));
    // MAIN TAB PANEL
    VerticalPanel vp = new VerticalPanel();
    vp.setSize("100%", "100%");
    // The table
    AbsolutePanel dp = new AbsolutePanel();
    //dp.setStyleName("decoration");
    final FlexTable menu = new FlexTable();
    menu.setCellSpacing(5);
    menu.setWidget(0, 0, new Image(LargeIcons.INSTANCE.worldIcon()));
    Label memberName = new Label();
    memberName.setText(Utils.getStrippedStringWithEllipsis(userExtSource.getLogin(), 40));
    memberName.setStyleName("now-managing");
    memberName.setTitle(userExtSource.getLogin());
    menu.setWidget(0, 1, memberName);
    int column = 2;
    menu.setHTML(0, column, "&nbsp;");
    menu.getFlexCellFormatter().setWidth(0, column, "25px");
    column++;
    if (JsonUtils.isExtendedInfoVisible()) {
        menu.setHTML(0, column, "<strong>UES ID:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getId() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES name:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getName() + "</span>");
        column++;
        menu.setHTML(0, column, "&nbsp;");
        menu.getFlexCellFormatter().setWidth(0, column, "25px");
        column++;
        menu.setHTML(0, column, "<strong>ES type:</strong><br/><span class=\"inputFormInlineComment\">" + userExtSource.getExtSource().getType() + "</span>");
    }
    dp.add(menu);
    vp.add(dp);
    vp.setCellHeight(dp, "30px");
    tabPanel.clear();
    tabPanel.add(new UserExtSourceSettingsTabItem(userExtSource), "Settings");
    // Resize must be called after page fully displays
    Scheduler.get().scheduleDeferred(new Command() {

        @Override
        public void execute() {
            tabPanel.finishAdding();
        }
    });
    vp.add(tabPanel);
    this.contentWidget.setWidget(vp);
    return getWidget();
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) Command(com.google.gwt.user.client.Command) FlexTable(com.google.gwt.user.client.ui.FlexTable) Label(com.google.gwt.user.client.ui.Label) AbsolutePanel(com.google.gwt.user.client.ui.AbsolutePanel) Image(com.google.gwt.user.client.ui.Image)

Example 58 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class ColumnsPagePresenter method refreshConditionsWidget.

void refreshConditionsWidget(final List<CompositeColumn<? extends BaseColumn>> conditionColumns) {
    final VerticalPanel conditionsWidget = getConditionsWidget();
    conditionsWidget.clear();
    if (conditionColumns.isEmpty()) {
        getAccordion().getItem(CONDITION).setOpen(false);
        conditionsWidget.add(blankSlate());
        return;
    }
    conditionsWidget.add(getConditionsPanel());
    final Map<String, List<BaseColumn>> columnGroups = groupByTitle(conditionColumns);
    getConditionsPanel().renderColumns(columnGroups);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) List(java.util.List)

Example 59 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class ColumnsPagePresenter method makeDefaultPanel.

VerticalPanel makeDefaultPanel() {
    final VerticalPanel verticalPanel = new VerticalPanel();
    verticalPanel.add(blankSlate());
    return verticalPanel;
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel)

Example 60 with VerticalPanel

use of com.google.gwt.user.client.ui.VerticalPanel in project drools-wb by kiegroup.

the class ColumnsPagePresenter method setupAccordionWidget.

void setupAccordionWidget(final GuidedDecisionTableAccordionItem.Type accordionType, final Consumer<VerticalPanel> setWidget) {
    final VerticalPanel defaultPanel = makeDefaultPanel();
    setWidget.accept(defaultPanel);
    accordion.addItem(accordionType, defaultPanel);
}
Also used : VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel)

Aggregations

VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)63 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)19 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)19 Label (com.google.gwt.user.client.ui.Label)18 HTML (com.google.gwt.user.client.ui.HTML)14 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)12 CheckBox (com.google.gwt.user.client.ui.CheckBox)9 SmallHeading (com.google.gerrit.client.ui.SmallHeading)7 Button (com.google.gwt.user.client.ui.Button)7 ScrollPanel (com.google.gwt.user.client.ui.ScrollPanel)7 TextBox (com.google.gwt.user.client.ui.TextBox)7 FlexTable (com.google.gwt.user.client.ui.FlexTable)6 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)6 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)6 GerritCallback (com.google.gerrit.client.rpc.GerritCallback)5 OnEditEnabler (com.google.gerrit.client.ui.OnEditEnabler)4 Grid (com.google.gwt.user.client.ui.Grid)4 Image (com.google.gwt.user.client.ui.Image)4 InlineLabel (com.google.gwt.user.client.ui.InlineLabel)4 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)4