本文整理汇总了Java中org.apache.wicket.util.time.Duration.seconds方法的典型用法代码示例。如果您正苦于以下问题:Java Duration.seconds方法的具体用法?Java Duration.seconds怎么用?Java Duration.seconds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.util.time.Duration
的用法示例。
在下文中一共展示了Duration.seconds方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parse
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public static Duration parse(Long time, DurationUnit durationUnit){
switch(durationUnit){
case DAYS:
return Duration.days(time);
case HOURS:
return Duration.hours(time);
case MILLISECONDS:
return Duration.milliseconds(time);
case MINUTES:
return Duration.minutes(time);
case SECONDS:
return Duration.seconds(time);
}
throw new WicketSpringBootException("Could not parse time with duration unit " + time + " " + durationUnit);
}
示例2: OnlineStatusPanel
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
OnlineStatusPanel(String id, RemoteRepoDescriptor remoteRepo) {
super(id);
setOutputMarkupId(true);
this.remoteRepository = remoteRepo;
isOffline = remoteRepo.isOffline() || centralConfigService.getDescriptor().isOfflineMode();
onlineStatusLabel = new LabeledValue("status", "Online Status: ", "");
onlineStatusLabel.setValue(getStatusText(remoteRepo, isOffline));
behavior = new AbstractAjaxRestartableTimerBehavior(Duration.seconds(getSecondsForNextRefresh()),
"ajaxRefresh") {
@Override
protected void onTimer(AjaxRequestTarget target) {
onlineStatusLabel.setValue(getStatusText(remoteRepository, isOffline));
this.setUpdateInterval(Duration.seconds(getSecondsForNextRefresh()));
target.add(OnlineStatusPanel.this);
}
};
// WebMarkupContainer statusLabel=new WebMarkupContainer("statusLabel");
// add(statusLabel);
onlineStatusLabel.setOutputMarkupId(true);
addOnlineInfo();
}
示例3: AsyncUpdatePanel
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public AsyncUpdatePanel(String id, IModel<V> callableParameterModel) {
this(id, callableParameterModel, Duration.seconds(DEFAULT_TIMER_DURATION));
}
示例4: AsyncDashboardPanel
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public AsyncDashboardPanel(String id, IModel<String> title, String icon, String boxCssClasses, boolean noPadding) {
this(id, title, icon, new Model(), Duration.seconds(DEFAULT_TIMER_DURATION),boxCssClasses, noPadding);
}
示例5: UpdateNewsFromCache
import org.apache.wicket.util.time.Duration; //导入方法依赖的package包/类
public UpdateNewsFromCache() {
super(Duration.seconds(5));
Injector.get().inject(this);
}