use of com.google.gwt.user.client.ui.Anchor in project gerrit by GerritCodeReview.
the class Gerrit method anchor.
private static Anchor anchor(final String text, final String to) {
final Anchor a = new Anchor(text, to);
a.setStyleName(RESOURCES.css().menuItem());
Roles.getMenuitemRole().set(a.getElement());
return a;
}
use of com.google.gwt.user.client.ui.Anchor in project gerrit by GerritCodeReview.
the class Gerrit method populateBottomMenu.
private static void populateBottomMenu(RootPanel btmmenu, HostPageData hpd) {
String vs = hpd.version;
if (vs == null || vs.isEmpty()) {
vs = "dev";
}
btmmenu.add(new InlineHTML(M.poweredBy(vs)));
if (info().gerrit().webUis().contains(UiType.POLYGERRIT)) {
btmmenu.add(new InlineLabel(" | "));
uiSwitcherLink = new Anchor(C.newUi(), getUiSwitcherUrl(History.getToken()));
uiSwitcherLink.setStyleName("");
btmmenu.add(uiSwitcherLink);
}
String reportBugUrl = info().gerrit().reportBugUrl();
if (reportBugUrl != null) {
String reportBugText = info().gerrit().reportBugText();
Anchor a = new Anchor(reportBugText == null ? C.reportBug() : reportBugText, reportBugUrl);
a.setTarget("_blank");
a.setStyleName("");
btmmenu.add(new InlineLabel(" | "));
btmmenu.add(a);
}
btmmenu.add(new InlineLabel(" | "));
btmmenu.add(new InlineLabel(C.keyHelp()));
}
use of com.google.gwt.user.client.ui.Anchor in project gerrit by GerritCodeReview.
the class WebLinkInfo method toAnchor.
public final Anchor toAnchor() {
Anchor a = new Anchor();
a.setHref(url());
if (target() != null && !target().isEmpty()) {
a.setTarget(target());
}
if (imageUrl() != null && !imageUrl().isEmpty()) {
Image img = new Image();
img.setAltText(name());
img.setUrl(imageUrl());
img.setTitle(name());
a.getElement().appendChild(img.getElement());
} else {
a.setText("(" + name() + ")");
}
return a;
}
use of com.google.gwt.user.client.ui.Anchor in project gerrit by GerritCodeReview.
the class ProjectAccessEditor method toAnchor.
private static Anchor toAnchor(WebLinkInfoCommon info) {
Anchor a = new Anchor();
a.setHref(info.url);
if (info.target != null && !info.target.isEmpty()) {
a.setTarget(info.target);
}
if (info.imageUrl != null && !info.imageUrl.isEmpty()) {
Image img = new Image();
img.setAltText(info.name);
img.setUrl(info.imageUrl);
img.setTitle(info.name);
a.getElement().appendChild(img.getElement());
} else {
a.setText("(" + info.name + ")");
}
return a;
}
use of com.google.gwt.user.client.ui.Anchor in project gerrit by GerritCodeReview.
the class GroupTable method populate.
void populate(final int row, final GroupInfo k, final String toHighlight) {
if (k.url() != null) {
if (isInteralGroup(k)) {
table.setWidget(row, 1, new HighlightingInlineHyperlink(k.name(), Dispatcher.toGroup(k.getGroupId()), toHighlight));
} else {
Anchor link = new Anchor();
link.setHTML(Util.highlight(k.name(), toHighlight));
link.setHref(k.url());
table.setWidget(row, 1, link);
}
} else {
table.setHTML(row, 1, Util.highlight(k.name(), toHighlight));
}
table.setText(row, 2, k.description());
if (k.options().isVisibleToAll()) {
table.setWidget(row, 3, new Image(Gerrit.RESOURCES.greenCheck()));
}
final FlexCellFormatter fmt = table.getFlexCellFormatter();
fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().groupName());
for (int i = 1; i <= NUM_COLS; i++) {
fmt.addStyleName(row, i, Gerrit.RESOURCES.css().dataCell());
}
setRowItem(row, k);
}
Aggregations