本文整理了Java中com.google.gwt.core.client.Scheduler
类的一些代码示例,展示了Scheduler
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Scheduler
类的具体详情如下:
包路径:com.google.gwt.core.client.Scheduler
类名称:Scheduler
[英]This class provides low-level task scheduling primitives. Any exceptions thrown by the command objects executed by the scheduler will be passed to the GWT.UncaughtExceptionHandler if one is installed.
NOTE: If you are using a timer to schedule a UI animation, use com.google.gwt.animation.client.AnimationScheduler instead. The browser can optimize your animation for maximum performance.
[中]此类提供低级任务调度原语。调度器执行的命令对象引发的任何异常都将传递给GWT。UncaughtExceptionHandler(如果已安装)。
注意:如果使用计时器来安排UI动画,请使用com。谷歌。gwt。动画客户取而代之的是AnimationScheduler。浏览器可以优化动画以获得最佳性能。
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void resetFocus(ScheduledCommand command) {
// Some browsers will not focus an element that was created in this event loop.
Scheduler.get().scheduleDeferred(command);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
private static void schedule() {
if (!needsInjection) {
needsInjection = true;
Scheduler.get().scheduleFinally(flusher);
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Called when the object's drag sequence is complete.
*
* @param event the touch event
*/
protected void onDragEnd(TouchEvent<?> event) {
// There is no momentum or it isn't supported.
if (momentum == null) {
return;
}
// Schedule the momentum.
Point endVelocity = calculateEndVelocity(recentTouchPosition, lastTouchPosition);
if (endVelocity != null) {
momentumCommand = new MomentumCommand(endVelocity);
Scheduler.get().scheduleFixedDelay(momentumCommand, MS_PER_FRAME);
}
}
代码示例来源:origin: com.googlecode.mgwt/mgwt
/**
* A utility method to hide the soft keyboard
*/
public static void hideKeyBoard() {
final Anchor anchor = new Anchor(" ");
anchor.getElement().getStyle().setWidth(1, Unit.PX);
anchor.getElement().getStyle().setHeight(1, Unit.PX);
anchor.getElement().getStyle().setDisplay(Display.INLINE);
anchor.getElement().getStyle().setFloat(Float.LEFT);
RootPanel.get().add(anchor);
anchor.setFocus(true);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
@Override
public void execute() {
anchor.removeFromParent();
}
});
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-table
Style style = row.getElement().getStyle();
style.setDisplay(Display.NONE);
style.setProperty("height", getExpectedRowHeight() + "px");
style.setProperty("maxHeight", getExpectedRowHeight() + "px");
style.setProperty("minHeight", getExpectedRowHeight() + "px");
row.setStyleName(TableCssName.DATA_ROW);
expandIcon.setIconType(IconType.KEYBOARD_ARROW_DOWN);
expandIcon.setWaves(WavesType.LIGHT);
expandIcon.getElement().getStyle().setCursor(Cursor.POINTER);
expand.add(expandIcon);
Scheduler.get().scheduleDeferred(() -> {
calculateRowHeight(rowComponent);
});
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
public void minimize(MaterialOverlay overlay) {
if (!maximized) {
MaterialPathAnimator animator = new MaterialPathAnimator();
animator.setReverseCallback(() -> {
register(overlay);
overlay.getElement().getStyle().setVisibility(Style.Visibility.HIDDEN);
overlay.getElement().getStyle().setOpacity(0);
});
animator.setSourceElement(activator.getElement());
animator.setTargetElement(overlay.getElement());
animator.reverseAnimate();
body().attr("style", "overflow: auto !important");
} else {
Scheduler.get().scheduleDeferred(() -> {
overlays.stream().filter(other -> other != overlay).forEach(other -> other.removeStyleName(AddinsCssName.HIDDEN));
overlay.removeStyleName(AddinsCssName.MAXIMIZE);
});
}
maximized = false;
}
代码示例来源:origin: com.google.gwt/gwt-servlet
@Override
public void setCaption(
final FieldSetElement fieldset,
Element legend,
@IsSafeHtml String caption,
boolean asHTML) {
fieldset.getStyle().setProperty("visibility", "hidden");
super.setCaption(fieldset, legend, caption, asHTML);
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
public void execute() {
fieldset.getStyle().setProperty("visibility", "");
}
});
}
}
代码示例来源:origin: oVirt/ovirt-engine
protected void addRootNode(final TreeItem rootItem, final TreeItem leafItem) {
rootItem.getElement().getStyle().setBackgroundColor("#eff3ff"); //$NON-NLS-1$
rootItem.getElement().getStyle().setMarginBottom(1, Unit.PX);
rootItem.getElement().getStyle().setPadding(0, Unit.PX);
if (leafItem != null) {
rootItem.addItem(leafItem);
// Defer styling in order to override padding done in:
// com.google.gwt.user.client.ui.Tree -> showLeafImage
Scheduler.get().scheduleDeferred(() -> {
leafItem.getElement().getStyle().setBackgroundColor("#ffffff"); //$NON-NLS-1$
leafItem.getElement().getStyle().setMarginLeft(20, Unit.PX);
leafItem.getElement().getStyle().setPadding(0, Unit.PX);
Boolean isLeafEmpty = (Boolean) leafItem.getUserObject();
if (isLeafEmpty != null && isLeafEmpty.equals(Boolean.TRUE)) {
rootItem.getElement().getElementsByTagName("td").getItem(0).getStyle().setVisibility(Visibility.HIDDEN); //$NON-NLS-1$
}
rootItem.getElement().getElementsByTagName("td").getItem(1).getStyle().setWidth(100, Unit.PCT); //$NON-NLS-1$
});
}
tree.addItem(rootItem);
}
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Inject
public PopOverViewImpl( final TranslationService translator ) {
div.setId( DOM.createUniqueId() );
div.getStyle().setPosition( Style.Position.ABSOLUTE );
div.getStyle().setWidth( 1,
Style.Unit.PX );
div.setAttribute( "title",
translator.getTranslation( GuidedDecisionTableErraiConstants.PopOverViewImpl_Title ) );
div.setAttribute( "data-toggle",
"popover" );
RootPanel.get().getElement().appendChild( div );
Scheduler.get().scheduleDeferred( () -> initPopover( div.getId() ) );
}
代码示例来源:origin: org.uberfire/uberfire-widgets-commons
public PagedTable(final int pageSize,
final ProvidesKey<T> providesKey,
final GridGlobalPreferences gridGlobalPreferences,
final boolean showPageSizesSelector,
final boolean showFFButton,
final boolean showLButton) {
super(providesKey,
gridGlobalPreferences);
this.showPageSizesSelector = showPageSizesSelector;
this.pageSize = pageSize;
this.dataGrid.setPageStart(0);
this.dataGrid.setPageSize(pageSize);
this.pager.setDisplay(dataGrid);
this.pageSizesSelector.setVisible(this.showPageSizesSelector);
setShowFastFordwardPagerButton(showFFButton);
setShowLastPagerButton(showLButton);
this.pageSizesSelector.addValueChangeHandler(event -> {
storePageSizeInGridPreferences(Integer.parseInt(pageSizesSelector.getValue()));
loadPageSizePreferences();
});
loadPageSizePreferences();
dataGrid.addRedrawHandler(() -> Scheduler.get().scheduleDeferred(() -> setTableHeight()));
dataGrid.getElement().getStyle().setMarginBottom(0,
Style.Unit.PX);
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-ui
final int VERTICAL_OFFSET = 1;
openedSubPopup.getElement().getStyle().setVisibility(Visibility.HIDDEN);
lockLayer.add(openedSubPopup, 0, 0);
Scheduler.get()
.scheduleDeferred(
() -> {
int left = getAbsoluteLeft() + getOffsetWidth() - HORIZONTAL_OFFSET;
openedSubPopup.getElement().getStyle().setLeft(left, Unit.PX);
openedSubPopup.getElement().getStyle().setTop(top, Unit.PX);
openedSubPopup.getElement().getStyle().setVisibility(Visibility.VISIBLE);
});
代码示例来源:origin: fr.putnami.pwt/pwt
public void show() {
this.ensureDismissButton();
this.redraw();
this.visible = true;
Widget modal = getContainerWidget();
if (modal.isAttached()) {
modal.removeFromParent();
}
Modal.MODAL_BACKDROP.show();
this.getElement().getStyle().setDisplay(Display.BLOCK);
RootPanel rootPanel = RootPanel.get();
rootPanel.add(modal);
StyleUtils.addStyle(rootPanel, Modal.STYLE_MODAL_OPEN);
Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
@Override
public boolean execute() {
StyleUtils.addStyle(Modal.this, Modal.STYLE_VISIBLE);
return false;
}
}, 150);
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-addins
viewportOverflow = docStyle.getOverflow();
docStyle.setProperty("overflow", "hidden");
focusElement.getStyle().setProperty("boxShadow", "0px 0px 0px 0rem " + computedBackgroundColor);
Scheduler.get().scheduleDeferred(() -> {
focusElement.getStyle().setProperty("boxShadow", "0px 0px 0px " + backgroundSize + " " + computedBackgroundColor);
});
getElement().getStyle().clearDisplay();
代码示例来源:origin: org.drools/drools-wb-guided-dtable-editor-client
@Override
public void run() {
Scheduler.get().scheduleDeferred( () -> {
provider.getContent( ( c ) -> {
div.setAttribute( "data-content",
c.getContent() );
div.getStyle().setLeft( c.getX(),
Style.Unit.PX );
div.getStyle().setTop( c.getY(),
Style.Unit.PX );
showPopover( div.getId() );
} );
} );
}
代码示例来源:origin: org.eclipse.che.core/che-core-ide-app
"contextMenu");
popupMenu.getElement().getStyle().setProperty("opacity", "0");
popupMenu.getElement().getStyle().setProperty("transition", "opacity 0.5s ease");
Scheduler.get()
.scheduleDeferred(
new Scheduler.ScheduledCommand() {
@Override
代码示例来源:origin: oVirt/ovirt-engine
private void initiateDownload(ImageTransfer imageTransfer) {
String url = imageTransfer.getProxyUri() + "/" + imageTransfer.getImagedTicketId(); //$NON-NLS-1$
log.info("Initiating download: " + url); //$NON-NLS-1$
// Invoke download
Frame frame = new Frame(url);
frame.addLoadHandler(loadEvent -> Scheduler.get().scheduleDeferred(() ->
RootPanel.get().remove(frame)));
frame.getElement().getStyle().setDisplay(Style.Display.NONE);
RootPanel.get().add(frame);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void enableLazyScroller() {
Scheduler.get().scheduleDeferred(lazyScroller);
lazyScrollerIsActive = true;
// prevent scrolling to jump in IE11
scrollBodyPanel.getElement().getStyle().setOverflowX(Overflow.HIDDEN);
scrollBodyPanel.getElement().getStyle().setOverflowY(Overflow.HIDDEN);
}
代码示例来源:origin: org.uberfire/uberfire-workbench-client-views-patternfly
@Override
public void onClick(ClickEvent event) {
CloseEvent.fire(PartListDropdown.this,
part);
//Keep dropdown menu open when removing parts
boolean openMenu = PartListDropdown.this.getElement().hasClassName("open");
if (openMenu) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
PartListDropdown.this.getElement().addClassName("open");
}
});
}
}
},
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
public void setDropZone(final Widget dropZone, String dropZonePrompt) {
if (dropZone != null) {
Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
@Override
public void execute() {
fileUpload.setDropZone(dropZone.getElement());
}
});
dropZone.getElement().setAttribute("dropzone-prompt", dropZonePrompt != null ? dropZonePrompt : "");
} else {
fileUpload.setDropZone(null);
}
}
代码示例来源:origin: com.github.gwtmaterialdesign/gwt-material-table
row.getWidget().getElement().getStyle().clearDisplay();
Scheduler.get().scheduleFixedDelay(() -> {
if (tbody.$this().is(":visible")) {
subheaderLib.recalculate(true);
内容来源于网络,如有侵权,请联系作者删除!