private PushButton createNavigationButton( @IsSafeHtml String label, final int noOfMonths, String styleName) { PushButton button = new PushButton(); button.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { addMonths(noOfMonths); } }); button.getUpFace().setHTML(label); button.setStyleName(styleName); return button; }
/** * Returns the button for moving to the previous month. */ public Element getBackwardButtonElement() { return monthBackwards.getElement(); }
private boolean isDatePickerConfigChanged() { boolean isMonthCurrentlySelectable = monthSelect.getParent() != null; boolean isYearNavigationCurrentlyEnabled = yearBackwards.getParent() != null; return getDatePicker().isYearAndMonthDropdownVisible() != isMonthCurrentlySelectable || getDatePicker().isYearArrowsVisible() != isYearNavigationCurrentlyEnabled; }
firstPageButton = new PushButton(createImage(resources.getStyle().firstPage())); firstPageButton.getUpDisabledFace().setImage(createImage(resources.getStyle().firstPageDisabled())); firstPageButton.setTitle(resources.getMessages().gotoFirstPage()); lastPageButton = new PushButton(createImage(resources.getStyle().lastPage())); lastPageButton.getUpDisabledFace().setImage(createImage(resources.getStyle().lastPageDisabled())); lastPageButton.setTitle(resources.getMessages().gotoLastPage()); nextPageButton = new PushButton(createImage(resources.getStyle().nextPage())); nextPageButton.getUpDisabledFace().setImage(createImage(resources.getStyle().nextPageDisabled())); nextPageButton.setTitle(resources.getMessages().gotoNextPage()); previousPageButton = new PushButton(createImage(resources.getStyle().previousPage())); previousPageButton.getUpDisabledFace().setImage(createImage(resources.getStyle().previousPageDisabled())); previousPageButton.setTitle(resources.getMessages().gotoPreviousPage()); firstPageButton.addClickHandler(handler); lastPageButton.addClickHandler(handler); nextPageButton.addClickHandler(handler); previousPageButton.addClickHandler(handler);
new PushButton(new Image(rImUp), new Image(rImPressed)); aButton.getUpHoveringFace().setImage(rHoverImage); aButton.getDownHoveringFace().setImage(rHoverImage); aButton.getUpDisabledFace().setImage(rDisabledImage); aButton.getDownDisabledFace().setImage(rDisabledImage); aButton.setStyleName(CSS.ewtSpinnerButton()); aButton.addClickHandler(new ClickHandler()
/** * Returns a new button that shifts the date when clicked. * * @param seconds How many seconds to shift. * @param label The label to put on the button. */ private PushButton newShiftDateButton(final int seconds, final String label) { final PushButton button = new PushButton(label); button.setStyleName(seconds < 0 ? "datePickerPreviousButton" : "datePickerNextButton"); button.addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { Date d = box.getValue(); if (d == null) { if (seconds >= 0) { return; } d = new Date(); } d.setTime(d.getTime() + seconds * 1000L); d.setSeconds(0); setDate(d); } }); return button; }
private PushButton createPushButton(ImageResource img, String tip) { PushButton pb = new PushButton(new Image(img)); pb.addClickHandler(handler); pb.setTitle(tip); return pb; }
/** * Returns a new button that sets the minutes when clicked. * * @param minutes A value for minutes (0-59). * @param label The label to put on the button. */ private PushButton newSetMinutesButton(final int minutes, final String label) { final PushButton button = new PushButton(label); button.addClickHandler(new ClickHandler() { public void onClick(final ClickEvent event) { @SuppressWarnings(/* GWT requires us to use Date */{"deprecation"}) Date d = box.getValue(); if (d == null) { d = new Date(); } d.setMinutes(minutes); d.setSeconds(0); setDate(d); } }); return button; }
new PushButton(new Image(GwtTable.RES.imLeft())); aNextPageButton = new PushButton(new Image(GwtTable.RES.imRight())); aStartButton = new PushButton(new Image(GwtTable.RES.imBack())); aEndButton = new PushButton(new Image(GwtTable.RES.imForward())); aLockSizeButton = new ToggleButton(new Image(GwtTable.RES.imLock()), new Image(GwtTable.RES.imUnlock())); aDownloadButton = new PushButton(new Image(GwtTable.RES.imDownload())); aClearSelectionButton = new PushButton(new Image(GwtTable.RES.imClearSelection())); aPrevPageButton.setTitle(rContext.expandResource("$ttPrevTablePage")); aNextPageButton.setTitle(rContext.expandResource("$ttNextTablePage")); aStartButton.setTitle(rContext.expandResource("$ttFirstTablePage")); aEndButton.setTitle(rContext.expandResource("$ttLastTablePage")); aLockSizeButton.setTitle(rContext.expandResource("$ttLockTableSize")); aDownloadButton.setTitle(rContext.expandResource("$ttDownloadTableContent")); aClearSelectionButton.setTitle(rContext.expandResource("$ttClearSelection")); aPrevPageButton.addClickHandler(this); aNextPageButton.addClickHandler(this); aStartButton.addClickHandler(this); aEndButton.addClickHandler(this); aLockSizeButton.addClickHandler(this); aDownloadButton.addClickHandler(this);
protected void setup() aPrevMonthButton.getUpFace().setHTML("‹"); aPrevMonthButton.setStyleName("datePickerPreviousButton"); aPrevMonthButton.addClickHandler(new MonthChangeClickHandler(-1)); aNextMonthButton.getUpFace().setHTML("›"); aNextMonthButton.setStyleName("datePickerNextButton"); aNextMonthButton.addClickHandler(new MonthChangeClickHandler(1)); aPrevYearButton.getUpFace().setHTML("«"); aPrevYearButton.setStyleName("datePickerPreviousButton"); aPrevYearButton.addClickHandler(new MonthChangeClickHandler(-12)); aNextYearButton.getUpFace().setHTML("»"); aNextYearButton.setStyleName("datePickerNextButton"); aNextYearButton.addClickHandler(new MonthChangeClickHandler(12));
popup.setWidget( scroll ); popup.addAutoHidePartner( image.getElement() ); popup.addAutoHidePartner( button.getElement() ); popup.addCloseHandler( new CloseHandler<PopupPanel>() { @Override button.addClickHandler( OntologyDropdownBase.this );
new PushButton(EWT.expandResource(rParent, BUTTON_LABELS[i])); aButton.addClickHandler(this); aButtonPanel.add(aButton); aButton.setWidth("6EM"); aFirstButton.addStyleName("ewt-Default");
public Widget createFilterWidget() { DatePicker datePicker = new DatePicker(); primaryDateBox = new DateBox(); primaryDateBox.setFormat(new DateBox.DefaultFormat(dateTimeFormat)); primaryDateBox.setWidth("100%"); primaryDateBox.addStyleName("dateBox"); primaryDateBox.addValueChangeHandler(valueChangeHandler); secondaryDateBox = new DateBox(); secondaryDateBox.setFormat(new DateBox.DefaultFormat(dateTimeFormat)); secondaryDateBox.setWidth("100%"); secondaryDateBox.addStyleName("dateBox"); secondaryDateBox.addValueChangeHandler(valueChangeHandler); operatorButton = new PushButton(); setButtonText(operatorButton, operator); operatorButton.addClickHandler(clickHandler); operatorButton.addStyleName("operatorButton"); horizontalPanel.addStyleName("columnDateFilter"); horizontalPanel.setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE); horizontalPanel.add(operatorButton); horizontalPanel.add(primaryDateBox); horizontalPanel.add(secondaryDateBox); horizontalPanel.setCellWidth(operatorButton, "30px"); horizontalPanel.setCellWidth(primaryDateBox, "100%"); secondaryDateBox.setVisible(false); return horizontalPanel; }
/*************************************** * Sets the enabled state of the clear selection button. * * @param bEnabled The enabled state */ void setClearSelectionButtonEnabled(boolean bEnabled) { aClearSelectionButton.setEnabled(bEnabled); }
private void setButtonText(PushButton pushButton, Operator operator) { pushButton.getUpFace().setText(operator.getSymbol()); pushButton.getUpHoveringFace().setText(operator.getSymbol()); pushButton.getDownFace().setText(operator.getSymbol()); pushButton.setTitle(getOperatorTooltip(operator)); }
private void maybeShowForceUnlockButton(final LockInfo lockInfo) { final Image unlockImage = new Image(ImageResources.INSTANCE.unlock()); unlock.setHTML("<span>" + unlockImage.toString() + " " + unlock.getText() + "</span>"); unlock.getElement().setAttribute("data-uf-lock", "false"); unlock.setVisible(lockInfo.isLocked()); unlock.setEnabled(true); }
/*************************************** * Sets the button text. * * @param sText The new button text */ @Override public void setText(String sText) { sText = getContext().expandResource(sText); this.sText = sText; HasText rWidget = (HasText) getWidget(); rWidget.setText(sText); if (rWidget instanceof PushButton) { // GWT bug: text of other states will not be set sometimes PushButton rPushButton = (PushButton) rWidget; rPushButton.getUpFace().setText(sText); rPushButton.getDownFace().setText(sText); rPushButton.getUpHoveringFace().setText(sText); rPushButton.getDownHoveringFace().setText(sText); rPushButton.getUpDisabledFace().setText(sText); rPushButton.getDownDisabledFace().setText(sText); } }
p.setCellWidth( image, "100%" ); button.setStyleName( "OntologyDropdown-DropButton" ); button.addMouseOverHandler( this ); button.addMouseOutHandler( this );
operatorButton = new PushButton(); setButtonText(operatorButton, operator); operatorButton.addClickListener(clickListener); operatorButton.addStyleName("operatorButton"); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.addStyleName("columnTextFilter");
private void initialiseShufflers() { btnMoveUp.addClickHandler( new ClickHandler() { @Override public void onClick( final ClickEvent event ) { final int index = chosenConditions.indexOf( chosenConditionsSelection ); final ConditionCol52 c = chosenConditions.remove( index ); chosenConditions.add( index - 1, c ); setChosenConditions( chosenConditions ); availablePatternsSelection.setChildColumns( chosenConditions ); } } ); btnMoveDown.addClickHandler( new ClickHandler() { @Override public void onClick( final ClickEvent event ) { final int index = chosenConditions.indexOf( chosenConditionsSelection ); final ConditionCol52 c = chosenConditions.remove( index ); chosenConditions.add( index + 1, c ); setChosenConditions( chosenConditions ); availablePatternsSelection.setChildColumns( chosenConditions ); } } ); }