本文整理汇总了Java中com.google.gwt.user.client.Timer类的典型用法代码示例。如果您正苦于以下问题:Java Timer类的具体用法?Java Timer怎么用?Java Timer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Timer类属于com.google.gwt.user.client包,在下文中一共展示了Timer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: HorizontalPanelWithHint
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public HorizontalPanelWithHint(Widget hint) {
super();
iHint = new PopupPanel();
iHint.setWidget(hint);
iHint.setStyleName("unitime-PopupHint");
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONMOUSEMOVE);
iShowHint = new Timer() {
@Override
public void run() {
iHint.show();
}
};
iHideHint = new Timer() {
@Override
public void run() {
iHint.hide();
}
};
}
示例2: onPlayerEvent
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
@Override
public void onPlayerEvent(PlayerEvent event) {
if (testMode) {
return;
}
if (event.getType() == PAGE_LOADED) {
Timer timer = new Timer() {
@Override
public void run() {
setEnabled(!isEnd());
setStyleName();
}
};
timer.schedule(300);
} else if (event.getType() == BEFORE_FLOW) {
setEnabled(false);
setStyleName();
}
}
示例3: VideoControlHideTimer
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
@Inject
public VideoControlHideTimer(@Assisted VideoFullScreenView view, EventsBus eventsBus) {
this.view = view;
this.eventsBus = eventsBus;
view.getContainer().addDomHandler(this, TouchEndEvent.getType());
view.getContainer().addDomHandler(this, ClickEvent.getType());
view.getContainer().addDomHandler(this, MouseMoveEvent.getType());
controlsHideTimer = new Timer() {
@Override
public void run() {
hideCotrols();
}
};
controlsHideTimer.schedule(CONTROLS_SHOW_TIME);
}
示例4: MyFlexTable
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public MyFlexTable() {
super();
setCellPadding(2);
setCellSpacing(0);
sinkEvents(Event.ONMOUSEOVER);
sinkEvents(Event.ONMOUSEOUT);
sinkEvents(Event.ONCLICK);
sinkEvents(Event.ONKEYDOWN);
setStylePrimaryName("unitime-MainTable");
iTimer = new Timer() {
@Override
public void run() {
saveOrder();
}
};
}
示例5: CourseRelatedObjectsTable
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public CourseRelatedObjectsTable(AcademicSessionProvider session) {
iSession = session;
setStyleName("unitime-EventOwners");
List<Widget> header = new ArrayList<Widget>();
header.add(new UniTimeTableHeader(MESSAGES.colSubject()));
header.add(new UniTimeTableHeader(MESSAGES.colCourseNumber()));
header.add(new UniTimeTableHeader(MESSAGES.colConfigOrSubpart()));
header.add(new UniTimeTableHeader(MESSAGES.colClassNumber()));
header.add(new UniTimeTableHeader(" "));
addRow(null, header);
iChangeTimer = new Timer() {
@Override
public void run() {
List<RelatedObjectInterface> value = getValue();
if (iLastChange != null && iLastChange.equals(value)) return;
iLastChange = value;
ValueChangeEvent.fire(CourseRelatedObjectsTable.this, value);
}
};
}
示例6: addNotification
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
protected void addNotification(final Notification notification) {
for (Iterator<Notification> i = iNotifications.iterator(); i.hasNext(); ) {
Notification n = i.next();
if (n.getText().equals(notification.getText())) {
i.remove();
}
}
iNotifications.add(notification);
populate("slideup");
Timer timer = new Timer() {
@Override
public void run() {
iNotifications.remove(notification);
populate(null);
}
};
timer.schedule(10000);
}
示例7: UniTimePageHeader
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
private UniTimePageHeader() {
iHeader = new PageHeader();
getLeft().setCallback(new Callback() {
@Override
public void execute(Callback callback) {
reloadSolverInfo(true, callback);
}
});
reloadSessionInfo();
reloadUserInfo();
iTimer = new Timer() {
@Override
public void run() {
reloadSolverInfo(getLeft().isPopupShowing(), null);
}
};
iTimer.schedule(1000);
}
示例8: Calendar
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
private Calendar(Integer tenantId, Fetchable<Collection<I>> dataProvider, Fetchable<List<G>> groupProvider,
DataProvider<G,
I> instanceCreator, SyncBeanManager beanManager) {
this.beanManager = beanManager;
this.tenantId = tenantId;
shifts = new HashMap<>();
didTenantChange = true;
setInstanceCreator(instanceCreator);
setGroupProvider(groupProvider);
setDataProvider(dataProvider);
timer = new Timer() {
@Override
public void run() {
forceUpdate();
}
};
refresh();
}
示例9: EditorManager
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
/**
* Creates the editor manager.
*/
public EditorManager() {
openProjectEditors = Maps.newHashMap();
dirtyProjectSettings = new HashSet<ProjectSettings>();
dirtyFileEditors = new HashSet<FileEditor>();
autoSaveTimer = new Timer() {
@Override
public void run() {
// When the timer goes off, save all dirtyProjectSettings and
// dirtyFileEditors.
Ode.getInstance().lockScreens(true); // Lock out changes
saveDirtyEditors(new Command() {
@Override
public void execute() {
Ode.getInstance().lockScreens(false); // I/O finished, unlock
}
});
}
};
}
示例10: executeCommandPause
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
private void executeCommandPause(final PromptlyPanel panel) {
panel.setBlockingHyperlinks(true);
panel.append("Pausing for 3 seconds (all input ignored) ....");
panel.setCommandLineMode(false /* is command line mode */, false /* is collect key events */, false /* is collect mouse events */);
Timer t = new Timer() {
@Override
public void run() {
panel.append("... and we are back !");
panel.setBlockingHyperlinks(false);
panel.setCommandLineMode(true /* is command line mode */, true /* is collect key events */, true /* is collect mouse events */);
}
};
t.schedule(3000);
}
示例11: testNoEvents
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
/** Verify that no events are issued via newItem if there were not reqeuested. */
public void testNoEvents() {
delayTestFinish(5000);
addHistoryListenerImpl(event -> fail("onHistoryChanged should not have been called"));
History.newItem("testNoEvents", false);
timer =
new Timer() {
@Override
public void run() {
finishTest();
}
};
timer.schedule(500);
}
示例12: testNoDoubleTokenUnEscaping
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
/**
* Test to make sure that there is no double unescaping of hash values. See
* https://bugzilla.mozilla.org/show_bug.cgi?id=483304
*/
@DoNotRunWith(Platform.HtmlUnitUnknown)
public void testNoDoubleTokenUnEscaping() {
final String shouldBeEncoded = "abc%20abc";
delayTestFinish(5000);
History.newItem(shouldBeEncoded);
History.newItem("someOtherToken");
History.back();
// allow browser to update the url
timer =
new Timer() {
@Override
public void run() {
// make sure that value in url actually matches the original token
assertEquals(shouldBeEncoded, History.getToken());
finishTest();
}
};
timer.schedule(200);
}
示例13: it
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
public static void it(String html) {
try {
buildFrame(html);
if (USE_TIMER) {
Timer timer = new Timer() {
public void run() {
printFrame();
}
};
timer.schedule(TIMER_DELAY * 1000);
} else {
DeferredCommand.addCommand(new Command() {
public void execute() {
printFrame();
}
});
}
} catch (Throwable exc) {
Window.alert(exc.getMessage());
}
}
示例14: GoogleDriveView
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
@Inject
GoogleDriveView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
splash.show();
Timer t = new Timer() {
@Override
public void run() {
splash.hide();
}
};
t.schedule(5000);
search.addCloseHandler(event -> {
appNav.setVisible(true);
searchNav.setVisible(false);
});
search.addKeyUpHandler(event -> {
List<DriveDTO> filteredFiles = DataHelper.getAllDrives().stream().filter(dto -> dto.getFileName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
populateFiles(filteredFiles);
});
populateFiles(DataHelper.getAllDrives());
}
示例15: GoogleContactsView
import com.google.gwt.user.client.Timer; //导入依赖的package包/类
@Inject
GoogleContactsView(Binder uiBinder) {
initWidget(uiBinder.createAndBindUi(this));
splash.show();
Timer t = new Timer() {
@Override
public void run() {
splash.hide();
}
};
t.schedule(5000);
search.addCloseHandler(event -> {
appNav.setVisible(true);
searchNav.setVisible(false);
});
search.addKeyUpHandler(event -> {
List<UserDTO> filteredUser = DataHelper.getAllUsers().stream().filter(dto -> dto.getName().toLowerCase().contains(search.getText().toLowerCase())).collect(Collectors.toList());
populateUsers(filteredUser);
});
populateUsers(DataHelper.getAllUsers());
}