本文整理汇总了Java中com.google.gwt.dom.client.AnchorElement.setInnerText方法的典型用法代码示例。如果您正苦于以下问题:Java AnchorElement.setInnerText方法的具体用法?Java AnchorElement.setInnerText怎么用?Java AnchorElement.setInnerText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.dom.client.AnchorElement
的用法示例。
在下文中一共展示了AnchorElement.setInnerText方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addEntry
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
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);
}
示例2: addSourceCodeItem
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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("");
}
});
}
示例3: addBreadcrumbItem
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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");
}
}
示例4: addItem
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
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();
}
});
}
示例5: addCommand
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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();
}
});
}
示例6: addItem
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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();
}
});
}
示例7: addPerspective
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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);
}
示例8: addItem
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@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();
}
});
}
示例9: addHitPolicyOption
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
@Override
public void addHitPolicyOption( final GuidedDecisionTable52.HitPolicy hitPolicy ) {
final AnchorElement anchor = Document.get()
.createAnchorElement();
anchor.setInnerText( HitPolicyInternationalizer.internationalize( hitPolicy ) );
Event.sinkEvents( anchor,
Event.ONCLICK );
Event.setEventListener( anchor,
event -> {
if ( Event.ONCLICK == event.getTypeInt() ) {
presenter.onHitPolicySelected( hitPolicy );
}
} );
final LIElement li = Document.get()
.createLIElement();
li.appendChild( anchor );
listOfAvailableHitModes.appendChild( (Node) li );
}
示例10: Page
import com.google.gwt.dom.client.AnchorElement; //导入方法依赖的package包/类
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);
}