summaryrefslogtreecommitdiffstats
path: root/src/main/java/com/gitblit/wicket/panels
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/gitblit/wicket/panels')
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ActivityPanel.java10
-rw-r--r--src/main/java/com/gitblit/wicket/panels/BasePanel.java12
-rw-r--r--src/main/java/com/gitblit/wicket/panels/BranchesPanel.java15
-rw-r--r--src/main/java/com/gitblit/wicket/panels/BulletListPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/CommitLegendPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java11
-rw-r--r--src/main/java/com/gitblit/wicket/panels/DigestsPanel.java36
-rw-r--r--src/main/java/com/gitblit/wicket/panels/DropDownMenu.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/FederationProposalsPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/FederationRegistrationsPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/FederationTokensPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/FilterableProjectList.java28
-rw-r--r--src/main/java/com/gitblit/wicket/panels/FilterableRepositoryList.java38
-rw-r--r--src/main/java/com/gitblit/wicket/panels/GravatarImage.java8
-rw-r--r--src/main/java/com/gitblit/wicket/panels/HistoryPanel.java25
-rw-r--r--src/main/java/com/gitblit/wicket/panels/LinkPanel.java2
-rw-r--r--src/main/java/com/gitblit/wicket/panels/LogPanel.java11
-rw-r--r--src/main/java/com/gitblit/wicket/panels/NavigationPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ObjectContainer.java4
-rw-r--r--src/main/java/com/gitblit/wicket/panels/PagerPanel.java7
-rw-r--r--src/main/java/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ReflogPanel.java40
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RefsPanel.java13
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java45
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java11
-rw-r--r--src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java71
-rw-r--r--src/main/java/com/gitblit/wicket/panels/SearchPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/ShockWaveComponent.java10
-rw-r--r--src/main/java/com/gitblit/wicket/panels/TagsPanel.java3
-rw-r--r--src/main/java/com/gitblit/wicket/panels/TeamsPanel.java1
-rw-r--r--src/main/java/com/gitblit/wicket/panels/UsersPanel.java3
31 files changed, 225 insertions, 188 deletions
diff --git a/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java b/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
index b509f655..e5c8e464 100644
--- a/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/ActivityPanel.java
@@ -40,9 +40,9 @@ import com.gitblit.wicket.pages.TreePage;
/**
* Renders activity in day-blocks in reverse-chronological order.
- *
+ *
* @author James Moger
- *
+ *
*/
public class ActivityPanel extends BasePanel {
@@ -52,12 +52,13 @@ public class ActivityPanel extends BasePanel {
super(wicketId);
Collections.sort(recentActivity);
-
+
final int shortHashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);
DataView<Activity> activityView = new DataView<Activity>("activity",
new ListDataProvider<Activity>(recentActivity)) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<Activity> activityItem) {
final Activity entry = activityItem.getModelObject();
activityItem.add(WicketUtils.createDatestampLabel("title", entry.startDate, getTimeZone(), getTimeUtils()));
@@ -67,6 +68,7 @@ public class ActivityPanel extends BasePanel {
new ListDataProvider<RepositoryCommit>(entry.getCommits())) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RepositoryCommit> commitItem) {
final RepositoryCommit commit = commitItem.getModelObject();
@@ -138,7 +140,7 @@ public class ActivityPanel extends BasePanel {
WicketUtils.newObjectParameter(commit.repository, commit.getName()))
.setEnabled(commit.getParentCount() > 0));
commitItem.add(new BookmarkablePageLink<Void>("tree", TreePage.class,
- WicketUtils.newObjectParameter(commit.repository, commit.getName())));
+ WicketUtils.newObjectParameter(commit.repository, commit.getName())));
}
};
activityItem.add(commits);
diff --git a/src/main/java/com/gitblit/wicket/panels/BasePanel.java b/src/main/java/com/gitblit/wicket/panels/BasePanel.java
index e4aeeb02..b60579b7 100644
--- a/src/main/java/com/gitblit/wicket/panels/BasePanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/BasePanel.java
@@ -33,7 +33,7 @@ import com.gitblit.wicket.WicketUtils;
public abstract class BasePanel extends Panel {
private static final long serialVersionUID = 1L;
-
+
private transient TimeUtils timeUtils;
public BasePanel(String wicketId) {
@@ -44,10 +44,10 @@ public abstract class BasePanel extends Panel {
return GitBlit.getBoolean(Keys.web.useClientTimezone, false) ? GitBlitWebSession.get()
.getTimezone() : GitBlit.getTimezone();
}
-
+
protected TimeUtils getTimeUtils() {
if (timeUtils == null) {
- ResourceBundle bundle;
+ ResourceBundle bundle;
try {
bundle = ResourceBundle.getBundle("com.gitblit.wicket.GitBlitWebApp", GitBlitWebSession.get().getLocale());
} catch (Throwable t) {
@@ -57,7 +57,7 @@ public abstract class BasePanel extends Panel {
}
return timeUtils;
}
-
+
protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {
if (searchType.equals(Constants.SearchType.AUTHOR)) {
WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);
@@ -74,6 +74,7 @@ public abstract class BasePanel extends Panel {
super(event, true, new Model<String>(msg));
}
+ @Override
protected String newValue(final String currentValue, final String replacementValue) {
String prefix = "var conf = confirm('" + replacementValue + "'); "
+ "if (!conf) return false; ";
@@ -90,12 +91,13 @@ public abstract class BasePanel extends Panel {
private static final long serialVersionUID = 1L;
private String initialValue = "";
-
+
public JavascriptTextPrompt(String event, String msg, String value) {
super(event, true, new Model<String>(msg));
initialValue = value;
}
+ @Override
protected String newValue(final String currentValue, final String message) {
String result = "var userText = prompt('" + message + "','"
+ (initialValue == null ? "" : initialValue) + "'); " + "return userText; ";
diff --git a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
index dba40897..4981c8b2 100644
--- a/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/BranchesPanel.java
@@ -101,15 +101,16 @@ public class BranchesPanel extends BasePanel {
// branches page
add(new Label("branches", new StringResourceModel("gb.branches", this, null)));
}
-
+
// only allow delete if we have multiple branches
final boolean showDelete = showAdmin && branches.size() > 1;
-
+
ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);
DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) {
private static final long serialVersionUID = 1L;
int counter;
+ @Override
public void populateItem(final Item<RefModel> item) {
final RefModel entry = item.getModelObject();
@@ -136,7 +137,7 @@ public class BranchesPanel extends BasePanel {
WicketUtils.setHtmlTooltip(shortlog, shortMessage);
}
item.add(shortlog);
-
+
if (maxCount <= 0) {
Fragment fragment = new Fragment("branchLinks", showDelete? "branchPageAdminLinks" : "branchPageLinks", this);
fragment.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils
@@ -219,15 +220,15 @@ public class BranchesPanel extends BasePanel {
RefLogUtils.deleteRef(user, r, ref);
}
}
-
+
if (success) {
- info(MessageFormat.format("Branch \"{0}\" deleted", branch));
+ info(MessageFormat.format("Branch \"{0}\" deleted", branch));
} else {
error(MessageFormat.format("Failed to delete branch \"{0}\"", branch));
}
}
r.close();
-
+
// redirect to the owning page
PageParameters params = WicketUtils.newRepositoryParameter(repositoryModel.name);
String relativeUrl = urlFor(getPage().getClass(), params).toString();
@@ -235,7 +236,7 @@ public class BranchesPanel extends BasePanel {
getRequestCycle().setRequestTarget(new RedirectRequestTarget(absoluteUrl));
}
};
-
+
deleteLink.add(new JavascriptEventConfirmation("onclick", MessageFormat.format(
"Delete branch \"{0}\"?", entry.displayName )));
return deleteLink;
diff --git a/src/main/java/com/gitblit/wicket/panels/BulletListPanel.java b/src/main/java/com/gitblit/wicket/panels/BulletListPanel.java
index e49223e0..defc08e2 100644
--- a/src/main/java/com/gitblit/wicket/panels/BulletListPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/BulletListPanel.java
@@ -38,6 +38,7 @@ public class BulletListPanel extends Panel {
DataView<String> listView = new DataView<String>("list", listDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<String> item) {
String entry = item.getModelObject();
item.add(new Label("listItem", entry));
diff --git a/src/main/java/com/gitblit/wicket/panels/CommitLegendPanel.java b/src/main/java/com/gitblit/wicket/panels/CommitLegendPanel.java
index 1e906ef7..3f31effe 100644
--- a/src/main/java/com/gitblit/wicket/panels/CommitLegendPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/CommitLegendPanel.java
@@ -44,6 +44,7 @@ public class CommitLegendPanel extends Panel {
DataView<ChangeType> legendsView = new DataView<ChangeType>("legend", legendDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<ChangeType> item) {
ChangeType entry = item.getModelObject();
diff --git a/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java b/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java
index 122ae55e..d8a4a106 100644
--- a/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/CompressedDownloadsPanel.java
@@ -17,7 +17,6 @@ package com.gitblit.wicket.panels;
import java.util.List;
-import org.apache.wicket.Component;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.markup.repeater.Item;
@@ -35,13 +34,13 @@ public class CompressedDownloadsPanel extends Panel {
public CompressedDownloadsPanel(String id, final String baseUrl, final String repositoryName, final String objectId, final String path) {
super(id);
-
+
List<String> types = GitBlit.getStrings(Keys.web.compressedDownloads);
if (types.isEmpty()) {
types.add(Format.zip.name());
types.add(Format.gz.name());
}
-
+
ListDataProvider<String> refsDp = new ListDataProvider<String>(types);
DataView<String> refsView = new DataView<String>("compressedLinks", refsDp) {
private static final long serialVersionUID = 1L;
@@ -52,12 +51,12 @@ public class CompressedDownloadsPanel extends Panel {
super.onBeforeRender();
counter = 0;
}
-
+
@Override
public void populateItem(final Item<String> item) {
String compressionType = item.getModelObject();
Format format = Format.fromName(compressionType);
-
+
String href = DownloadZipServlet.asLink(baseUrl, repositoryName,
objectId, path, format);
LinkPanel c = new LinkPanel("compressedLink", null, format.name(), href);
@@ -72,7 +71,7 @@ public class CompressedDownloadsPanel extends Panel {
}
};
add(refsView);
-
+
setVisible(GitBlit.getBoolean(Keys.web.allowZipDownloads, true));
}
} \ No newline at end of file
diff --git a/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java b/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
index 3590dfee..10d5d1b3 100644
--- a/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/DigestsPanel.java
@@ -49,7 +49,7 @@ public class DigestsPanel extends BasePanel {
private static final long serialVersionUID = 1L;
private final boolean hasChanges;
-
+
private boolean hasMore;
public DigestsPanel(String wicketId, List<DailyLogEntry> digests) {
@@ -63,11 +63,12 @@ public class DigestsPanel extends BasePanel {
final DateFormat df = new SimpleDateFormat(dateFormat);
df.setTimeZone(timezone);
final Calendar cal = Calendar.getInstance(timezone);
-
+
ListDataProvider<DailyLogEntry> dp = new ListDataProvider<DailyLogEntry>(digests);
DataView<DailyLogEntry> pushView = new DataView<DailyLogEntry>("change", dp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<DailyLogEntry> logItem) {
final DailyLogEntry change = logItem.getModelObject();
String fullRefName = change.getChangedRefs().get(0);
@@ -79,7 +80,7 @@ public class DigestsPanel extends BasePanel {
shortRefName = shortRefName.substring(Constants.R_TAGS.length());
isTag = true;
}
-
+
String fuzzydate;
TimeUtils tu = getTimeUtils();
Date pushDate = change.date;
@@ -122,7 +123,7 @@ public class DigestsPanel extends BasePanel {
} else {
logItem.add(new Label("whoChanged").setVisible(false));
}
-
+
String preposition = "gb.of";
boolean isDelete = false;
String what;
@@ -150,17 +151,17 @@ public class DigestsPanel extends BasePanel {
break;
default:
what = MessageFormat.format(change.getCommitCount() > 1 ? getString("gb.commitsTo") : getString("gb.oneCommitTo"), change.getCommitCount());
-
+
if (change.getAuthorCount() == 1) {
by = MessageFormat.format(getString("gb.byOneAuthor"), change.getAuthorIdent().getName());
} else {
- by = MessageFormat.format(getString("gb.byNAuthors"), change.getAuthorCount());
+ by = MessageFormat.format(getString("gb.byNAuthors"), change.getAuthorCount());
}
break;
}
logItem.add(new Label("whatChanged", what));
logItem.add(new Label("byAuthors", by).setVisible(!StringUtils.isEmpty(by)));
-
+
if (isDelete) {
// can't link to deleted ref
logItem.add(new Label("refChanged", shortRefName));
@@ -173,19 +174,19 @@ public class DigestsPanel extends BasePanel {
logItem.add(new LinkPanel("refChanged", null, shortRefName,
TreePage.class, WicketUtils.newObjectParameter(change.repository, fullRefName)));
}
-
+
// to/from/etc
logItem.add(new Label("repoPreposition", getString(preposition)));
String repoName = StringUtils.stripDotGit(change.repository);
logItem.add(new LinkPanel("repoChanged", null, repoName,
SummaryPage.class, WicketUtils.newRepositoryParameter(change.repository)));
-
+
int maxCommitCount = 5;
List<RepositoryCommit> commits = change.getCommits();
if (commits.size() > maxCommitCount) {
- commits = new ArrayList<RepositoryCommit>(commits.subList(0, maxCommitCount));
+ commits = new ArrayList<RepositoryCommit>(commits.subList(0, maxCommitCount));
}
-
+
// compare link
String compareLinkText = null;
if ((change.getCommitCount() <= maxCommitCount) && (change.getCommitCount() > 1)) {
@@ -201,20 +202,21 @@ public class DigestsPanel extends BasePanel {
String startRangeId = change.getOldId(fullRefName);
logItem.add(new LinkPanel("compareLink", null, compareLinkText, ComparePage.class, WicketUtils.newRangeParameter(change.repository, startRangeId, endRangeId)));
}
-
+
final boolean showSwatch = GitBlit.getBoolean(Keys.web.repositoryListSwatches, true);
-
+
ListDataProvider<RepositoryCommit> cdp = new ListDataProvider<RepositoryCommit>(commits);
DataView<RepositoryCommit> commitsView = new DataView<RepositoryCommit>("commit", cdp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RepositoryCommit> commitItem) {
final RepositoryCommit commit = commitItem.getModelObject();
// author gravatar
commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent().getName(),
commit.getAuthorIdent().getEmailAddress(), null, 16, false, false));
-
+
// merge icon
if (commit.getParentCount() > 1) {
commitItem.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
@@ -245,7 +247,7 @@ public class DigestsPanel extends BasePanel {
WicketUtils.setCssClass(commitHash, "shortsha1");
WicketUtils.setHtmlTooltip(commitHash, commit.getName());
commitItem.add(commitHash);
-
+
if (showSwatch) {
// set repository color
String color = StringUtils.getColor(StringUtils.stripDotGit(change.repository));
@@ -257,14 +259,14 @@ public class DigestsPanel extends BasePanel {
logItem.add(commitsView);
}
};
-
+
add(pushView);
}
public boolean hasMore() {
return hasMore;
}
-
+
public boolean hideIfEmpty() {
setVisible(hasChanges);
return hasChanges;
diff --git a/src/main/java/com/gitblit/wicket/panels/DropDownMenu.java b/src/main/java/com/gitblit/wicket/panels/DropDownMenu.java
index 60a8a3d2..d1a632e2 100644
--- a/src/main/java/com/gitblit/wicket/panels/DropDownMenu.java
+++ b/src/main/java/com/gitblit/wicket/panels/DropDownMenu.java
@@ -38,6 +38,7 @@ public class DropDownMenu extends Panel {
DataView<DropDownMenuItem> view = new DataView<DropDownMenuItem>("menuItems", items) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<DropDownMenuItem> item) {
DropDownMenuItem entry = item.getModelObject();
if (entry.isDivider()) {
diff --git a/src/main/java/com/gitblit/wicket/panels/FederationProposalsPanel.java b/src/main/java/com/gitblit/wicket/panels/FederationProposalsPanel.java
index 3e70ccec..c15a0a5c 100644
--- a/src/main/java/com/gitblit/wicket/panels/FederationProposalsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/FederationProposalsPanel.java
@@ -52,6 +52,7 @@ public class FederationProposalsPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<FederationProposal> item) {
final FederationProposal entry = item.getModelObject();
item.add(new LinkPanel("url", "list", entry.url, ReviewProposalPage.class,
diff --git a/src/main/java/com/gitblit/wicket/panels/FederationRegistrationsPanel.java b/src/main/java/com/gitblit/wicket/panels/FederationRegistrationsPanel.java
index ff947175..344af49d 100644
--- a/src/main/java/com/gitblit/wicket/panels/FederationRegistrationsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/FederationRegistrationsPanel.java
@@ -55,6 +55,7 @@ public class FederationRegistrationsPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<FederationModel> item) {
final FederationModel entry = item.getModelObject();
item.add(new LinkPanel("url", "list", entry.url, FederationRegistrationPage.class,
diff --git a/src/main/java/com/gitblit/wicket/panels/FederationTokensPanel.java b/src/main/java/com/gitblit/wicket/panels/FederationTokensPanel.java
index 3454492f..afe553c5 100644
--- a/src/main/java/com/gitblit/wicket/panels/FederationTokensPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/FederationTokensPanel.java
@@ -71,6 +71,7 @@ public class FederationTokensPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<String[]> item) {
final String[] entry = item.getModelObject();
final FederationToken token = FederationToken.fromName(entry[0]);
diff --git a/src/main/java/com/gitblit/wicket/panels/FilterableProjectList.java b/src/main/java/com/gitblit/wicket/panels/FilterableProjectList.java
index a5b74131..4c579264 100644
--- a/src/main/java/com/gitblit/wicket/panels/FilterableProjectList.java
+++ b/src/main/java/com/gitblit/wicket/panels/FilterableProjectList.java
@@ -39,8 +39,8 @@ import com.gitblit.wicket.ng.NgController;
/**
* A client-side filterable rich project list which uses Freemarker, Wicket,
- * and AngularJS.
- *
+ * and AngularJS.
+ *
* @author James Moger
*
*/
@@ -49,21 +49,21 @@ public class FilterableProjectList extends BasePanel {
private static final long serialVersionUID = 1L;
private final List<ProjectModel> projects;
-
+
private String title;
-
+
private String iconClass;
-
+
public FilterableProjectList(String id, List<ProjectModel> projects) {
super(id);
this.projects = projects;
}
-
+
public void setTitle(String title, String iconClass) {
this.title = title;
this.iconClass = iconClass;
}
-
+
@Override
protected void onInitialize() {
super.onInitialize();
@@ -71,18 +71,18 @@ public class FilterableProjectList extends BasePanel {
String id = getId();
String ngCtrl = id + "Ctrl";
String ngList = id + "List";
-
+
Map<String, Object> values = new HashMap<String, Object>();
values.put("ngCtrl", ngCtrl);
values.put("ngList", ngList);
-
+
// use Freemarker to setup an AngularJS/Wicket html snippet
FreemarkerPanel panel = new FreemarkerPanel("listComponent", "FilterableProjectList.fm", values);
panel.setParseGeneratedMarkup(true);
panel.setRenderBodyOnly(true);
add(panel);
-
- // add the Wicket controls that are referenced in the snippet
+
+ // add the Wicket controls that are referenced in the snippet
String listTitle = StringUtils.isEmpty(title) ? getString("gb.projects") : title;
panel.add(new Label(ngList + "Title", MessageFormat.format("{0} ({1})", listTitle, projects.size())));
if (StringUtils.isEmpty(iconClass)) {
@@ -92,7 +92,7 @@ public class FilterableProjectList extends BasePanel {
WicketUtils.setCssClass(icon, iconClass);
panel.add(icon);
}
-
+
String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
final DateFormat df = new SimpleDateFormat(format);
df.setTimeZone(getTimeZone());
@@ -118,7 +118,7 @@ public class FilterableProjectList extends BasePanel {
item.c = proj.repositories.size();
list.add(item);
}
-
+
// inject an AngularJS controller with static data
NgController ctrl = new NgController(ngCtrl);
ctrl.addVariable(ngList, list);
@@ -128,7 +128,7 @@ public class FilterableProjectList extends BasePanel {
protected class ProjectListItem implements Serializable {
private static final long serialVersionUID = 1L;
-
+
String p; // path
String n; // name
String t; // time ago
diff --git a/src/main/java/com/gitblit/wicket/panels/FilterableRepositoryList.java b/src/main/java/com/gitblit/wicket/panels/FilterableRepositoryList.java
index 6c43b787..d68155e7 100644
--- a/src/main/java/com/gitblit/wicket/panels/FilterableRepositoryList.java
+++ b/src/main/java/com/gitblit/wicket/panels/FilterableRepositoryList.java
@@ -38,8 +38,8 @@ import com.gitblit.wicket.pages.EditRepositoryPage;
/**
* A client-side filterable rich repository list which uses Freemarker, Wicket,
- * and AngularJS.
- *
+ * and AngularJS.
+ *
* @author James Moger
*
*/
@@ -48,23 +48,23 @@ public class FilterableRepositoryList extends BasePanel {
private static final long serialVersionUID = 1L;
private final List<RepositoryModel> repositories;
-
+
private String title;
-
+
private String iconClass;
-
+
private boolean allowCreate;
-
+
public FilterableRepositoryList(String id, List<RepositoryModel> repositories) {
super(id);
this.repositories = repositories;
}
-
+
public void setTitle(String title, String iconClass) {
this.title = title;
this.iconClass = iconClass;
}
-
+
public void setAllowCreate(boolean value) {
this.allowCreate = value;
}
@@ -76,18 +76,18 @@ public class FilterableRepositoryList extends BasePanel {
String id = getId();
String ngCtrl = id + "Ctrl";
String ngList = id + "List";
-
+
Map<String, Object> values = new HashMap<String, Object>();
values.put("ngCtrl", ngCtrl);
values.put("ngList", ngList);
-
+
// use Freemarker to setup an AngularJS/Wicket html snippet
FreemarkerPanel panel = new FreemarkerPanel("listComponent", "FilterableRepositoryList.fm", values);
panel.setParseGeneratedMarkup(true);
panel.setRenderBodyOnly(true);
add(panel);
-
- // add the Wicket controls that are referenced in the snippet
+
+ // add the Wicket controls that are referenced in the snippet
String listTitle = StringUtils.isEmpty(title) ? getString("gb.repositories") : title;
panel.add(new Label(ngList + "Title", MessageFormat.format("{0} ({1})", listTitle, repositories.size())));
if (StringUtils.isEmpty(iconClass)) {
@@ -97,13 +97,13 @@ public class FilterableRepositoryList extends BasePanel {
WicketUtils.setCssClass(icon, iconClass);
panel.add(icon);
}
-
+
if (allowCreate) {
panel.add(new LinkPanel(ngList + "Button", "btn btn-mini", getString("gb.newRepository"), EditRepositoryPage.class));
} else {
panel.add(new Label(ngList + "Button").setVisible(false));
}
-
+
String format = GitBlit.getString(Keys.web.datestampShortFormat, "MM/dd/yy");
final DateFormat df = new SimpleDateFormat(format);
df.setTimeZone(getTimeZone());
@@ -111,13 +111,13 @@ public class FilterableRepositoryList extends BasePanel {
// prepare the simplified repository models list
List<RepoListItem> list = new ArrayList<RepoListItem>();
for (RepositoryModel repo : repositories) {
- String name = StringUtils.stripDotGit(repo.name);
+ String name = StringUtils.stripDotGit(repo.name);
String path = "";
if (name.indexOf('/') > -1) {
path = name.substring(0, name.lastIndexOf('/') + 1);
name = name.substring(name.lastIndexOf('/') + 1);
}
-
+
RepoListItem item = new RepoListItem();
item.n = name;
item.p = path;
@@ -130,17 +130,17 @@ public class FilterableRepositoryList extends BasePanel {
item.wc = repo.isBare ? 0 : 1;
list.add(item);
}
-
+
// inject an AngularJS controller with static data
NgController ctrl = new NgController(ngCtrl);
ctrl.addVariable(ngList, list);
add(new HeaderContributor(ctrl));
}
-
+
protected class RepoListItem implements Serializable {
private static final long serialVersionUID = 1L;
-
+
String r; // repository
String n; // name
String p; // project/path
diff --git a/src/main/java/com/gitblit/wicket/panels/GravatarImage.java b/src/main/java/com/gitblit/wicket/panels/GravatarImage.java
index da20e9b8..741328c3 100644
--- a/src/main/java/com/gitblit/wicket/panels/GravatarImage.java
+++ b/src/main/java/com/gitblit/wicket/panels/GravatarImage.java
@@ -33,9 +33,9 @@ import com.gitblit.wicket.pages.GravatarProfilePage;
/**
* Represents a Gravatar image and links to the Gravatar profile page.
- *
+ *
* @author James Moger
- *
+ *
*/
public class GravatarImage extends Panel {
@@ -44,7 +44,7 @@ public class GravatarImage extends Panel {
public GravatarImage(String id, PersonIdent person) {
this(id, person, 0);
}
-
+
public GravatarImage(String id, PersonIdent person, int width) {
this(id, person, width, true);
}
@@ -52,7 +52,7 @@ public class GravatarImage extends Panel {
public GravatarImage(String id, PersonIdent person, int width, boolean linked) {
this(id, person.getName(), person.getEmailAddress(), "gravatar", width, linked, true);
}
-
+
public GravatarImage(String id, String username, String emailaddress, String cssClass, int width, boolean linked, boolean identicon) {
super(id);
diff --git a/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java b/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java
index 5e03e01b..10a8b570 100644
--- a/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/HistoryPanel.java
@@ -107,13 +107,13 @@ public class HistoryPanel extends BasePanel {
tw.release();
}
}
-
+
final boolean isTree = matchingPath == null ? true : matchingPath.isTree();
final boolean isSubmodule = matchingPath == null ? false : matchingPath.isSubmodule();
// submodule
final String submodulePath;
- final boolean hasSubmodule;
+ final boolean hasSubmodule;
if (isSubmodule) {
SubmoduleModel submodule = getSubmodule(submodules, repositoryName, matchingPath == null ? null : matchingPath.path);
submodulePath = submodule.gitblitPath;
@@ -122,7 +122,7 @@ public class HistoryPanel extends BasePanel {
submodulePath = "";
hasSubmodule = false;
}
-
+
final Map<ObjectId, List<RefModel>> allRefs = JGitUtils.getAllRefs(r, showRemoteRefs);
List<RevCommit> commits;
if (pageResults) {
@@ -149,6 +149,7 @@ public class HistoryPanel extends BasePanel {
private static final long serialVersionUID = 1L;
int counter;
+ @Override
public void populateItem(final Item<RevCommit> item) {
final RevCommit entry = item.getModelObject();
final Date date = JGitUtils.getCommitDate(entry);
@@ -195,9 +196,9 @@ public class HistoryPanel extends BasePanel {
TreePage.class, WicketUtils.newObjectParameter(
repositoryName, entry.getName()));
WicketUtils.setCssClass(commitHash, "shortsha1");
- WicketUtils.setHtmlTooltip(commitHash, entry.getName());
+ WicketUtils.setHtmlTooltip(commitHash, entry.getName());
item.add(commitHash);
-
+
Fragment links = new Fragment("historyLinks", "treeLinks", this);
links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,
WicketUtils.newObjectParameter(repositoryName, entry.getName())));
@@ -218,14 +219,14 @@ public class HistoryPanel extends BasePanel {
TreePage.class, WicketUtils.newObjectParameter(
submodulePath, submoduleId));
WicketUtils.setCssClass(commitHash, "shortsha1");
- WicketUtils.setHtmlTooltip(commitHash, submoduleId);
+ WicketUtils.setHtmlTooltip(commitHash, submoduleId);
item.add(commitHash.setEnabled(hasSubmodule));
}
Fragment links = new Fragment("historyLinks", "treeLinks", this);
links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,
WicketUtils.newObjectParameter(repositoryName, entry.getName())));
item.add(links);
- } else {
+ } else {
// commit
item.add(new Label("hashLabel", getString("gb.blob") + "@"));
LinkPanel commitHash = new LinkPanel("hashLink", null, entry.getName().substring(0, hashLen),
@@ -234,7 +235,7 @@ public class HistoryPanel extends BasePanel {
WicketUtils.setCssClass(commitHash, "sha1");
WicketUtils.setHtmlTooltip(commitHash, entry.getName());
item.add(commitHash);
-
+
Fragment links = new Fragment("historyLinks", "blobLinks", this);
links.add(new BookmarkablePageLink<Void>("commitdiff", CommitDiffPage.class,
WicketUtils.newObjectParameter(repositoryName, entry.getName())));
@@ -276,7 +277,7 @@ public class HistoryPanel extends BasePanel {
public boolean hasMore() {
return hasMore;
}
-
+
protected SubmoduleModel getSubmodule(Map<String, SubmoduleModel> submodules, String repositoryName, String path) {
SubmoduleModel model = submodules.get(path);
if (model == null) {
@@ -289,7 +290,7 @@ public class HistoryPanel extends BasePanel {
// extract the repository name from the clone url
List<String> patterns = GitBlit.getStrings(Keys.git.submoduleUrlPatterns);
String submoduleName = StringUtils.extractRepositoryPath(model.url, patterns.toArray(new String[0]));
-
+
// determine the current path for constructing paths relative
// to the current repository
String currentPath = "";
@@ -332,10 +333,10 @@ public class HistoryPanel extends BasePanel {
return model;
}
}
-
+
// we do not have a copy of the submodule, but we need a path
model.gitblitPath = candidates.get(0);
return model;
- }
+ }
}
}
diff --git a/src/main/java/com/gitblit/wicket/panels/LinkPanel.java b/src/main/java/com/gitblit/wicket/panels/LinkPanel.java
index 21470b27..cdcf574f 100644
--- a/src/main/java/com/gitblit/wicket/panels/LinkPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/LinkPanel.java
@@ -107,7 +107,7 @@ public class LinkPanel extends Panel {
link.add(new Label("label", labelModel));
add(link);
}
-
+
public void setNoFollow() {
Component c = get("link");
c.add(new SimpleAttributeModifier("rel", "nofollow"));
diff --git a/src/main/java/com/gitblit/wicket/panels/LogPanel.java b/src/main/java/com/gitblit/wicket/panels/LogPanel.java
index a9f80db9..eba0dd3b 100644
--- a/src/main/java/com/gitblit/wicket/panels/LogPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/LogPanel.java
@@ -32,10 +32,10 @@ import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
+import com.gitblit.BranchGraphServlet;
import com.gitblit.Constants;
import com.gitblit.GitBlit;
import com.gitblit.Keys;
-import com.gitblit.BranchGraphServlet;
import com.gitblit.models.RefModel;
import com.gitblit.utils.JGitUtils;
import com.gitblit.utils.StringUtils;
@@ -75,10 +75,10 @@ public class LogPanel extends BasePanel {
// inaccurate way to determine if there are more commits.
// works unless commits.size() represents the exact end.
hasMore = commits.size() >= itemsPerPage;
-
+
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
final boolean showGraph = GitBlit.getBoolean(Keys.web.showBranchGraph, true);
-
+
MarkupContainer graph = new WebMarkupContainer("graph");
add(graph);
if (!showGraph || commits.isEmpty()) {
@@ -107,6 +107,7 @@ public class LogPanel extends BasePanel {
private static final long serialVersionUID = 1L;
int counter;
+ @Override
public void populateItem(final Item<RevCommit> item) {
final RevCommit entry = item.getModelObject();
final Date date = JGitUtils.getCommitDate(entry);
@@ -120,7 +121,7 @@ public class LogPanel extends BasePanel {
objectId, author, Constants.SearchType.AUTHOR));
setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);
item.add(authorLink);
-
+
// merge icon
if (entry.getParentCount() > 1) {
item.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
@@ -153,7 +154,7 @@ public class LogPanel extends BasePanel {
WicketUtils.setCssClass(commitHash, "shortsha1");
WicketUtils.setHtmlTooltip(commitHash, entry.getName());
item.add(commitHash);
-
+
item.add(new BookmarkablePageLink<Void>("diff", CommitDiffPage.class, WicketUtils
.newObjectParameter(repositoryName, entry.getName())).setEnabled(entry
.getParentCount() > 0));
diff --git a/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java b/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java
index 436db37f..393dd139 100644
--- a/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/NavigationPanel.java
@@ -42,6 +42,7 @@ public class NavigationPanel extends Panel {
DataView<PageRegistration> refsView = new DataView<PageRegistration>("navLink", refsDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<PageRegistration> item) {
PageRegistration entry = item.getModelObject();
if (entry.hiddenPhone) {
diff --git a/src/main/java/com/gitblit/wicket/panels/ObjectContainer.java b/src/main/java/com/gitblit/wicket/panels/ObjectContainer.java
index d7f1f789..3c09e7c7 100644
--- a/src/main/java/com/gitblit/wicket/panels/ObjectContainer.java
+++ b/src/main/java/com/gitblit/wicket/panels/ObjectContainer.java
@@ -83,7 +83,7 @@ public abstract class ObjectContainer extends WebMarkupContainer {
if (parent instanceof Fragment) {
// must check for fragment, otherwise we end up in Wicket namespace
parent = parent.getParent();
- }
+ }
if (parent != null) {
ResourceReference resRef = new ResourceReference(parent.getClass(), src, false);
return (urlFor(resRef).toString());
@@ -92,6 +92,7 @@ public abstract class ObjectContainer extends WebMarkupContainer {
return (src);
}
+ @Override
public void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
@@ -122,6 +123,7 @@ public abstract class ObjectContainer extends WebMarkupContainer {
}
}
+ @Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
Response response = getResponse();
response.write("\n");
diff --git a/src/main/java/com/gitblit/wicket/panels/PagerPanel.java b/src/main/java/com/gitblit/wicket/panels/PagerPanel.java
index a5dbb9ef..2d774c41 100644
--- a/src/main/java/com/gitblit/wicket/panels/PagerPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/PagerPanel.java
@@ -39,10 +39,10 @@ public class PagerPanel extends Panel {
int[] deltas;
if (currentPage == 1) {
// [1], 2, 3, 4, 5
- deltas = new int[] { 0, 1, 2, 3, 4 };
+ deltas = new int[] { 0, 1, 2, 3, 4 };
} else if (currentPage == 2) {
// 1, [2], 3, 4, 5
- deltas = new int[] { -1, 0, 1, 2, 3 };
+ deltas = new int[] { -1, 0, 1, 2, 3 };
} else {
// 1, 2, [3], 4, 5
deltas = new int[] { -2, -1, 0, 1, 2 };
@@ -65,6 +65,7 @@ public class PagerPanel extends Panel {
final DataView<PageObject> pagesView = new DataView<PageObject>("page", pagesProvider) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<PageObject> item) {
PageObject pageItem = item.getModelObject();
PageParameters pageParams = new PageParameters(baseParams);
@@ -83,7 +84,7 @@ public class PagerPanel extends Panel {
private class PageObject implements Serializable {
private static final long serialVersionUID = 1L;
-
+
String text;
int page;
diff --git a/src/main/java/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java b/src/main/java/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java
index f6c0e4f8..2ac7bf91 100644
--- a/src/main/java/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/PathBreadcrumbsPanel.java
@@ -56,6 +56,7 @@ public class PathBreadcrumbsPanel extends Panel {
DataView<BreadCrumb> pathsView = new DataView<BreadCrumb>("path", crumbsDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<BreadCrumb> item) {
final BreadCrumb entry = item.getModelObject();
String path = entry.path;
diff --git a/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java b/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
index 99ce55a1..d63f26c3 100644
--- a/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/ReflogPanel.java
@@ -55,7 +55,7 @@ public class ReflogPanel extends BasePanel {
private static final long serialVersionUID = 1L;
private final boolean hasChanges;
-
+
private boolean hasMore;
public ReflogPanel(String wicketId, final RepositoryModel model, Repository r, int limit, int pageOffset) {
@@ -77,9 +77,9 @@ public class ReflogPanel extends BasePanel {
// works unless commits.size() represents the exact end.
hasMore = changes.size() >= changesPerPage;
hasChanges = changes.size() > 0;
-
+
setup(changes);
-
+
// determine to show pager, more, or neither
if (limit <= 0) {
// no display limit
@@ -102,14 +102,14 @@ public class ReflogPanel extends BasePanel {
}
}
}
-
+
public ReflogPanel(String wicketId, List<RefLogEntry> changes) {
super(wicketId);
hasChanges = changes.size() > 0;
setup(changes);
add(new Label("moreChanges").setVisible(false));
}
-
+
protected void setup(List<RefLogEntry> changes) {
final int hashLen = GitBlit.getInteger(Keys.web.shortCommitIdLength, 6);
@@ -118,11 +118,12 @@ public class ReflogPanel extends BasePanel {
final DateFormat df = new SimpleDateFormat(dateFormat);
df.setTimeZone(timezone);
final Calendar cal = Calendar.getInstance(timezone);
-
+
ListDataProvider<RefLogEntry> dp = new ListDataProvider<RefLogEntry>(changes);
DataView<RefLogEntry> changeView = new DataView<RefLogEntry>("change", dp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RefLogEntry> changeItem) {
final RefLogEntry change = changeItem.getModelObject();
String fullRefName = change.getChangedRefs().get(0);
@@ -134,7 +135,7 @@ public class ReflogPanel extends BasePanel {
shortRefName = shortRefName.substring(Constants.R_TAGS.length());
isTag = true;
}
-
+
String fuzzydate;
TimeUtils tu = getTimeUtils();
Date changeDate = change.date;
@@ -175,7 +176,7 @@ public class ReflogPanel extends BasePanel {
changeItem.add(new LinkPanel("whoChanged", null, change.user.getDisplayName(),
UserPage.class, WicketUtils.newUsernameParameter(change.user.username)));
}
-
+
boolean isDelete = false;
boolean isRewind = false;
String what;
@@ -202,19 +203,19 @@ public class ReflogPanel extends BasePanel {
isRewind = true;
default:
what = MessageFormat.format(change.getCommitCount() > 1 ? getString("gb.pushedNCommitsTo") : getString("gb.pushedOneCommitTo") , change.getCommitCount());
-
+
if (change.getAuthorCount() == 1) {
by = MessageFormat.format(getString("gb.byOneAuthor"), change.getAuthorIdent().getName());
} else {
- by = MessageFormat.format(getString("gb.byNAuthors"), change.getAuthorCount());
+ by = MessageFormat.format(getString("gb.byNAuthors"), change.getAuthorCount());
}
break;
}
changeItem.add(new Label("whatChanged", what));
changeItem.add(new Label("byAuthors", by).setVisible(!StringUtils.isEmpty(by)));
-
+
changeItem.add(new Label("refRewind", getString("gb.rewind")).setVisible(isRewind));
-
+
if (isDelete) {
// can't link to deleted ref
changeItem.add(new Label("refChanged", shortRefName));
@@ -227,13 +228,13 @@ public class ReflogPanel extends BasePanel {
changeItem.add(new LinkPanel("refChanged", null, shortRefName,
TreePage.class, WicketUtils.newObjectParameter(change.repository, fullRefName)));
}
-
+
int maxCommitCount = 5;
List<RepositoryCommit> commits = change.getCommits();
if (commits.size() > maxCommitCount) {
- commits = new ArrayList<RepositoryCommit>(commits.subList(0, maxCommitCount));
+ commits = new ArrayList<RepositoryCommit>(commits.subList(0, maxCommitCount));
}
-
+
// compare link
String compareLinkText = null;
if ((change.getCommitCount() <= maxCommitCount) && (change.getCommitCount() > 1)) {
@@ -249,18 +250,19 @@ public class ReflogPanel extends BasePanel {
String startRangeId = change.getOldId(fullRefName);
changeItem.add(new LinkPanel("compareLink", null, compareLinkText, ComparePage.class, WicketUtils.newRangeParameter(change.repository, startRangeId, endRangeId)));
}
-
+
ListDataProvider<RepositoryCommit> cdp = new ListDataProvider<RepositoryCommit>(commits);
DataView<RepositoryCommit> commitsView = new DataView<RepositoryCommit>("commit", cdp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RepositoryCommit> commitItem) {
final RepositoryCommit commit = commitItem.getModelObject();
// author gravatar
commitItem.add(new GravatarImage("commitAuthor", commit.getAuthorIdent().getName(),
commit.getAuthorIdent().getEmailAddress(), null, 16, false, false));
-
+
// merge icon
if (commit.getParentCount() > 1) {
commitItem.add(WicketUtils.newImage("commitIcon", "commit_merge_16x16.png"));
@@ -297,14 +299,14 @@ public class ReflogPanel extends BasePanel {
changeItem.add(commitsView);
}
};
-
+
add(changeView);
}
public boolean hasMore() {
return hasMore;
}
-
+
public boolean hideIfEmpty() {
setVisible(hasChanges);
return hasChanges;
diff --git a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
index e477b65f..1a763119 100644
--- a/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RefsPanel.java
@@ -43,7 +43,7 @@ import com.gitblit.wicket.pages.TagPage;
public class RefsPanel extends Panel {
private static final long serialVersionUID = 1L;
-
+
public RefsPanel(String id, final String repositoryName, RevCommit c,
Map<ObjectId, List<RefModel>> refs) {
this(id, repositoryName, refs.get(c.getId()));
@@ -65,7 +65,7 @@ public class RefsPanel extends Panel {
boolean remote2 = o2.displayName.startsWith(Constants.R_REMOTES);
if (remote1 && remote2) {
// both are remote heads, sort by name
- return o1.displayName.compareTo(o2.displayName);
+ return o1.displayName.compareTo(o2.displayName);
}
if (remote1) {
// o1 is remote, o2 comes first
@@ -79,7 +79,7 @@ public class RefsPanel extends Panel {
return o1.displayName.compareTo(o2.displayName);
}
});
-
+
// count remote and determine if we should insert a break
int remoteCount = 0;
for (RefModel ref : refs) {
@@ -88,12 +88,13 @@ public class RefsPanel extends Panel {
}
}
final boolean shouldBreak = remoteCount < refs.size();
-
+
ListDataProvider<RefModel> refsDp = new ListDataProvider<RefModel>(refs);
DataView<RefModel> refsView = new DataView<RefModel>("ref", refsDp) {
private static final long serialVersionUID = 1L;
private boolean alreadyInsertedBreak = !shouldBreak;
+ @Override
public void populateItem(final Item<RefModel> item) {
RefModel entry = item.getModelObject();
String name = entry.displayName;
@@ -123,9 +124,9 @@ public class RefsPanel extends Panel {
// Pull Request ref
name = "pull #" + name.substring(Constants.R_PULL.length());
if (name.endsWith("/head")) {
- // strip pull request head from name
+ // strip pull request head from name
name = name.substring(0, name.length() - "/head".length());
- }
+ }
cssClass = "pullRef";
} else if (name.startsWith(Constants.R_REMOTES)) {
// remote branch
diff --git a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
index 4156cd19..b728082b 100644
--- a/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RegistrantPermissionsPanel.java
@@ -52,17 +52,17 @@ import com.gitblit.wicket.WicketUtils;
/**
* Allows user to manipulate registrant access permissions.
- *
+ *
* @author James Moger
*
*/
public class RegistrantPermissionsPanel extends BasePanel {
private static final long serialVersionUID = 1L;
-
+
public enum Show {
specified, mutable, effective;
-
+
public boolean show(RegistrantAccessPermission ap) {
switch (this) {
case specified:
@@ -76,9 +76,9 @@ public class RegistrantPermissionsPanel extends BasePanel {
}
}
}
-
+
private Show activeState = Show.mutable;
-
+
public RegistrantPermissionsPanel(String wicketId, RegistrantType registrantType, List<String> allRegistrants, final List<RegistrantAccessPermission> permissions, final Map<AccessPermission, String> translations) {
super(wicketId);
setOutputMarkupId(true);
@@ -97,7 +97,7 @@ public class RegistrantPermissionsPanel extends BasePanel {
*/
RefreshingView<RegistrantAccessPermission> dataView = new RefreshingView<RegistrantAccessPermission>("permissionRow") {
private static final long serialVersionUID = 1L;
-
+
@Override
protected Iterator<IModel<RegistrantAccessPermission>> getItemModels() {
// the iterator returns RepositoryPermission objects, but we need it to
@@ -116,7 +116,8 @@ public class RegistrantPermissionsPanel extends BasePanel {
// 'even' for decoration
return new OddEvenItem<RegistrantAccessPermission>(id, index, model);
}
-
+
+ @Override
public void populateItem(final Item<RegistrantAccessPermission> item) {
final RegistrantAccessPermission entry = item.getModelObject();
if (RegistrantType.REPOSITORY.equals(entry.registrantType)) {
@@ -135,7 +136,7 @@ public class RegistrantPermissionsPanel extends BasePanel {
Label label = new Label("registrant", entry.registrant);
WicketUtils.setCssStyle(label, "font-weight: bold;");
item.add(label);
- }
+ }
} else if (RegistrantType.USER.equals(entry.registrantType)) {
// user
PersonIdent ident = new PersonIdent(entry.registrant, "");
@@ -146,8 +147,8 @@ public class RegistrantPermissionsPanel extends BasePanel {
Fragment userFragment = new Fragment("registrant", "userRegistrant", RegistrantPermissionsPanel.this);
userFragment.add(new GravatarImage("userAvatar", ident, 20, false));
- userFragment.add(new Label("userName", entry.registrant));
- item.add(userFragment);
+ userFragment.add(new Label("userName", entry.registrant));
+ item.add(userFragment);
} else {
// team
Fragment teamFragment = new Fragment("registrant", "teamRegistrant", RegistrantPermissionsPanel.this);
@@ -209,9 +210,10 @@ public class RegistrantPermissionsPanel extends BasePanel {
permissionChoice.setOutputMarkupId(true);
if (entry.mutable) {
permissionChoice.add(new AjaxFormComponentUpdatingBehavior("onchange") {
-
+
private static final long serialVersionUID = 1L;
+ @Override
protected void onUpdate(AjaxRequestTarget target) {
target.addComponent(permissionChoice);
}
@@ -265,29 +267,30 @@ public class RegistrantPermissionsPanel extends BasePanel {
copy.source = copy.registrant;
}
permissions.add(copy);
-
+
// resort permissions after insert to convey idea of eval order
Collections.sort(permissions);
-
+
// remove registrant from available choices
registrants.remove(rp.registrant);
-
+
// force the panel to refresh
target.addComponent(RegistrantPermissionsPanel.this);
}
};
addPermissionForm.add(button);
-
+
// only show add permission form if we have a registrant choice
add(addPermissionForm.setVisible(registrants.size() > 0));
}
-
+
+ @Override
protected boolean getStatelessHint()
{
return false;
}
-
+
private class AccessPermissionRenderer implements IChoiceRenderer<AccessPermission> {
private static final long serialVersionUID = 1L;
@@ -308,18 +311,18 @@ public class RegistrantPermissionsPanel extends BasePanel {
return Integer.toString(index);
}
}
-
+
private class ShowStateButton extends AjaxButton {
private static final long serialVersionUID = 1L;
Show buttonState;
-
+
public ShowStateButton(String wicketId, Show state) {
super(wicketId);
this.buttonState = state;
setOutputMarkupId(true);
}
-
+
@Override
protected void onBeforeRender()
{
@@ -330,7 +333,7 @@ public class RegistrantPermissionsPanel extends BasePanel {
WicketUtils.setCssClass(this, cssClass);
super.onBeforeRender();
}
-
+
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
RegistrantPermissionsPanel.this.activeState = buttonState;
diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java
index 256cc645..89fc02ac 100644
--- a/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RepositoriesPanel.java
@@ -128,7 +128,7 @@ public class RepositoriesPanel extends BasePanel {
roots.add(0, "");
groups.put("", rootRepositories);
}
-
+
List<RepositoryModel> groupedModels = new ArrayList<RepositoryModel>();
for (String root : roots) {
List<RepositoryModel> subModels = groups.get(root);
@@ -149,7 +149,7 @@ public class RepositoriesPanel extends BasePanel {
final String baseUrl = WicketUtils.getGitblitURL(getRequest());
final boolean showSwatch = GitBlit.getBoolean(Keys.web.repositoryListSwatches, true);
-
+
DataView<RepositoryModel> dataView = new DataView<RepositoryModel>("row", dp) {
private static final long serialVersionUID = 1L;
int counter;
@@ -161,6 +161,7 @@ public class RepositoriesPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<RepositoryModel> item) {
final RepositoryModel entry = item.getModelObject();
if (entry instanceof GroupRepositoryModel) {
@@ -168,7 +169,7 @@ public class RepositoriesPanel extends BasePanel {
currGroupName = entry.name;
Fragment row = new Fragment("rowContent", "groupRepositoryRow", this);
item.add(row);
-
+
String name = groupRow.name;
if (name.startsWith(ModelUtils.getUserRepoPrefix())) {
// user page
@@ -194,7 +195,7 @@ public class RepositoriesPanel extends BasePanel {
if (!StringUtils.isEmpty(currGroupName) && (repoName.indexOf('/') > -1)) {
repoName = repoName.substring(currGroupName.length() + 1);
}
-
+
// repository swatch
Component swatch;
if (entry.isBare){
@@ -241,7 +242,7 @@ public class RepositoriesPanel extends BasePanel {
} else {
row.add(WicketUtils.newClearPixel("sparkleshareIcon").setVisible(false));
}
-
+
if (entry.isFork()) {
row.add(WicketUtils.newImage("forkIcon", "commit_divide_16x16.png",
getString("gb.isFork")));
diff --git a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
index 0dae3cf1..ea8693bb 100644
--- a/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/RepositoryUrlPanel.java
@@ -50,7 +50,7 @@ import com.gitblit.wicket.WicketUtils;
/**
* Smart repository url panel which can display multiple Gitblit repository urls
* and also supports 3rd party app clone links.
- *
+ *
* @author James Moger
*
*/
@@ -61,12 +61,12 @@ public class RepositoryUrlPanel extends BasePanel {
private final String externalPermission = "?";
private boolean onlyUrls;
- private UserModel user;
+ private UserModel user;
private RepositoryModel repository;
private RepositoryUrl primaryUrl;
private Map<String, String> urlPermissionsMap;
private Map<AccessRestrictionType, String> accessRestrictionsMap;
-
+
public RepositoryUrlPanel(String wicketId, boolean onlyUrls, UserModel user, RepositoryModel repository) {
super(wicketId);
this.onlyUrls = onlyUrls;
@@ -74,7 +74,7 @@ public class RepositoryUrlPanel extends BasePanel {
this.repository = repository;
this.urlPermissionsMap = new HashMap<String, String>();
}
-
+
@Override
protected void onInitialize() {
super.onInitialize();
@@ -94,7 +94,7 @@ public class RepositoryUrlPanel extends BasePanel {
add(new Label("repositoryIndicators").setVisible(false));
return;
}
-
+
// display primary url
add(createPrimaryUrlPanel("repositoryUrlPanel", repository, repositoryUrls));
@@ -122,7 +122,7 @@ public class RepositoryUrlPanel extends BasePanel {
Fragment urlPanel = new Fragment(wicketId, "repositoryUrlFragment", this);
urlPanel.setRenderBodyOnly(true);
-
+
if (repositoryUrls.size() == 1) {
//
// Single repository url, no dropdown menu
@@ -136,15 +136,16 @@ public class RepositoryUrlPanel extends BasePanel {
DataView<RepositoryUrl> repoUrlMenuItems = new DataView<RepositoryUrl>("repoUrls", urlsDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RepositoryUrl> item) {
RepositoryUrl repoUrl = item.getModelObject();
// repository url
- Fragment fragment = new Fragment("repoUrl", "actionFragment", this);
+ Fragment fragment = new Fragment("repoUrl", "actionFragment", this);
Component content = new Label("content", repoUrl.url).setRenderBodyOnly(true);
WicketUtils.setCssClass(content, "commandMenuItem");
fragment.add(content);
item.add(fragment);
-
+
Label permissionLabel = new Label("permission", repoUrl.isExternal() ? externalPermission : repoUrl.permission.toString());
WicketUtils.setPermissionClass(permissionLabel, repoUrl.permission);
String tooltip = getProtocolPermissionDescription(repository, repoUrl);
@@ -195,22 +196,22 @@ public class RepositoryUrlPanel extends BasePanel {
urlPanel.add(WicketUtils.newClearPixel("accessRestrictionIcon").setVisible(false));
}
}
-
+
urlPanel.add(new Label("primaryUrl", primaryUrl.url).setRenderBodyOnly(true));
- Label permissionLabel = new Label("primaryUrlPermission", primaryUrl.isExternal() ? externalPermission : primaryUrl.permission.toString());
+ Label permissionLabel = new Label("primaryUrlPermission", primaryUrl.isExternal() ? externalPermission : primaryUrl.permission.toString());
String tooltip = getProtocolPermissionDescription(repository, primaryUrl);
WicketUtils.setHtmlTooltip(permissionLabel, tooltip);
urlPanel.add(permissionLabel);
urlPanel.add(createCopyFragment(primaryUrl.url));
-
+
return urlPanel;
}
-
+
protected Fragment createApplicationMenus(String wicketId, UserModel user, final RepositoryModel repository, final List<RepositoryUrl> repositoryUrls) {
final List<GitClientApplication> displayedApps = new ArrayList<GitClientApplication>();
final String userAgent = ((WebClientInfo) GitBlitWebSession.get().getClientInfo()).getUserAgent();
-
+
if (user.canClone(repository)) {
for (GitClientApplication app : GitBlit.self().getClientApplications()) {
if (app.isActive && app.allowsPlatform(userAgent)) {
@@ -224,6 +225,7 @@ public class RepositoryUrlPanel extends BasePanel {
DataView<GitClientApplication> appMenus = new DataView<GitClientApplication>("appMenus", displayedAppsDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<GitClientApplication> item) {
final GitClientApplication clientApp = item.getModelObject();
@@ -242,24 +244,24 @@ public class RepositoryUrlPanel extends BasePanel {
}
}
}
-
+
if (urls.size() == 0) {
// do not show this app menu because there are no urls
item.add(new Label("appMenu").setVisible(false));
return;
}
-
+
Fragment appMenu = new Fragment("appMenu", "appMenuFragment", this);
appMenu.setRenderBodyOnly(true);
item.add(appMenu);
-
+
// menu button
appMenu.add(new Label("applicationName", clientApp.name));
-
+
// application icon
Component img;
if (StringUtils.isEmpty(clientApp.icon)) {
- img = WicketUtils.newClearPixel("applicationIcon").setVisible(false);
+ img = WicketUtils.newClearPixel("applicationIcon").setVisible(false);
} else {
if (clientApp.icon.contains("://")) {
// external image
@@ -268,35 +270,36 @@ public class RepositoryUrlPanel extends BasePanel {
// context image
img = WicketUtils.newImage("applicationIcon", clientApp.icon);
}
- }
+ }
appMenu.add(img);
-
+
// application menu title, may be a link
if (StringUtils.isEmpty(clientApp.productUrl)) {
appMenu.add(new Label("applicationTitle", clientApp.toString()));
} else {
appMenu.add(new LinkPanel("applicationTitle", null, clientApp.toString(), clientApp.productUrl, true));
}
-
+
// brief application description
if (StringUtils.isEmpty(clientApp.description)) {
appMenu.add(new Label("applicationDescription").setVisible(false));
} else {
appMenu.add(new Label("applicationDescription", clientApp.description));
}
-
+
// brief application legal info, copyright, license, etc
if (StringUtils.isEmpty(clientApp.legal)) {
appMenu.add(new Label("applicationLegal").setVisible(false));
} else {
appMenu.add(new Label("applicationLegal", clientApp.legal));
}
-
+
// a nested repeater for all action items
ListDataProvider<RepositoryUrl> urlsDp = new ListDataProvider<RepositoryUrl>(urls);
DataView<RepositoryUrl> actionItems = new DataView<RepositoryUrl>("actionItems", urlsDp) {
private static final long serialVersionUID = 1L;
+ @Override
public void populateItem(final Item<RepositoryUrl> repoLinkItem) {
RepositoryUrl repoUrl = repoLinkItem.getModelObject();
Fragment fragment = new Fragment("actionItem", "actionFragment", this);
@@ -315,7 +318,7 @@ public class RepositoryUrlPanel extends BasePanel {
WicketUtils.setCssClass(content, "commandMenuItem");
fragment.add(content);
repoLinkItem.add(fragment);
-
+
// copy function for command
fragment.add(createCopyFragment(command));
}
@@ -323,16 +326,16 @@ public class RepositoryUrlPanel extends BasePanel {
appMenu.add(actionItems);
}
};
-
+
Fragment applicationMenus = new Fragment(wicketId, "applicationMenusFragment", this);
applicationMenus.add(appMenus);
return applicationMenus;
}
-
+
protected String substitute(String pattern, String repoUrl, String baseUrl) {
return pattern.replace("${repoUrl}", repoUrl).replace("${baseUrl}", baseUrl);
}
-
+
protected Label createPermissionBadge(String wicketId, RepositoryUrl repoUrl) {
Label permissionLabel = new Label(wicketId, repoUrl.isExternal() ? externalPermission : repoUrl.permission.toString());
WicketUtils.setPermissionClass(permissionLabel, repoUrl.permission);
@@ -340,7 +343,7 @@ public class RepositoryUrlPanel extends BasePanel {
WicketUtils.setHtmlTooltip(permissionLabel, tooltip);
return permissionLabel;
}
-
+
protected Fragment createCopyFragment(String text) {
if (GitBlit.getBoolean(Keys.web.allowFlashCopyToClipboard, true)) {
// clippy: flash-based copy & paste
@@ -359,7 +362,7 @@ public class RepositoryUrlPanel extends BasePanel {
return copyFragment;
}
}
-
+
protected String getProtocolPermissionDescription(RepositoryModel repository,
RepositoryUrl repoUrl) {
if (!urlPermissionsMap.containsKey(repoUrl.url)) {
@@ -374,9 +377,9 @@ public class RepositoryUrlPanel extends BasePanel {
// implicit SSH url
protocol = "ssh";
}
- note = MessageFormat.format(getString("gb.externalPermissions"), protocol);
+ note = MessageFormat.format(getString("gb.externalPermissions"), protocol);
} else {
- note = null;
+ note = null;
String key;
switch (repoUrl.permission) {
case OWNER:
@@ -411,7 +414,7 @@ public class RepositoryUrlPanel extends BasePanel {
}
return urlPermissionsMap.get(repoUrl.url);
}
-
+
protected Map<AccessRestrictionType, String> getAccessRestrictions() {
if (accessRestrictionsMap == null) {
accessRestrictionsMap = new HashMap<AccessRestrictionType, String>();
@@ -434,7 +437,7 @@ public class RepositoryUrlPanel extends BasePanel {
}
return accessRestrictionsMap;
}
-
+
protected Component createRepositoryIndicators(RepositoryModel repository) {
Fragment fragment = new Fragment("repositoryIndicators", "indicatorsFragment", this);
if (repository.isBare) {
@@ -446,7 +449,7 @@ public class RepositoryUrlPanel extends BasePanel {
wc.add(lbl);
fragment.add(wc);
}
-
+
boolean allowForking = GitBlit.getBoolean(Keys.web.allowForking, true);
if (!allowForking || user == null || !user.isAuthenticated) {
// must be logged-in to fork, hide all fork controls
diff --git a/src/main/java/com/gitblit/wicket/panels/SearchPanel.java b/src/main/java/com/gitblit/wicket/panels/SearchPanel.java
index 9d38ab09..bfa38ed4 100644
--- a/src/main/java/com/gitblit/wicket/panels/SearchPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/SearchPanel.java
@@ -84,6 +84,7 @@ public class SearchPanel extends BasePanel {
private static final long serialVersionUID = 1L;
int counter;
+ @Override
public void populateItem(final Item<RevCommit> item) {
final RevCommit entry = item.getModelObject();
final Date date = JGitUtils.getCommitDate(entry);
diff --git a/src/main/java/com/gitblit/wicket/panels/ShockWaveComponent.java b/src/main/java/com/gitblit/wicket/panels/ShockWaveComponent.java
index fa989453..78822c6d 100644
--- a/src/main/java/com/gitblit/wicket/panels/ShockWaveComponent.java
+++ b/src/main/java/com/gitblit/wicket/panels/ShockWaveComponent.java
@@ -29,11 +29,11 @@ import org.apache.wicket.util.value.IValueMap;
/**
* https://cwiki.apache.org/WICKET/object-container-adding-flash-to-a-wicket-application.html
- *
+ *
* @author Jan Kriesten
* @author manuelbarzi
* @author James Moger
- *
+ *
*/
public class ShockWaveComponent extends ObjectContainer {
private static final long serialVersionUID = 1L;
@@ -67,7 +67,7 @@ public class ShockWaveComponent extends ObjectContainer {
attributes = new HashMap<String, String>();
parameters = new HashMap<String, String>();
}
-
+
public ShockWaveComponent(String id, String movie) {
this(id);
setValue("movie", movie);
@@ -81,6 +81,7 @@ public class ShockWaveComponent extends ObjectContainer {
setValue("height", height);
}
+ @Override
public void setValue(String name, String value) {
// IE and other browsers handle movie/data differently. So movie is used
// for IE, whereas
@@ -100,6 +101,7 @@ public class ShockWaveComponent extends ObjectContainer {
parameters.put(parameter, value);
}
+ @Override
public String getValue(String name) {
String parameter = name.toLowerCase();
String value = null;
@@ -122,6 +124,7 @@ public class ShockWaveComponent extends ObjectContainer {
return value;
}
+ @Override
public void onComponentTag(ComponentTag tag) {
// get options from the markup
IValueMap valueMap = tag.getAttributes();
@@ -142,6 +145,7 @@ public class ShockWaveComponent extends ObjectContainer {
super.onComponentTag(tag);
}
+ @Override
public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
super.onComponentTagBody(markupStream, openTag);
diff --git a/src/main/java/com/gitblit/wicket/panels/TagsPanel.java b/src/main/java/com/gitblit/wicket/panels/TagsPanel.java
index 907b3174..1e06a7fc 100644
--- a/src/main/java/com/gitblit/wicket/panels/TagsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/TagsPanel.java
@@ -66,6 +66,7 @@ public class TagsPanel extends BasePanel {
private static final long serialVersionUID = 1L;
int counter;
+ @Override
public void populateItem(final Item<RefModel> item) {
RefModel entry = item.getModelObject();
@@ -89,7 +90,7 @@ public class TagsPanel extends BasePanel {
.getReferencedObjectId().getName())));
// workaround for RevTag returning a lengthy shortlog. :(
- String message = StringUtils.trimString(entry.getShortMessage(),
+ String message = StringUtils.trimString(entry.getShortMessage(),
com.gitblit.Constants.LEN_SHORTLOG);
if (linkClass.equals(BlobPage.class)) {
diff --git a/src/main/java/com/gitblit/wicket/panels/TeamsPanel.java b/src/main/java/com/gitblit/wicket/panels/TeamsPanel.java
index b76388b3..f567c78b 100644
--- a/src/main/java/com/gitblit/wicket/panels/TeamsPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/TeamsPanel.java
@@ -54,6 +54,7 @@ public class TeamsPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<TeamModel> item) {
final TeamModel entry = item.getModelObject();
LinkPanel editLink = new LinkPanel("teamname", "list", entry.name,
diff --git a/src/main/java/com/gitblit/wicket/panels/UsersPanel.java b/src/main/java/com/gitblit/wicket/panels/UsersPanel.java
index f5b95e20..545734f0 100644
--- a/src/main/java/com/gitblit/wicket/panels/UsersPanel.java
+++ b/src/main/java/com/gitblit/wicket/panels/UsersPanel.java
@@ -56,13 +56,14 @@ public class UsersPanel extends BasePanel {
counter = 0;
}
+ @Override
public void populateItem(final Item<UserModel> item) {
final UserModel entry = item.getModelObject();
LinkPanel editLink = new LinkPanel("username", "list", entry.username,
EditUserPage.class, WicketUtils.newUsernameParameter(entry.username));
WicketUtils.setHtmlTooltip(editLink, getString("gb.edit") + " " + entry.getDisplayName());
item.add(editLink);
-
+
if (StringUtils.isEmpty(entry.displayName)) {
item.add(new Label("displayName").setVisible(false));
} else {