本文整理汇总了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);
}
});
}
}
开发者ID:alancnet,项目名称:artifactory,代码行数:28,代码来源:AclsPage.java
示例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()));
}
});
}
开发者ID:alancnet,项目名称:artifactory,代码行数:22,代码来源:SystemLogsViewPanel.java
示例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);
}
}
});
}
开发者ID:alancnet,项目名称:artifactory,代码行数:19,代码来源:ArtifactoryUpdatesPanel.java
示例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);
}
}
});
}
开发者ID:flex-oss,项目名称:flex-ui,代码行数:27,代码来源:AjaxLazyPollingPanel.java
示例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);
}
});
}
}
开发者ID:Pardus-Engerek,项目名称:engerek,代码行数:15,代码来源:PageAdminObjectDetails.java
示例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);
}
});
}
开发者ID:alancnet,项目名称:artifactory,代码行数:12,代码来源:RepositoryConfigPage.java
示例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();
}
开发者ID:BassJel,项目名称:Jouve-Project,代码行数:16,代码来源:BaseConstellioPage.java
示例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);
}
});
}
开发者ID:mbizhani,项目名称:web4log,代码行数:58,代码来源:Index.java
示例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
}
开发者ID:flex-oss,项目名称:flex-ui,代码行数:10,代码来源:AjaxLazyPollingPanel.java
示例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
}
开发者ID:flex-oss,项目名称:flex-ui,代码行数:11,代码来源:AjaxLazyPollingPanel.java
示例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);
}
}
开发者ID:flex-oss,项目名称:flex-ui,代码行数:13,代码来源:AjaxLazyPollingPanel.java
注:本文中的org.apache.wicket.ajax.AbstractAjaxTimerBehavior类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论