本文整理汇总了Java中org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior类的典型用法代码示例。如果您正苦于以下问题:Java AjaxSelfUpdatingTimerBehavior类的具体用法?Java AjaxSelfUpdatingTimerBehavior怎么用?Java AjaxSelfUpdatingTimerBehavior使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AjaxSelfUpdatingTimerBehavior类属于org.apache.wicket.ajax包,在下文中一共展示了AjaxSelfUpdatingTimerBehavior类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initLayout
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
@Override
protected void initLayout() {
final WebMarkupContainer table = new WebMarkupContainer(ID_TABLE);
table.setOutputMarkupId(true);
add(table);
table.add(new AjaxSelfUpdatingTimerBehavior(Duration.milliseconds(10000)));
Label cpuUsage = new Label(ID_CPU_USAGE, new PropertyModel<>(getModel(), SystemInfoDto.F_CPU_USAGE));
table.add(cpuUsage);
Label heapMemory = new Label(ID_HEAP_MEMORY, createMemoryModel(true));
table.add(heapMemory);
Label nonHeapMemory = new Label(ID_NON_HEAP_MEMORY, createMemoryModel(false));
table.add(nonHeapMemory);
Label threads = new Label(ID_THREADS, createThreadModel());
table.add(threads);
DateLabelComponent startTime = new DateLabelComponent(ID_START_TIME, createStartTimeModel(), DateLabelComponent.MEDIUM_MEDIUM_STYLE);
table.add(startTime);
Label uptime = new Label(ID_UPTIME, createUptimeModel());
table.add(uptime);
}
示例2: Timestamp
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public Timestamp(String id) {
super(id);
// TODO Auto-generated constructor stub
// Server time Label
Label time = new Label("time", new Model() {
private static final long serialVersionUID = -4992940551255653329L;
@Override
public Serializable getObject() {
DateFormat dateFormat = new SimpleDateFormat(
"yyyy/MM/dd HH:mm:ss");
java.util.Date date = new java.util.Date();
return dateFormat.format(date);
}
});
time.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1)));
add(time);
}
示例3: StaticDataPanel
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public StaticDataPanel(String id, String symbol) {
super(id);
// TODO Auto-generated constructor stub
StaticDataDAO sdd = new StaticDataDAO();
StaticData sd = sdd.getLastStaticDataAsObject(symbol);
add(new Label("range", sd.getRange()));
add(new Label("yearrange", sd.getYearRange()));
add(new Label("open", sd.getOpen()));
add(new Label("volavg", sd.getVolavg()));
add(new Label("mktcap", sd.getMktcap()));
add(new Label("pne", sd.getPne()));
add(new Label("divyield", sd.getDivyield()));
add(new Label("eps", sd.getEps()));
add(new Label("shares", sd.getShares()));
add(new Label("beta", sd.getBeta()));
add(new AjaxSelfUpdatingTimerBehavior(Duration.minutes(30)));
}
示例4: MonitorPanel
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public MonitorPanel(String id) {
super(id);
jobsTable = createJobsTable(new ReportJobInfoDataProvider());
jobsTable.setOutputMarkupId(true);
add(jobsTable);
schedulerJobsTable = createSchedulerJobsTable(new ActiveSchedulerJobDataProvider());
schedulerJobsTable.setOutputMarkupId(true);
add(schedulerJobsTable);
RunHistoryPanel runHistoryPanel = new RunHistoryPanel("runHistoryPanel", null);
runHistoryTable = runHistoryPanel.getRunHistoryTable();
runHistoryTable.setOutputMarkupId(true);
add(runHistoryPanel);
Settings settings = storageService.getSettings();
int updateInterval = settings.getUpdateInterval();
if (updateInterval > 0) {
jobsTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(updateInterval)));
schedulerJobsTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(updateInterval)));
runHistoryTable.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(updateInterval)));
}
}
示例5: onInitialize
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
final Label label = new Label("hello", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return "Hello Reload " + i;
}
});
add(label);
label.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(15)){
@Override
protected void onPostProcessTarget(final AjaxRequestTarget target) {
i++;
super.onPostProcessTarget(target);
}
});
}
示例6: CrawlsPage
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public CrawlsPage() {
crawlsTable = new WebMarkupContainer("crawlsTable");
crawlsTable.setOutputMarkupId(true);
crawlsTable.add(new AjaxSelfUpdatingTimerBehavior(UPDATE_TIMEOUT));
RefreshingView<Crawl> crawls = new RefreshingView<Crawl>("crawls") {
@Override
protected Iterator<IModel<Crawl>> getItemModels() {
return new CpmIteratorAdapter<Crawl>(crawlService.getCrawls());
}
@Override
protected void populateItem(Item<Crawl> item) {
populateCrawlRow(item);
}
};
crawlsTable.add(crawls);
add(crawlsTable);
crawlPanel = new CrawlPanel("crawl");
add(crawlPanel);
add(new AjaxLink<Crawl>("newCrawl") {
@Override
public void onClick(AjaxRequestTarget target) {
editCrawl(target, new CompoundPropertyModel<Crawl>(createNewCrawl()));
}
});
}
示例7: DashboardPage
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public DashboardPage() {
panel = new WebMarkupContainer("panel");
panel.setOutputMarkupId(true);
panel.add(new AjaxSelfUpdatingTimerBehavior(Duration.ONE_SECOND));
panel.add(new Label("jobsRunning", new JobsModel()));
add(panel);
add(new BookmarkablePageLink<Void>("viewInstances", InstancesPage.class));
}
示例8: InstancesPage
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public InstancesPage() {
instancesTable = new WebMarkupContainer("instancesTable");
instancesTable.setOutputMarkupId(true);
instancesTable.add(new AjaxSelfUpdatingTimerBehavior(UPDATE_TIMEOUT));
instancePanel = new InstancePanel("instanceForm");
RefreshingView<NutchInstance> instances = refreshingView();
instancesTable.add(instances);
add(instancesTable);
add(instancePanel);
add(addInstanceButton());
}
示例9: addBehaviorSelfUpdating
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
private void addBehaviorSelfUpdating() {
refreshContainer.add(new AjaxSelfUpdatingTimerBehavior(ajaxRefreshPeriod) {
@Override
protected void onPostProcessTarget(AjaxRequestTarget target) {
updateEnvDetailsPanel(target);
}
});
}
示例10: LatestPricePanel
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public LatestPricePanel(String id) {
super(id);
WatchListDAO wld = new WatchListDAO();
TickPriceDAO tp = new TickPriceDAO();
WatchList[] watchList = wld.getWatchlistAsObject();
Tick[] linkList = new Tick[watchList.length];
ArrayList<Tick> lList = new ArrayList<Tick>();
for (int i = 0; i < watchList.length; i++) {
Tick t = tp.getLastPriceForSymbolAsObject(watchList[i].getSymbol(), "LAST");
if (t.getSymbol() != null) {
lList.add(t);
}
}
add(new ListView<Tick>("tickList", lList) {
@Override
protected void populateItem(ListItem item) {
// TODO Auto-generated method stub
Tick tick = (Tick) item.getModelObject();
item.add(new Label("Symbol", tick.getSymbol() + "@"
+ tick.getPrice()));
}
});
add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(5)));
}
示例11: createWidgetPanel
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
private WidgetPanel createWidgetPanel(String id, Widget widget, WidgetModel widgetModel) {
WidgetPanel widgetPanel = new WidgetPanel(id, widgetModel);
int refreshTime = WidgetUtil.getRefreshTime(dashboardService, widget);
if (refreshTime > 0) {
widgetPanel.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshTime)));
}
return widgetPanel;
}
示例12: onInitialize
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
@Override
protected void onInitialize() {
super.onInitialize();
final Label label = new Label("changingLabel", new PropertyModel<Long>(this, "timeTick"));
add(label);
//to test vary the duration for example (you need to refresh the page)
label.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)){
@Override
protected void onPostProcessTarget(final AjaxRequestTarget target) {
super.onPostProcessTarget(target);
timeTick = System.currentTimeMillis();
}
});
add(new SimplePanel("simplePanel"));
}
示例13: RealTimeTrendPanel
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
public RealTimeTrendPanel(String id, final String symbol) {
super(id);
TickPriceDAO tpd = new TickPriceDAO();
final int tickCount = tpd.getTickCount(symbol, "ASK");
final List list = new ArrayList();
list.add(tickCount / 100 * 10);
list.add(tickCount / 100 * 25);
list.add(tickCount / 100 * 50);
list.add(tickCount / 100 * 75);
list.add(tickCount);
final CalculatorFactory cf = new CalculatorFactory();
add(new Label("TotalCount", tickCount));
add(new Label("Symbol", symbol));
add(new ListView("TrendList", list) {
@Override
protected void populateItem(ListItem item) {
// TODO Auto-generated method stub
int length = (int) item.getModelObject();
// item.add(new Label("Age", length + "day: " + new
// TrendCalculator(symbol, length,
// "1 day").getPriceDifferenceInPct()));
item.add(new Label("Age", length
+ ": "
+ cf.round((new TrendCalculator(symbol, length,
"DOESNOTMATTER", "BID", false)
.getPriceDifferenceInPct()), 2)));
}
});
// Historic Trend Panel does not need to refresh itself
add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(30)));
}
示例14: initComponents
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
private void initComponents(long refreshDelayMillis) {
add(new AjaxSelfUpdatingTimerBehavior(Duration.milliseconds(refreshDelayMillis)));
add(new SimpleAttributeModifier("readonly", "readonly"));
}
示例15: changeGlobalSettings
import org.apache.wicket.ajax.AjaxSelfUpdatingTimerBehavior; //导入依赖的package包/类
private void changeGlobalSettings(WidgetRuntimeModel runtimeModel, AjaxRequestTarget target) {
ModalWindow.closeCurrent(target);
WidgetPanelVisitor visitor = new WidgetPanelVisitor();
visitChildren(WidgetPanel.class, visitor);
for (WidgetPanel widgetPanel : visitor.getWidgetPanels()) {
Widget widget = widgetPanel.getWidget();
if (widget == null) {
continue;
}
int oldRefreshTime = widget.getRefreshTime();
WidgetRuntimeModel storedRuntimeModel = ChartUtil.getRuntimeModel(storageService.getSettings(), (EntityWidget)widget, reportService, dataSourceService, true);
ChartUtil.updateGlobalWidget(widget, storedRuntimeModel, runtimeModel);
try {
dashboardService.modifyWidget(getDashboard().getId(), widget);
} catch (NotFoundException e) {
// never happening
throw new RuntimeException(e);
}
int refreshTime = widget.getRefreshTime();
if (oldRefreshTime != refreshTime) {
for (Behavior behavior : widgetPanel.getBehaviors()) {
if (behavior instanceof AjaxSelfUpdatingTimerBehavior) {
((AjaxSelfUpdatingTimerBehavior) behavior).stop(target);
// do not remove the behavior : after changing , the
// event is called one more
// time on the client so it has to be present ...
}
}
if (refreshTime > 0) {
widgetPanel.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshTime)));
}
}
}
/*
for (int i = 0; i < getDashboard().getColumnCount(); i++) {
target.add(getColumnPanel(i));
}
*/
target.add(this);
}