Allow to control target of web links

Plugins can now control the target window in which a web link should
be opened.

This is an incompatible change and plugins implementing web links must
be adapted.

Change-Id: I5aec40ce425251b10fcb912131d547982d27cd55
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2014-09-11 17:07:33 +02:00
parent 2970f85486
commit ceeed6b48a
10 changed files with 48 additions and 8 deletions

View File

@@ -399,6 +399,9 @@ public class ProjectBranchesScreen extends ProjectScreen {
for (WebLinkInfo weblink : Natives.asList(k.web_links())) {
Anchor a = new Anchor();
a.setHref(weblink.url());
if (weblink.target() != null && !weblink.target().isEmpty()) {
a.setTarget(weblink.target());
}
if (weblink.imageUrl() != null && !weblink.imageUrl().isEmpty()) {
Image img = new Image();
img.setAltText(weblink.name());

View File

@@ -240,6 +240,9 @@ public class ProjectListScreen extends Screen implements FilteredUserInterface {
for (WebLinkInfo weblink : webLinks) {
Anchor a = new Anchor();
a.setHref(weblink.url());
if (weblink.target() != null && !weblink.target().isEmpty()) {
a.setTarget(weblink.target());
}
if (weblink.imageUrl() != null && !weblink.imageUrl().isEmpty()) {
Image img = new Image();
img.setAltText(weblink.name());