public LockCell(boolean check, String text, String ariaLabel) { super(null); if (CONSTANTS.listOfClassesUseLockIcon()) { iCheck = new AriaToggleButton(RESOURCES.locked(), RESOURCES.unlocked()); } else { iCheck = new AriaCheckBox(); } if (text != null) ((HasText)iCheck).setText(text); iCheck.setValue(check); ((HasClickHandlers)iCheck).addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { event.stopPropagation(); } }); if (ariaLabel != null) setAriaLabel(ariaLabel); }
public void add(Widget widget) { if (widget instanceof HasClickHandlers && clickHandler!=null) { ((HasClickHandlers) widget).addClickHandler(clickHandler); } if (widget instanceof HasDoubleClickHandlers && doubleClickHandler!=null) { ((HasDoubleClickHandlers) widget).addDoubleClickHandler(doubleClickHandler); } if (widget instanceof HasErrorHandlers && errorHandler!=null) { ((HasErrorHandlers) widget).addErrorHandler(errorHandler); } if (widget instanceof HasMouseOutHandlers && mouseOutHandler!=null) { ((HasMouseOutHandlers) widget).addMouseOutHandler(mouseOutHandler); } if (widget instanceof HasMouseOverHandlers && mouseOverHandler!=null) { ((HasMouseOverHandlers) widget).addMouseOverHandler(mouseOverHandler); } flowpanel.add(widget); }
/** * Display the specified service entries in the container provided, while applying the tags * generated by the tag processor. */ private void populateServiceEntries(Iterable<ServiceDefinition> services, EntryAggregatorView toPopulate, Set<TagProcessor> tagProcessors) { for (final ServiceDefinition service : services) { String iconUrl = service.getIcons().getIcon16Url(); String displayName = NameHelper.generateDisplayTitle(service.getTitle(), service.getName()); Set<DescriptionTag> tags = Sets.newHashSet(); for (TagProcessor processor : tagProcessors) { tags.addAll(processor.process(service)); } HasClickHandlers rowHandle = toPopulate.addEntry(new ServiceEntry( iconUrl, displayName, service.getVersion(), service.getDescription(), tags)); rowHandle.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { presenter.handleClickService(service); } }); } }
/** * Display the spcified history items in the aggregator specified. * * @param prefix Prefix that should be prepended to the history item URL when an item is clicked, * changes based on whether this was a search result or the history item list. * @param historyItems Items which to render and display in the aggregator, * @param aggregator Aggregator that will display rendered history items. */ private void populateHistoryItems( final String prefix, Iterable<HistoryItem> historyItems, EntryAggregatorView aggregator) { for (final HistoryItem item : historyItems) { ApiRequest request = item.getRequest(); HasClickHandlers rowHandler = aggregator.addEntry(new HistoryEntry(request.getMethod() .getId(), request.getHttpMethod().toString() + " " + request.getRequestPath(), item .getEndTime())); rowHandler.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { presenter.handleClickHistoryItem(prefix, item); } }); } }
private Widget initAvatarPanel( final int index, final PresetAvatarImages.AvatarDescriptor descriptor ){ Widget avatarWidget; //Initialize the avatar image final String avatarURLBase = ServerSideAccessManager.getPresetAvatarImagesBase(); Image image = new Image( avatarURLBase + descriptor.relativeURL ); image.setStyleName( CommonResourcesContainer.AVATAR_IMAGE_CHOICE_DEFAULT_STYLE ); image.setTitle( titlesI18N.clickToChooseToolTip() ); //Sort out what the avatar widget is. if( descriptor.price > 0 ) { //If there is a price tag then the avatar is a special object FocusPanel focusPanel = new FocusPanel(); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHorizontalAlignment( HasHorizontalAlignment.ALIGN_CENTER ); verticalPanel.setVerticalAlignment( HasVerticalAlignment.ALIGN_BOTTOM ); verticalPanel.add( image ); verticalPanel.add( new PriceTagWidget( null, descriptor.price, false, true )); focusPanel.add( verticalPanel ); avatarWidget = focusPanel; } else { //If there is no price then the avatar is the image widget itself avatarWidget = image; } //Add the floading style and the click handler avatarWidget.addStyleName( CommonResourcesContainer.AVATAR_IMAGE_IN_LIST_STYLE ); ((HasClickHandlers) avatarWidget).addClickHandler( new ClickHandler() { public void onClick(ClickEvent e) { if( isChooseEnabled ) { //Initiate the avatar selection, do the RPC call doChooseAvatarServerCall( index ); } //Just in case stop the event here e.preventDefault(); e.stopPropagation(); } }); return (Widget) avatarWidget; }
public HasClickHandlers[] addProduct( String product, int row ) { Image l1 = new Image( "images/display.png" ); Image l2 = new Image( "images/edit.png" ); Image l3 = new Image( "images/delete.png" ); HasClickHandlers[] handlers = new HasClickHandlers[] { l1, l2, l3 }; table.setText( row + 1, 0, product ); table.setWidget( row + 1, 1, l1 ); table.setWidget( row + 1, 2, l2 ); table.setWidget( row + 1, 3, l3 ); return handlers; }
/** * Add an aggregator line for the particular method specified. When clicked, append the prefix * specified and then the method identifier to the current URL. */ private void populateMethodEntry(final ApiMethod method, @Nullable String serviceTitle, final String prefix, EntryAggregatorView aggregator) { HasClickHandlers rowHandler = aggregator.addEntry( new MethodEntry(method.getId(), serviceTitle, method.getDescription())); rowHandler.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { presenter.handleClickMethod(prefix, method); } }); }
@Override public final void setSubmitButton(final Widget psubmitButton) { this.submitButton = psubmitButton; if (this.submitButton instanceof HasClickHandlers) { ((HasClickHandlers) this.submitButton) .addClickHandler(pevent -> AbstractBeanValidationEditorDriver.this.tryToSubmitFrom()); } }
public HasClickHandlers getSubmitBtn() { return submitBtn; }
@Override public HasClickHandlers getSourceButton() { return getSourceButton; }
@Override public HasClickHandlers getBinaryButton() { return getBinaryButton; }
@Override public HasClickHandlers getBackButton() { return backButton; }
@Override public HasClickHandlers getChangeKaaHostButton() { return changeKaaHostButton; }
@Override public HasClickHandlers getGetLogsButton() { return getLogsButton; }
public HasClickHandlers getChangeLogLevelButton() { return changeLogLevelButton; }
public HasClickHandlers getStartButton() { return start; }
public HasClickHandlers getShowDealButton() { return showDeal; }
public HasClickHandlers getShowProductButton() { return showProduct; }
public HasClickHandlers getShowCart() { return showCart; }
public HasClickHandlers getLoginButton() { return login; }
public HasClickHandlers getLeftButton() { return leftButton; }
public HasClickHandlers getRightButton() { return rightButton; }
public HasClickHandlers getCreateButton() { return createButton; }
@Override public HasClickHandlers getCompanyButton() { return companyButton; }
@Override public HasClickHandlers getInfoButton() { return infoButton; }
@Override public HasClickHandlers getPassiveInfoButton() { return passiveInfoButton; }
@Override public HasClickHandlers getClose() { return close; }
public HasClickHandlers getCompanyMenu() { return c; }
public HasClickHandlers getProductMenu() { return p; }
public HasClickHandlers getClearHistoryButton() { return clearHistory; }
public HasClickHandlers getHasBeenThere() { return hasBeenThere; }
@Override public HasClickHandlers getBroadcastInfo() { return broadcastInfo; }
@Override public HasClickHandlers getShowStatus() { return showStatus; }
@Override public HasClickHandlers getActivateStatus() { return activateStatus; }
public HasClickHandlers getSelectNameButton() { return selectButton; }
public HasClickHandlers getSelectButton() { return select; }