use of org.gwtbootstrap3.client.ui.Anchor in project kie-wb-common by kiegroup.
the class DocumentFieldRendererViewImpl method setValue.
@Override
public void setValue(DocumentData value, boolean fireEvents) {
if (this.value == value) {
return;
}
if (value == null || value.getStatus().equals(DocumentStatus.NEW) || !value.equals(this.value)) {
this.value = value;
linkContainer.clear();
if (this.value != null) {
Anchor link = new Anchor();
link.setText(value.getFileName() + " (" + calculateSize() + ")");
if (value.getLink() == null) {
link.setEnabled(false);
link.setHref("#");
link.addClickHandler(event -> {
return;
});
} else {
link.setHref(value.getLink());
link.setTarget("_blank");
}
linkContainer.add(link);
}
if (fireEvents) {
ValueChangeEvent.fire(this, this.value);
}
}
}
use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.
the class MenuView method getLabelFromHref.
@Override
public String getLabelFromHref(String href) {
ListGroupItem group = hrefToGroupLabelMap.get(href);
String result = "";
if (group != null) {
result = ((Anchor) group.getWidget(1)).getElement().getInnerText().trim();
}
return result;
}
use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.
the class MenuView method addPrimaryMenuItemPlace.
private int addPrimaryMenuItemPlace(int index, String label, String href, String iconCssName) {
ListGroupItem newMenuItem = new ListGroupItem();
Anchor menuAnchor = new Anchor(hashifyString(href));
if (index < 0) {
index = 0;
}
Span iconSpan = new Span();
if (iconCssName != null) {
iconSpan.addStyleName(determineCssIconBase(iconCssName));
iconSpan.addStyleName(iconCssName);
newMenuItem.addStyleName(Styles.ACTIVE);
}
menuAnchor.add(iconSpan);
Span labelSpan = new Span();
labelSpan.setText(label);
labelSpan.addStyleName(PatternflyStyles.LIST_GROUP_ITEM_VALUE);
menuAnchor.add(labelSpan);
newMenuItem.add(menuAnchor);
// Insert the new menu item into the href map.
hrefToGroupLabelMap.put(href, newMenuItem);
if (index > menuListGroup.getWidgetCount()) {
menuListGroup.add(newMenuItem);
} else {
menuListGroup.insert(newMenuItem, index);
}
return menuListGroup.getWidgetIndex(newMenuItem);
}
use of org.gwtbootstrap3.client.ui.Anchor in project ovirt-engine by oVirt.
the class EventsListPopover method createTitleHeader.
private IsWidget createTitleHeader(String title) {
FlowPanel header = new FlowPanel();
header.addStyleName(PatternflyConstants.PF_DRAWER_TITLE);
titleAnchor = new Anchor();
titleAnchor.addStyleName(PatternflyConstants.PF_DRAWER_TOGGLE_EXPAND);
titleAnchor.addClickHandler(e -> toggle());
header.add(titleAnchor);
Anchor closeAnchor = new Anchor();
closeAnchor.addStyleName(PatternflyConstants.PF_DRAWER_CLOSE);
closeAnchor.addStyleName(PatternflyConstants.PFICON);
closeAnchor.addStyleName(PatternflyConstants.PFICON_CLOSE);
closeAnchor.addClickHandler(e -> hide());
header.add(closeAnchor);
Heading titleHeading = new Heading(HeadingSize.H3, title);
titleHeading.addStyleName(PatternflyConstants.CENTER_TEXT);
header.add(titleHeading);
return header;
}
use of org.gwtbootstrap3.client.ui.Anchor in project kie-wb-common by kiegroup.
the class BreadcrumbNavigator method createUpFolder.
private void createUpFolder(final FolderItem item) {
int col = 0;
navigator.setText(0, col, "");
navigator.setText(0, ++col, "");
final Anchor anchor = new Anchor();
anchor.setIcon(IconType.LEVEL_UP);
anchor.setIconSize(IconSize.LARGE);
anchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
presenter.onActiveFolderItemSelected(item);
}
});
navigator.setWidget(0, ++col, anchor);
navigator.setText(0, ++col, "");
if (options.showItemAge()) {
navigator.setText(0, ++col, "");
}
if (options.showItemMessage()) {
navigator.setText(0, ++col, "");
}
}
Aggregations