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


Java ElementHandle.signatureEquals方法代码示例

本文整理汇总了Java中org.netbeans.api.java.source.ElementHandle.signatureEquals方法的典型用法代码示例。如果您正苦于以下问题:Java ElementHandle.signatureEquals方法的具体用法?Java ElementHandle.signatureEquals怎么用?Java ElementHandle.signatureEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.java.source.ElementHandle的用法示例。


在下文中一共展示了ElementHandle.signatureEquals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getNodeForElement

import org.netbeans.api.java.source.ElementHandle; //导入方法依赖的package包/类
public ElementNode getNodeForElement(ElementHandle<Element> eh) {

        if (getDescritption().elementHandle != null
                && eh.signatureEquals(getDescritption().elementHandle)) {
            return this;
        }

        Children ch = getChildren();
        if (ch instanceof ElementChilren) {
            for (Node sub : ch.getNodes()) {
                ElementNode result = ((ElementNode) sub).getNodeForElement(eh);
                if (result != null) {
                    return result;
                }
            }
        }

        return null;
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ElementNode.java

示例2: signatureEquals

import org.netbeans.api.java.source.ElementHandle; //导入方法依赖的package包/类
public static boolean signatureEquals(
    @NonNull final ElementHandle<Element> handle,
    @NonNull final Element element) {
    if (handle == null) {
        return false;
    }
    //ElementKind OTHER represents errors <any>, <none>.
    //These are special errors which cannot be resolved
    if (element.getKind() == ElementKind.OTHER) {
        return false;
    }
    try {
        return handle.signatureEquals(element);
    } catch (IllegalArgumentException e) {
        LOG.log(
            Level.INFO,
            "Unresolvable element: {0}, reason: {1}",    //NOI18N
            new Object[]{
                element,
                e.getMessage()
            });
        return false;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:Utils.java

示例3: updateNavigatorSelection

import org.netbeans.api.java.source.ElementHandle; //导入方法依赖的package包/类
private void updateNavigatorSelection(CompilationInfo ci, TreePath tp) throws Exception {
    final ClassMemberPanel cmp = ClassMemberPanel.getInstance();
    if (cmp == null) {
        return;
    }
    final ClassMemberPanelUI cmpUi = cmp.getClassMemberPanelUI();
    if (!cmpUi.isAutomaticRefresh()) {
        cmpUi.getTask().runImpl(ci, false);
        lastEhForNavigator = null;
    }
    // Try to find the declaration we are in
    final Pair<Element,TreePath> p = outerElement(ci, tp);
    if (p != null) {
        final Element e = p.first();
        Runnable action = null;
        if (e == null) {
            //Directive
            lastEhForNavigator = null;
            action = () -> {
                cmp.selectTreePath(TreePathHandle.create(p.second(), ci));
            };
        } else if (e.getKind() != ElementKind.OTHER) {
            final ElementHandle<Element> eh = ElementHandle.create(e);
            if (lastEhForNavigator != null && eh.signatureEquals(lastEhForNavigator)) {
                return;
            }
            lastEhForNavigator = eh;
            action = () -> {
                cmp.selectElement(eh);
            };
        }
        if (action != null) {
            SwingUtilities.invokeLater(action);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:CaretListeningTask.java


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