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


Java ElementHandle类代码示例

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


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


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