use of org.apache.wicket.Component in project gitblit by gitblit.
the class RepositoriesPage method setup.
private void setup(PageParameters params) {
setupPage("", "");
// check to see if we should display a login message
boolean authenticateView = app().settings().getBoolean(Keys.web.authenticateViewPages, true);
if (authenticateView && !GitBlitWebSession.get().isLoggedIn()) {
String messageSource = app().settings().getString(Keys.web.loginMessage, "gitblit");
String message = readMarkdown(messageSource, "login.mkd");
Component repositoriesMessage = new Label("repositoriesMessage", message);
add(repositoriesMessage.setEscapeModelStrings(false));
add(new Label("repositoriesPanel"));
return;
}
// Load the markdown welcome message
String messageSource = app().settings().getString(Keys.web.repositoriesMessage, "gitblit");
String message = readMarkdown(messageSource, "welcome.mkd");
Component repositoriesMessage = new Label("repositoriesMessage", message).setEscapeModelStrings(false).setVisible(message.length() > 0);
add(repositoriesMessage);
// conditionally include personal repositories in this page
List<RepositoryModel> repositories = getRepositories(params);
if (!app().settings().getBoolean(Keys.web.includePersonalRepositories, true)) {
Iterator<RepositoryModel> itr = repositories.iterator();
while (itr.hasNext()) {
RepositoryModel rm = itr.next();
if (rm.isPersonalRepository()) {
itr.remove();
}
}
}
RepositoriesPanel repositoriesPanel = new RepositoriesPanel("repositoriesPanel", showAdmin, true, repositories, true, getAccessRestrictions());
// welcome message
if (!showAdmin && !repositoriesMessage.isVisible()) {
WicketUtils.setCssStyle(repositoriesPanel, "padding-top:5px;");
}
add(repositoriesPanel);
}
use of org.apache.wicket.Component in project gitblit by gitblit.
the class LinkPanel method setNoFollow.
public void setNoFollow() {
Component c = get("link");
c.add(new SimpleAttributeModifier("rel", "nofollow"));
}
use of org.apache.wicket.Component in project gitblit by gitblit.
the class SimpleAjaxLink method setNoFollow.
public void setNoFollow() {
Component c = get("link");
c.add(new SimpleAttributeModifier("rel", "nofollow"));
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class CheckBoxHeaderColumn method findCheckBoxColumnHeader.
public static CheckBoxPanel findCheckBoxColumnHeader(DataTable table) {
WebMarkupContainer topToolbars = table.getTopToolbars();
ComponentHierarchyIterator iterator = topToolbars.visitChildren(TableHeadersToolbar.class);
if (!iterator.hasNext()) {
return null;
}
TableHeadersToolbar toolbar = (TableHeadersToolbar) iterator.next();
// simple attempt to find checkbox which is header for our column
// todo: this search will fail if there are more checkbox header columns (which is not supported now,
// because Selectable.F_SELECTED is hardcoded all over the place...
iterator = toolbar.visitChildren(CheckBoxPanel.class);
while (iterator.hasNext()) {
Component c = iterator.next();
if (!c.getOutputMarkupId()) {
continue;
}
return (CheckBoxPanel) c;
}
return null;
}
use of org.apache.wicket.Component in project midpoint by Evolveum.
the class UploadDownloadPanel method uploadFilePerformed.
public void uploadFilePerformed(AjaxRequestTarget target) {
Component input = get(ID_INPUT_FILE);
try {
FileUpload uploadedFile = getFileUpload();
updateValue(uploadedFile.getBytes());
LOGGER.trace("Upload file success.");
input.success(getString("UploadPanel.message.uploadSuccess"));
} catch (Exception e) {
LOGGER.trace("Upload file error.", e);
input.error(getString("UploadPanel.message.uploadError") + " " + e.getMessage());
}
}
Aggregations