Java Code Examples for com.google.gwt.dom.client.AnchorElement#setInnerText()
The following examples show how to use
com.google.gwt.dom.client.AnchorElement#setInnerText() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TopMenuBar.java From dashbuilder with Apache License 2.0 | 6 votes |
private void addEntry(String entry, boolean logout) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(entry); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if (Event.ONCLICK == event.getTypeInt()) { if (!logout) { onRoleClicked(entry); } else { onLogoutClicked(); } } }); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); roleList.appendChild((Node) li); }
Example 2
Source File: DisplayerHtmlEditorView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addSourceCodeItem(String name) { AnchorElement anchor = Document.get().createAnchorElement(); String displayName = DisplayerHtmlConstants.INSTANCE.getString("displayer_source_code_" + name); anchor.setInnerText(displayName); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); tabList.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { presenter.onSourceCodeItemSelected(name); if (selectedItem != null) { selectedItem.setClassName(""); selectedItem.getStyle().setCursor(Style.Cursor.POINTER); } selectedItem = li; selectedItem.setClassName("active"); selectedItem.getStyle().setCursor(Style.Cursor.DEFAULT); previewItem.setClassName(""); } }); }
Example 3
Source File: NavTilesWidgetView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addBreadcrumbItem(String navItemName, Command onClicked) { LIElement li = Document.get().createLIElement(); breadcrumb.appendChild((Node) li); if (onClicked != null) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(navItemName); li.appendChild(anchor); li.getStyle().setCursor(Style.Cursor.POINTER); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if (Event.ONCLICK == event.getTypeInt()) { onClicked.execute(); } }); } else { ((Node) li).setTextContent(navItemName); li.setClassName("active"); } }
Example 4
Source File: NavComponentConfigModalView.java From dashbuilder with Apache License 2.0 | 6 votes |
private void addItem(UnorderedList unorderedList, String name, boolean selected, Command onSelect) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); li.setClassName(selected ? "selected" : ""); unorderedList.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onSelect.execute(); } }); }
Example 5
Source File: NavRootNodeEditorView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addCommand(String name, Command command) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); commandMenu.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { command.execute(); } }); }
Example 6
Source File: TargetPerspectiveEditorView.java From dashbuilder with Apache License 2.0 | 6 votes |
private void addItem(UnorderedList unorderedList, String name, boolean selected, Command onSelect) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); li.setClassName(selected ? "selected" : ""); unorderedList.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onSelect.execute(); } }); }
Example 7
Source File: NavItemDefaultEditorView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addCommand(String name, Command command) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); commandMenu.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { command.execute(); } }); }
Example 8
Source File: BaseNavWidgetView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addItem(String id, String name, String description, Command onItemSelected) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); if (description != null && !description.equals(name)) { anchor.setTitle(description); } LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); navWidget.appendChild((Node) li); itemMap.put(id, li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if (Event.ONCLICK == event.getTypeInt()) { onItemSelected.execute(); } }); }
Example 9
Source File: PerspectivesExplorerView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addPerspective(String name, Command onClicked) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.getStyle().setCursor(Style.Cursor.POINTER); anchor.getStyle().setColor("black"); anchor.getStyle().setProperty("fontSize", "larger"); anchor.setInnerText(name); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onClicked.execute(); } }); SpanElement icon = Document.get().createSpanElement(); icon.getStyle().setMarginRight(10, Style.Unit.PX); icon.setClassName("pficon-virtual-machine"); icon.getStyle().setProperty("fontSize", "larger"); DivElement gi = createItemDiv(new Element[] {icon, anchor}); perspectivesDiv.appendChild((Node) gi); }
Example 10
Source File: PerspectiveDragConfigModalView.java From dashbuilder with Apache License 2.0 | 6 votes |
@Override public void addItem(String name, Command onSelect) { AnchorElement anchor = Document.get().createAnchorElement(); anchor.setInnerText(name); LIElement li = Document.get().createLIElement(); li.getStyle().setCursor(Style.Cursor.POINTER); li.appendChild(anchor); selectorItems.appendChild((Node) li); Event.sinkEvents(anchor, Event.ONCLICK); Event.setEventListener(anchor, event -> { if(Event.ONCLICK == event.getTypeInt()) { onSelect.execute(); } }); }
Example 11
Source File: Pagination.java From putnami-web-toolkit with GNU Lesser General Public License v3.0 | 5 votes |
Page(String label, int page) { this.setElement(Document.get().createLIElement()); this.page = page; if (Pagination.this.currentPage == page) { StyleUtils.addStyle(this, Pagination.STYLE_ACTIVE); } else { this.addDomHandler(this, ClickEvent.getType()); } AnchorElement anchor = Document.get().createAnchorElement(); anchor.setHref(AnchorUtils.DUMMY_HREF); anchor.setInnerText(label); this.getElement().appendChild(anchor); }