use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class PageAbout method initButtons.
private void initButtons() {
AjaxButton testRepository = new AjaxButton(ID_TEST_REPOSITORY, createStringResource("PageAbout.button.testRepository")) {
@Override
public void onClick(AjaxRequestTarget target) {
testRepositoryPerformed(target);
}
};
add(testRepository);
AjaxButton testRepositoryCheckOrgClosure = new AjaxButton(ID_TEST_REPOSITORY_CHECK_ORG_CLOSURE, createStringResource("PageAbout.button.testRepositoryCheckOrgClosure")) {
@Override
public void onClick(AjaxRequestTarget target) {
testRepositoryCheckOrgClosurePerformed(target);
}
};
add(testRepositoryCheckOrgClosure);
AjaxButton reindexRepositoryObjects = new AjaxButton(ID_REINDEX_REPOSITORY_OBJECTS, createStringResource("PageAbout.button.reindexRepositoryObjects")) {
@Override
public void onClick(AjaxRequestTarget target) {
reindexRepositoryObjectsPerformed(target);
}
};
add(reindexRepositoryObjects);
AjaxButton testProvisioning = new AjaxButton(ID_TEST_PROVISIONING, createStringResource("PageAbout.button.testProvisioning")) {
@Override
public void onClick(AjaxRequestTarget target) {
testProvisioningPerformed(target);
}
};
add(testProvisioning);
AjaxButton cleanupActivitiProcesses = new AjaxButton(ID_CLEANUP_ACTIVITI_PROCESSES, createStringResource("PageAbout.button.cleanupActivitiProcesses")) {
@Override
public void onClick(AjaxRequestTarget target) {
cleanupActivitiProcessesPerformed(target);
}
};
add(cleanupActivitiProcesses);
}
use of com.evolveum.midpoint.web.component.AjaxButton in project midpoint by Evolveum.
the class TaskMainPanel method initButtons.
private void initButtons(Form mainForm) {
WebMarkupContainer buttonPanel = new WebMarkupContainer(ID_BUTTON_PANEL);
buttonPanel.setOutputMarkupId(true);
mainForm.add(buttonPanel);
final TaskButtonsVisibility visibility = new TaskButtonsVisibility();
AjaxButton backButton = new AjaxButton(ID_BACK, parentPage.createStringResource("pageTaskEdit.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().backPerformed(target);
}
};
backButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeBackVisible(parentPage);
}
});
buttonPanel.add(backButton);
AjaxButton cancelEditingButton = new AjaxButton(ID_CANCEL_EDITING, parentPage.createStringResource("pageTaskEdit.button.cancelEditing")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().cancelEditingPerformed(target);
}
};
cancelEditingButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeCancelEditVisible(parentPage);
}
});
buttonPanel.add(cancelEditingButton);
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE, parentPage.createStringResource("pageTaskEdit.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
parentPage.getController().savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(parentPage.getFeedbackPanel());
}
};
saveButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeSaveVisible(parentPage);
}
});
mainForm.setDefaultButton(saveButton);
buttonPanel.add(saveButton);
AjaxButton editButton = new AjaxButton(ID_EDIT, parentPage.createStringResource("pageTaskEdit.button.edit")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.setEdit(true);
// stops refreshing as well
parentPage.refresh(target);
target.add(getMainForm());
}
};
editButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeEditVisible(parentPage);
}
});
buttonPanel.add(editButton);
AjaxButton suspend = new AjaxButton(ID_SUSPEND, parentPage.createStringResource("pageTaskEdit.button.suspend")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().suspendPerformed(target);
}
};
suspend.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeSuspendVisible(parentPage);
}
});
buttonPanel.add(suspend);
AjaxButton resume = new AjaxButton(ID_RESUME, parentPage.createStringResource("pageTaskEdit.button.resume")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().resumePerformed(target);
}
};
resume.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeResumeVisible(parentPage);
}
});
buttonPanel.add(resume);
AjaxButton runNow = new AjaxButton(ID_RUN_NOW, parentPage.createStringResource("pageTaskEdit.button.runNow")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().runNowPerformed(target);
}
};
runNow.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeRunNowVisible(parentPage);
}
});
buttonPanel.add(runNow);
AjaxButton stopApproval = new AjaxButton(ID_STOP_APPROVAL, parentPage.createStringResource("pageTaskEdit.button.stopApprovalProcess")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().stopApprovalProcessPerformed(target);
}
};
stopApproval.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeStopVisible(parentPage);
}
});
buttonPanel.add(stopApproval);
}
Aggregations