Search in sources :

Example 26 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.

the class NewAgreementScreen method renderSelf.

private void renderSelf() {
    current = null;
    agreementGroup.setVisible(false);
    finalGroup.setVisible(false);
    radios.clear();
    final SmallHeading hdr = new SmallHeading();
    if (available.isEmpty()) {
        hdr.setText(Util.C.newAgreementNoneAvailable());
    } else {
        hdr.setText(Util.C.newAgreementSelectTypeHeading());
    }
    radios.add(hdr);
    for (final AgreementInfo cla : available) {
        final RadioButton r = new RadioButton("cla_id", cla.name());
        r.addStyleName(Gerrit.RESOURCES.css().contributorAgreementButton());
        radios.add(r);
        if (mySigned.contains(cla.name())) {
            r.setEnabled(false);
            final Label l = new Label(Util.C.newAgreementAlreadySubmitted());
            l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementAlreadySubmitted());
            radios.add(l);
        } else {
            r.addClickHandler(new ClickHandler() {

                @Override
                public void onClick(final ClickEvent event) {
                    showCLA(cla);
                }
            });
        }
        if (cla.description() != null && !cla.description().equals("")) {
            final Label l = new Label(cla.description());
            l.setStyleName(Gerrit.RESOURCES.css().contributorAgreementShortDescription());
            radios.add(l);
        }
    }
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) AgreementInfo(com.google.gerrit.client.info.AgreementInfo) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) Label(com.google.gwt.user.client.ui.Label) InlineLabel(com.google.gwt.user.client.ui.InlineLabel) RadioButton(com.google.gwt.user.client.ui.RadioButton)

Example 27 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.

the class Gerrit method whoAmI.

private static void whoAmI(boolean canLogOut) {
    AccountInfo account = getUserAccount();
    final UserPopupPanel userPopup = new UserPopupPanel(account, canLogOut, true);
    final FlowPanel userSummaryPanel = new FlowPanel();
    class PopupHandler implements KeyDownHandler, ClickHandler {

        private void showHidePopup() {
            if (userPopup.isShowing() && userPopup.isVisible()) {
                userPopup.hide();
            } else {
                userPopup.showRelativeTo(userSummaryPanel);
            }
        }

        @Override
        public void onClick(ClickEvent event) {
            showHidePopup();
        }

        @Override
        public void onKeyDown(KeyDownEvent event) {
            if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
                showHidePopup();
                event.preventDefault();
            }
        }
    }
    final PopupHandler popupHandler = new PopupHandler();
    final InlineLabel l = new InlineLabel(FormatUtil.name(account));
    l.setStyleName(RESOURCES.css().menuBarUserName());
    final AvatarImage avatar = new AvatarImage(account, 26, false);
    avatar.setStyleName(RESOURCES.css().menuBarUserNameAvatar());
    userSummaryPanel.setStyleName(RESOURCES.css().menuBarUserNamePanel());
    userSummaryPanel.add(l);
    userSummaryPanel.add(avatar);
    // "BLACK DOWN-POINTING SMALL TRIANGLE"
    userSummaryPanel.add(new InlineLabel(" ▾"));
    userPopup.addAutoHidePartner(userSummaryPanel.getElement());
    FocusPanel fp = new FocusPanel(userSummaryPanel);
    fp.setStyleName(RESOURCES.css().menuBarUserNameFocusPanel());
    fp.addKeyDownHandler(popupHandler);
    fp.addClickHandler(popupHandler);
    menuRight.add(fp);
}
Also used : KeyDownEvent(com.google.gwt.event.dom.client.KeyDownEvent) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) KeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel) InlineLabel(com.google.gwt.user.client.ui.InlineLabel) FocusPanel(com.google.gwt.user.client.ui.FocusPanel) AccountInfo(com.google.gerrit.client.info.AccountInfo)

Example 28 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.

the class AccountGroupInfoScreen method initOwner.

private void initOwner() {
    final VerticalPanel ownerPanel = new VerticalPanel();
    ownerPanel.setStyleName(Gerrit.RESOURCES.css().groupOwnerPanel());
    ownerPanel.add(new SmallHeading(AdminConstants.I.headingOwner()));
    final AccountGroupSuggestOracle accountGroupOracle = new AccountGroupSuggestOracle();
    ownerTxt = new RemoteSuggestBox(accountGroupOracle);
    ownerTxt.setStyleName(Gerrit.RESOURCES.css().groupOwnerTextBox());
    ownerTxt.setVisibleLength(60);
    ownerPanel.add(ownerTxt);
    saveOwner = new Button(AdminConstants.I.buttonChangeGroupOwner());
    saveOwner.setEnabled(false);
    saveOwner.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            final String newOwner = ownerTxt.getText().trim();
            if (newOwner.length() > 0) {
                AccountGroup.UUID ownerUuid = accountGroupOracle.getUUID(newOwner);
                String ownerId = ownerUuid != null ? ownerUuid.get() : newOwner;
                GroupApi.setGroupOwner(getGroupUUID(), ownerId, new GerritCallback<GroupInfo>() {

                    @Override
                    public void onSuccess(final GroupInfo result) {
                        updateOwnerGroup(result);
                        saveOwner.setEnabled(false);
                    }
                });
            }
        }
    });
    ownerPanel.add(saveOwner);
    add(ownerPanel);
}
Also used : AccountGroupSuggestOracle(com.google.gerrit.client.ui.AccountGroupSuggestOracle) SmallHeading(com.google.gerrit.client.ui.SmallHeading) GerritCallback(com.google.gerrit.client.rpc.GerritCallback) VerticalPanel(com.google.gwt.user.client.ui.VerticalPanel) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) GroupInfo(com.google.gerrit.client.info.GroupInfo) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) RemoteSuggestBox(com.google.gerrit.client.ui.RemoteSuggestBox)

Example 29 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.

the class AccountGroupMembersScreen method initIncludeList.

private void initIncludeList() {
    accountGroupSuggestOracle = new AccountGroupSuggestOracle();
    addIncludeBox = new AddMemberBox(AdminConstants.I.buttonAddIncludedGroup(), AdminConstants.I.defaultAccountGroupName(), accountGroupSuggestOracle);
    addIncludeBox.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doAddNewInclude();
        }
    });
    includes = new IncludeTable();
    includes.addStyleName(Gerrit.RESOURCES.css().groupIncludesTable());
    delInclude = new Button(AdminConstants.I.buttonDeleteIncludedGroup());
    delInclude.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            includes.deleteChecked();
        }
    });
    includePanel = new FlowPanel();
    includePanel.add(new SmallHeading(AdminConstants.I.headingIncludedGroups()));
    includePanel.add(addIncludeBox);
    includePanel.add(includes);
    includePanel.add(delInclude);
    add(includePanel);
}
Also used : AccountGroupSuggestOracle(com.google.gerrit.client.ui.AccountGroupSuggestOracle) SmallHeading(com.google.gerrit.client.ui.SmallHeading) AddMemberBox(com.google.gerrit.client.ui.AddMemberBox) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Example 30 with ClickHandler

use of com.google.gwt.event.dom.client.ClickHandler in project gerrit by GerritCodeReview.

the class AccountGroupMembersScreen method initMemberList.

private void initMemberList() {
    addMemberBox = new AddMemberBox(AdminConstants.I.buttonAddGroupMember(), AdminConstants.I.defaultAccountName(), new AccountSuggestOracle());
    addMemberBox.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            doAddNewMember();
        }
    });
    members = new MemberTable();
    members.addStyleName(Gerrit.RESOURCES.css().groupMembersTable());
    delMember = new Button(AdminConstants.I.buttonDeleteGroupMembers());
    delMember.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(final ClickEvent event) {
            members.deleteChecked();
        }
    });
    memberPanel = new FlowPanel();
    memberPanel.add(new SmallHeading(AdminConstants.I.headingMembers()));
    memberPanel.add(addMemberBox);
    memberPanel.add(members);
    memberPanel.add(delMember);
    add(memberPanel);
}
Also used : SmallHeading(com.google.gerrit.client.ui.SmallHeading) AccountSuggestOracle(com.google.gerrit.client.ui.AccountSuggestOracle) AddMemberBox(com.google.gerrit.client.ui.AddMemberBox) ClickHandler(com.google.gwt.event.dom.client.ClickHandler) Button(com.google.gwt.user.client.ui.Button) ClickEvent(com.google.gwt.event.dom.client.ClickEvent) FlowPanel(com.google.gwt.user.client.ui.FlowPanel)

Aggregations

ClickHandler (com.google.gwt.event.dom.client.ClickHandler)448 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)442 CustomButton (cz.metacentrum.perun.webgui.widgets.CustomButton)168 JsonCallbackEvents (cz.metacentrum.perun.webgui.json.JsonCallbackEvents)143 TabMenu (cz.metacentrum.perun.webgui.widgets.TabMenu)129 ArrayList (java.util.ArrayList)125 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)110 TabItem (cz.metacentrum.perun.webgui.tabs.TabItem)79 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)49 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)48 ExtendedSuggestBox (cz.metacentrum.perun.webgui.widgets.ExtendedSuggestBox)41 PerunError (cz.metacentrum.perun.webgui.model.PerunError)38 Button (com.google.gwt.user.client.ui.Button)35 HashMap (java.util.HashMap)34 ExtendedTextBox (cz.metacentrum.perun.webgui.widgets.ExtendedTextBox)33 Button (org.gwtbootstrap3.client.ui.Button)33 HTML (com.google.gwt.user.client.ui.HTML)31 Image (com.google.gwt.user.client.ui.Image)29 FlexCellFormatter (com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter)28 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)26