当前位置: 首页>>代码示例>>Java>>正文


Java AnchorElement.setInnerText方法代码示例

本文整理汇总了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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:TopMenuBar.java

示例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("");
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:DisplayerHtmlEditorView.java

示例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");
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:NavTilesWidgetView.java

示例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();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:NavComponentConfigModalView.java

示例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();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:NavItemDefaultEditorView.java

示例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();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:BaseNavWidgetView.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:PerspectivesExplorerView.java

示例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();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:PerspectiveDragConfigModalView.java

示例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 );
}
 
开发者ID:kiegroup,项目名称:drools-wb,代码行数:21,代码来源:HitPolicySelectorViewImpl.java

示例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);
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:14,代码来源:Pagination.java


注:本文中的com.google.gwt.dom.client.AnchorElement.setInnerText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。