本文整理汇总了Java中org.apache.wicket.ajax.AbstractAjaxTimerBehavior类的典型用法代码示例。如果您正苦于以下问题:Java AbstractAjaxTimerBehavior类的具体用法?Java AbstractAjaxTimerBehavior怎么用?Java AbstractAjaxTimerBehavior使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AbstractAjaxTimerBehavior类属于org.apache.wicket.ajax包,在下文中一共展示了AbstractAjaxTimerBehavior类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AclsPage
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
/**
* Creates an acls page and opens the permission target for editing.
*
* @param ptiToEdit Permission target to edit
*/
public AclsPage(final MutablePermissionTargetInfo ptiToEdit) {
// only admins can reach here
if (!authService.isAdmin()) {
throw new UnauthorizedInstantiationException(AclsPage.class);
}
// create the panel
final PermissionTargetListPanel panel = new PermissionTargetListPanel("permissionTargetList");
add(panel);
if (ptiToEdit != null) {
// use very short ajax timer to open the edit panel
add(new AbstractAjaxTimerBehavior(Duration.milliseconds(1)) {
@Override
protected void onTimer(AjaxRequestTarget target) {
stop(); // don't fire again
ModalHandler modalHandler = ModalHandler.getInstanceFor(AclsPage.this);
modalHandler.setModalPanel(panel.newUpdateItemPanel(ptiToEdit));
modalHandler.show(target);
}
});
}
}
示例2: SystemLogsViewPanel
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
/**
* Main constructor
*
* @param id The verbal ID of the panel
*/
public SystemLogsViewPanel(String id) {
super(id);
addLogComboBox();
addSystemLogsSize();
addSystemLogsLink();
addSystemLogsContent();
addLastUpdate();
// add the timer behavior to the page and make it update both components
add(new AbstractAjaxTimerBehavior(Duration.seconds(ConstantValues.logsViewRefreshRateSecs.getInt())) {
@Override
protected void onTimer(AjaxRequestTarget target) {
updateComponents(target, (!systemLogFile.exists()));
}
});
}
示例3: scheduleMessageFetch
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
private void scheduleMessageFetch() {
add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
@Override
protected IAjaxCallDecorator getAjaxCallDecorator() {
return new NoAjaxIndicatorDecorator();
}
@Override
protected void onTimer(AjaxRequestTarget target) {
stop();
final Message message = artifactoryUpdatesService.getCachedMessage();
if (message != null && message != ArtifactoryUpdatesService.PROCESSING_MESSAGE) {
setupMessage(message);
target.add(ArtifactoryUpdatesPanel.this);
}
}
});
}
示例4: AjaxLazyPollingPanel
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
public AjaxLazyPollingPanel(String id, IModel<?> model, Duration updateInterval) {
super(id, model);
setOutputMarkupId(true);
add(new AbstractAjaxTimerBehavior(updateInterval) {
private static final long serialVersionUID = 1L;
@Override
protected void onTimer(AjaxRequestTarget target) {
if (isCompleted()) {
stop(target);
AjaxLazyPollingPanel.this.replace(getLazyLoadComponent(LAZY_LOAD_COMPONENT_ID));
target.add(AjaxLazyPollingPanel.this);
AjaxLazyPollingPanel.this.onTimerStop(this, target);
} else if (isFailed()) {
stop(target);
AjaxLazyPollingPanel.this.onTimerFailed(this, target);
} else {
target.add(AjaxLazyPollingPanel.this);
AjaxLazyPollingPanel.this.onTimerTick(this, target);
}
}
});
}
示例5: onConfigure
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
@Override
protected void onConfigure() {
super.onConfigure();
if (saveOnConfigure) {
saveOnConfigure = false;
add(new AbstractAjaxTimerBehavior(Duration.milliseconds(100)) {
@Override
protected void onTimer(AjaxRequestTarget target) {
stop(target);
savePerformed(target);
}
});
}
}
示例6: addAjaxTimer
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
protected void addAjaxTimer(final T itemObject) {
add(new AbstractAjaxTimerBehavior(Duration.milliseconds(1)) {
@Override
protected void onTimer(AjaxRequestTarget target) {
stop(); // don't fire again
ModalHandler modalHandler = ModalHandler.getInstanceFor(RepoListPanel.this);
modalHandler.setModalPanel(newUpdateItemPanel(itemObject));
modalHandler.show(target);
}
});
}
示例7: initComponents
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
@SuppressWarnings("serial")
private void initComponents() {
Component keepAliveComponent = new WebMarkupContainer("keepAlive");
add(keepAliveComponent);
if (ConstellioSession.get().getUser() != null) {
keepAliveComponent.add(new AbstractAjaxTimerBehavior(Duration.seconds(30)) {
@Override
protected void onTimer(AjaxRequestTarget target) {
// Do nothing, will prevent page from expiring
}
});
}
initStyling();
}
示例8: Index
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
public Index(String app) {
setVersioned(false);
final String theApp = LogService.isAppRegistered(app) ? app : null;
serverDate = new Label("serverDate", LogService.getFormattedDate(new Date()));
serverDate.setOutputMarkupId(true);
add(new Label("title", theApp != null ? String.format("[%s]@Web4Log", theApp) : "Web4Log"));
add(new Label("headerLabel", ConfigService.getString("header.label")));
add(serverDate);
appListContainer = new WebMarkupContainer("appListContainer");
appListContainer.setOutputMarkupId(true);
add(appListContainer);
appListContainer.add(new ListView<AppInfo>("appList", LogService.getAppList()) {
@Override
protected void populateItem(final ListItem<AppInfo> item) {
final AppInfo anAppInfo = item.getModelObject();
WebComponent stat = new WebComponent("stat");
stat.add(new AttributeModifier("class", anAppInfo.isConnected() ? "fa fa-link" : "fa fa-chain-broken"));
stat.add(new AttributeModifier("style", String.format("color:%s;", anAppInfo.isConnected() ? "#8aff27" : "red")));
Label selectedAppLbl = new Label("selectedApp", anAppInfo.getName());
Link<String> appLink = new Link<String>("appLink") {
@Override
public void onClick() {
setResponsePage(new Index(anAppInfo.getName()));
}
};
appLink.add(new Label("appLinkLabel", anAppInfo.getName()));
selectedAppLbl.setVisible(anAppInfo.getName().equals(theApp));
appLink.setVisible(!selectedAppLbl.isVisible());
item.add(stat);
item.add(selectedAppLbl);
item.add(appLink);
item.add(new DownloadLink("downloadLogFile", new File(LogService.getLogFileLocation(anAppInfo.getName())))
.setCacheDuration(Duration.NONE));
}
});
add(
new TailRemoteLogPanel("tailPanel")
.setRemoteApp(theApp)
.setVisible(theApp != null)
);
add(new AbstractAjaxTimerBehavior(Duration.ONE_MINUTE) {
@Override
protected void onTimer(AjaxRequestTarget target) {
serverDate.setDefaultModel(new Model<Serializable>(LogService.getFormattedDate(new Date())));
target.add(serverDate);
}
});
}
示例9: onTimerTick
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
/**
* Hook executed after each ajax polling timer tick.
*
* @param timer the timer being executed
* @param target the ajax request target
*/
protected void onTimerTick(AbstractAjaxTimerBehavior timer, AjaxRequestTarget target) {
// hook
}
示例10: onTimerStop
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
/**
* Hook executed after an ajax polling request was made, but the execution of the operation was already done and the
* content component has been replaced.
*
* @param timer the timer being executed
* @param target the ajax request target
*/
protected void onTimerStop(AbstractAjaxTimerBehavior timer, AjaxRequestTarget target) {
// hook
}
示例11: onTimerFailed
import org.apache.wicket.ajax.AbstractAjaxTimerBehavior; //导入依赖的package包/类
/**
* Hook executed after an ajax polling request was made, but the execution of the operation has failed. By default
* it re-throws the exception that was caught during execution.
*
* @param timer the timer being executed
* @param target the ajax request target
*/
protected void onTimerFailed(AbstractAjaxTimerBehavior timer, AjaxRequestTarget target) {
if (exception != null) {
throw new UncheckedExecutionException(exception);
}
}