• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ElementHandle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.netbeans.modules.csl.api.ElementHandle的典型用法代码示例。如果您正苦于以下问题:Java ElementHandle类的具体用法?Java ElementHandle怎么用?Java ElementHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ElementHandle类属于org.netbeans.modules.csl.api包,在下文中一共展示了ElementHandle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: StructureItemNode

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
public StructureItemNode(final StructureItem item) {
    super(Children.create(new ChildFactory<StructureItem>() {
        @Override protected boolean createKeys(List<StructureItem> toPopulate) {
            toPopulate.addAll(item.getNestedItems());
            return true;
        }

        @Override
        protected Node createNodeForKey(StructureItem key) {
            return new StructureItemNode(key);
        }
        
    }, false), Lookups.fixed(new OpenCookie() {
        @Override public void open() {
            ElementHandle elementHandle = item.getElementHandle();
            FileObject file = elementHandle != null ? elementHandle.getFileObject() : null;
            if (file != null) {
                UiUtils.open(file, (int) item.getPosition());
            }
        }
    }));
    this.item = item;
    setDisplayName(item.getName());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:BreadCrumbsTask.java


示例2: getListCellRendererComponent

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public Component getListCellRendererComponent(
        JList list,
        Object value,
        int index,
        boolean isSelected,
        boolean cellHasFocus) {
    Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    
    if (value instanceof AlternativeLocation) {
        AlternativeLocation desc = (AlternativeLocation) value;
        ElementHandle e = desc.getElement();
        ImageIcon icon = Icons.getElementIcon(e.getKind(), e.getModifiers());
        setIcon(icon);
        
        GsfHtmlFormatter formatter = new GsfHtmlFormatter();
        String s = desc.getDisplayHtml(formatter);
        setText("<html>"+s);
    }
    
    return c;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:DeclarationPopup.java


示例3: document

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public String document(ParserResult info, ElementHandle element) {
    FileObject fileObject = info.getSnapshot().getSource().getFileObject();
    HelpResolver resolver = CssModuleSupport.getHelpResolver();
    if (resolver != null) {
        if (element instanceof CssPropertyElement) {
            CssPropertyElement e = (CssPropertyElement) element;
            PropertyDefinition property = e.getPropertyDescriptor();
            return resolver.getHelp(fileObject, property);
        } else if (element instanceof ElementHandle.UrlHandle) {
            try {
                return URLRetriever.getURLContentAndCache(new URL(element.getName()));
            } catch (MalformedURLException e) {
                assert false;
            }
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:CssCompletion.java


示例4: document

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public String document(ParserResult result, ElementHandle handle)
{
    String doc = null;
    switch (docType)
    {
        case POD:
            doc = FanIndexer.getPodDoc(handle.getName());
            break;
        case TYPE:
            doc = ((FanBasicElementHandle) handle).getDoc();
            break;
        case SLOT:
            doc = ((FanBasicElementHandle) handle).getDoc();
            break;
    }
    return doc;
}
 
开发者ID:tcolar,项目名称:fantomidemodule,代码行数:19,代码来源:FanCompletionHandler.java


示例5: documentElement

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public Documentation documentElement(
        @NonNull final ParserResult info,
        @NonNull final ElementHandle element,
        @NonNull final Callable<Boolean> cancel) {
    switch (element.getKind()) {
        case KEYWORD:
            return Optional.ofNullable(Command.forHandle(element))
                .map((cmd) -> cmd.getDocumentation(cancel))
                .orElse(null);
        case OTHER:
            try {
                final URL url = ((DocHandle)element).getURI().toURL();
                final Future<String> becomesContent = DocDownloader.download(url, cancel);
                String content = null;
                while (cancel.call() != Boolean.TRUE) {
                    try {
                        content = becomesContent.get(250, TimeUnit.MILLISECONDS);
                        break;
                    } catch (TimeoutException timeout) {
                        //retry
                    }
                }
                return content == null ?
                        null :
                        DocDownloader.parseSection(content, url);
            } catch (Exception e) {
                return null;
            }
        default:
            return null;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:34,代码来源:DockerfileCompletion.java


示例6: actionPerformed

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
public void actionPerformed (ActionEvent ev) {
    if (fileObject != null && elementHandle == null) {
        UiUtils.open(fileObject, (int)start);
        return;
    }
    ElementHandle handle = elementHandle;
    FileObject primaryFile = DataLoadersBridge.getDefault().getPrimaryFile(fileObject);

    if ((primaryFile != null) && (handle != null)) {
        Source js = Source.create(primaryFile);
        if (js != null) {
            UiUtils.open(js, handle);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:OpenAction.java


示例7: createDocumentationTask

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public CompletionTask createDocumentationTask() {
    final ElementHandle element = item.getElement();
    if (element != null) {
        return GsfCompletionProvider.createDocTask(element,info);
    }

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


示例8: createDocTask

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
static CompletionTask createDocTask(ElementHandle element, ParserResult info) { // TODO - use ComObjectHandle ??
    JavaCompletionQuery query = new JavaCompletionQuery(DOCUMENTATION_QUERY_TYPE, -1);
    query.element = element;

    //return new AsyncCompletionTask(query, Registry.getMostActiveComponent());
    return new AsyncCompletionTask(query, EditorRegistry.lastFocusedComponent());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:GsfCompletionProvider.java


示例9: resolveLink

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public ElementHandle resolveLink(String link, ElementHandle elementHandle) {
    if (elementHandle instanceof CssPropertyElement) {
        CssPropertyElement e = (CssPropertyElement) elementHandle;
        PropertyDefinition property = e.getPropertyDescriptor();
        HelpResolver helpResolver = CssModuleSupport.getHelpResolver();
        if (helpResolver != null) {
            URL url = helpResolver.resolveLink(elementHandle.getFileObject(), property, link);
            if (url != null) {
                return new UrlHandle(url.toExternalForm());
            }
        }
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CssCompletion.java


示例10: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(ElementHandle handle) {
    if (!(handle instanceof HtmlElementHandle)) {
        return false;
    }
    HtmlElementHandle htmlHandle = (HtmlElementHandle)handle;
    return htmlHandle.elementPath.equals(elementPath);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:HtmlElementHandle.java


示例11: getElement

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public ElementHandle getElement() {
    if (!this.description.isEmpty()) {
        return new ApexElementHandle(this.name, this.description, this.elementKind);
    }
    return null;
}
 
开发者ID:fundacionjala,项目名称:oblivion-netbeans-plugin,代码行数:8,代码来源:ProposalItem.java


示例12: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(ElementHandle elementHandle) {
    if (elementHandle instanceof EditorConfigElementHandle) {
        return name.equals(((EditorConfigElementHandle) elementHandle).name);
    }
    return false;
}
 
开发者ID:junichi11,项目名称:netbeans-editorconfig-editor,代码行数:8,代码来源:EditorConfigElementHandle.java


示例13: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(ElementHandle eh) {
    if (!(eh instanceof SSTemplateElementHandle)) {
        return false;
    }
    if (eh.getName().equals(this.getName())) {
        return true;
    }
    return false;
}
 
开发者ID:guru-digital,项目名称:sstemplate-netbeans,代码行数:11,代码来源:SSTemplateStructureItem.java


示例14: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(ElementHandle elementHandle) {
  if (elementHandle instanceof EditorConfigElementHandle) {
    return name.equals(((EditorConfigElementHandle) elementHandle).name);
  }
  return false;
}
 
开发者ID:welovecoding,项目名称:editorconfig-netbeans,代码行数:8,代码来源:EditorConfigElementHandle.java


示例15: resolveLink

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
  public ElementHandle resolveLink(String link, ElementHandle handle)
  {
      //TODO: resolve links
/*System.out.println("Resolve link: "+link);
      link="sys.File";
      return new ElementHandle.UrlHandle(link);*/
      return null;
  }
 
开发者ID:tcolar,项目名称:fantomidemodule,代码行数:10,代码来源:FanCompletionHandler.java


示例16: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(@NonNull final ElementHandle handle) {
    return getKind() == handle.getKind() && getName().equals(handle.getName());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:Command.java


示例17: document

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public String document(ParserResult info, ElementHandle element) {
    return Optional.ofNullable(documentElement(info, element, ()->false))
            .map((doc)->doc.getContent())
            .orElse(null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:DockerfileCompletion.java


示例18: getElement

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public ElementHandle getElement() {
    return cmd.toElementHandle();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:DockerfileCompletion.java


示例19: signatureEquals

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
@Override
public boolean signatureEquals(ElementHandle handle) {
    return getKind().equals(handle.getKind()) &&
            getName().equals(handle.getName());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:DockerfileCompletion.java


示例20: OpenAction

import org.netbeans.modules.csl.api.ElementHandle; //导入依赖的package包/类
public OpenAction(ElementHandle elementHandle, FileObject fileObject, long start) {
    this.elementHandle = elementHandle;
    this.fileObject = fileObject;
    this.start = start;
    putValue ( Action.NAME, NbBundle.getMessage ( OpenAction.class, "LBL_Goto" ) ); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:OpenAction.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Graphic类代码示例发布时间:2022-05-22
下一篇:
Java ConnectionSpec类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap