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


Java Lookups.fixed方法代码示例

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


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

示例1: createLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private static Lookup createLookup(MatchingObject mo,
        ReplaceCheckableNode checkableNode) {

    // TODO consider using new ProxyLookup(fixedLookup,
    // mo.getDataObject().getLookup()).
    // It could be reasonable, but current solution is simpler and thus
    // should perform better.

    ArrayList<Object> items = new ArrayList<Object>();
    items.add(mo);
    items.add(checkableNode);
    items.add(mo.getFileObject());
    items.add(mo.getDataObject());
    Openable openable = mo.getDataObject().getLookup().lookup(Openable.class);
    if (openable != null) {
        items.add(openable);
    }
    return Lookups.fixed(items.toArray());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:MatchingObjectNode.java

示例2: initLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private static Lookup initLookup(Project project, AntProjectHelper projectHelper, PropertyEvaluator projectEvaluator, AuxiliaryConfiguration aux) {
    final SourceForBinaryQueryImpl sfbq = new SourceForBinaryQueryImpl(projectHelper, projectEvaluator, aux);
    final Classpaths cp = new Classpaths(projectHelper, projectEvaluator, aux, sfbq);
    return Lookups.fixed(
        cp, // ClassPathProvider
        new SourceLevelQueryImpl(projectHelper, projectEvaluator, aux), // SourceLevelQueryImplementation
        sfbq,   // SourceForBinaryQueryImplementation
        new AnnotationProcessingQueryImpl(projectHelper, projectEvaluator, aux),
        new OpenHook(project, cp), // ProjectOpenedHook
        new TestQuery(projectHelper, projectEvaluator, aux), // MultipleRootsUnitTestForSourceQueryImplementation
        new JavadocQuery(projectHelper, projectEvaluator, aux), // JavadocForBinaryQueryImplementation
        new PrivilegedTemplatesImpl(), // PrivilegedTemplates
        new JavaActions(project, projectHelper, projectEvaluator, aux), // ActionProvider
        // XXX could use LookupMergerSupport.createClassPathProviderMerger here, though ClasspathsTest then fails:
        new LookupMergerImpl(), // LookupMerger
        new JavaFreeformFileBuiltQuery(project, projectHelper, projectEvaluator, aux), // FileBuiltQueryImplementation
        new HelpIDFragmentProviderImpl());
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:LookupProviderImpl.java

示例3: RequiredPluginsNode

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Messages({"DN_MissingPlugins=Required Plugins Missing",
           "#{0}: the list of missing plugins",
           "DESC_MissingPlugins=<html>The following plugins that are required to fully analyze the selected scope were missing:<ul>{0}</ul>"})
public RequiredPluginsNode(final Collection<? extends MissingPlugin> requiredPlugins) {
    super(Children.LEAF, Lookups.fixed(new DescriptionReader() {
        @Override public CharSequence getDescription() {
            StringBuilder missingPlugins = new StringBuilder();
            
            for (MissingPlugin p : requiredPlugins) {
                missingPlugins.append("<li>").append(SPIAccessor.ACCESSOR.getDisplayName(p)).append("</li>");
            }
            
            return Bundle.DESC_MissingPlugins(missingPlugins.toString());
        }
    }));
    this.requiredPlugins = new ArrayList<MissingPlugin>(requiredPlugins);
    setDisplayName(Bundle.DN_MissingPlugins());
    setIconBaseWithExtension("org/netbeans/modules/analysis/ui/resources/warning.gif");
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:RequiredPluginsNode.java

示例4: initLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private Lookup initLookup() throws IOException {
    aux = helper().createAuxiliaryConfiguration(); // AuxiliaryConfiguration
    FreeformFileEncodingQueryImpl FEQImpl = new FreeformFileEncodingQueryImpl(helper(), evaluator());
    helper().addAntProjectListener(FEQImpl);
    Lookup baseLookup = Lookups.fixed(
        this,
        new Info(), // ProjectInformation
        new FreeformSources(this), // Sources
        new Actions(this), // ActionProvider
        new View(this), // LogicalViewProvider
        new ProjectCustomizerProvider(this), // CustomizerProvider
        aux, // AuxiliaryConfiguration
        helper().createAuxiliaryProperties(),
        helper().createCacheDirectoryProvider(), // CacheDirectoryProvider
        new Subprojects(this), // SubprojectProvider
        new ArtifactProvider(this), // AntArtifactProvider
        new LookupMergerImpl(), // LookupMerger or ActionProvider
        UILookupMergerSupport.createPrivilegedTemplatesMerger(),
        UILookupMergerSupport.createRecommendedTemplatesMerger(),
        new FreeformProjectOperations(this),
 new FreeformSharabilityQuery(this), //SharabilityQueryImplementation
        Accessor.DEFAULT.createProjectAccessor(this), //Access to AntProjectHelper and PropertyEvaluator
        FEQImpl, // FileEncodingQueryImplementation
        new FreeformTemplateAttributesProvider(helper(), eval, FEQImpl)
    );
    return LookupProviderSupport.createCompositeLookup(baseLookup, "Projects/org-netbeans-modules-ant-freeform/Lookup"); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:28,代码来源:FreeformProject.java

示例5: context

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private Lookup context(FileObject[] files) throws Exception {
    Object[] objs = new Object[files.length];
    for (int i = 0; i < files.length; i++) {
        objs[i] = useDO ? (Object) DataObject.find(files[i]) : files[i];
        useDO = !useDO;
    }
    return Lookups.fixed(objs);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:JavaActionsTest.java

示例6: getLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
public Lookup getLookup() {
    if (fileObject != null) {
        return Lookups.fixed(fileObject);
    } else {
        return Lookups.fixed();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:DiffResultsViewForLine.java

示例7: getLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
public Lookup getLookup() {
    Object composite = null;
    if(bounds != null) {
        composite = ElementGripFactory.getDefault().get(parentFile, bounds.getBegin().getOffset());
    }
    if (composite==null) {
        composite = parentFile;
    }
    Icon icon = null;
    if(access != null) {
        switch(access) {
            case WRITE:
                icon = ImageUtilities.loadImageIcon("org/netbeans/modules/refactoring/java/resources/found_item_write.png", false);
                break;
            case READ_WRITE:
                icon = ImageUtilities.loadImageIcon("org/netbeans/modules/refactoring/java/resources/found_item_readwrite.png", false);
                break;
            default:
            case READ:
                icon = ImageUtilities.loadImageIcon("org/netbeans/modules/refactoring/java/resources/found_item_read.png", false);
                break;
        }
    } else if(inComment) {
        icon = ImageUtilities.loadImageIcon("org/netbeans/modules/refactoring/java/resources/found_item_comment.png", false);
    } else if(inImport) {
        icon = ImageUtilities.loadImageIcon("org/netbeans/modules/refactoring/java/resources/found_item_import.png", false);
    }
    return icon != null ? Lookups.fixed(composite, icon) : Lookups.singleton(composite);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:WhereUsedElement.java

示例8: createLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private static Lookup createLookup (
        @NonNull final AntArtifact antArtifact,
        @NonNull final URI artifactLocation, 
        @NonNull final UpdateHelper helper, 
        @NonNull final String classPathId,
        @NonNull final String entryId,
        @NullAllowed final String webModuleElementName,
        @NonNull final ClassPathSupport cs,
        @NonNull final ReferenceHelper rh,
        @NullAllowed final Consumer<Pair<String,String>> preRemoveAction,
        @NullAllowed final Consumer<Pair<String,String>> postRemoveAction,
        boolean removeFromProject) {
    Project p = antArtifact.getProject();
    Object[] content;
    if (p == null) {
        content = new Object[1];
    }
    else {
        content = new Object[4];
        content[1] = new JavadocProvider(antArtifact, artifactLocation);
        content[2] = p;
        content[3] = new PathFinderImpl();  //Needed by Source Inspect View to display errors in project reference
    }
    content[0] = new ActionFilterNode.Removable(
            helper, classPathId, entryId, webModuleElementName,
            cs, rh, preRemoveAction, postRemoveAction, removeFromProject);
    Lookup lkp = Lookups.fixed(content);
    return lkp;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:30,代码来源:ProjectNode.java

示例9: getLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
public synchronized Lookup getLookup() {
    if (lookup == null) {
        ioTab = new IOTabImpl();
        ioColors = new IOColorsImpl();
        ioFolding = getIoFolding();
        lookup = Lookups.fixed(ioTab, ioColors, new IOPositionImpl(),
                new IOColorLinesImpl(), new IOColorPrintImpl(),
                new IOSelectImpl(), ioFolding, options);
    }
    return lookup;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:NbIO.java

示例10: createNode

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
Node createNode() {
    return new SingleFieldNode(Lookups.fixed(this, qname), display);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:POMModelVisitor.java

示例11: DockerContainersNode

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@NbBundle.Messages("LBL_Containers=Containers")
public DockerContainersNode(DockerInstance instance, DockerContainersChildFactory factory) {
    super(Children.create(factory, true), Lookups.fixed(instance, factory));
    setDisplayName(Bundle.LBL_Containers());
    setIconBaseWithExtension(DOCKER_INSTANCE_ICON);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:DockerContainersNode.java

示例12: getLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
public Lookup getLookup() {
    return Lookups.fixed(file);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:VCSContextTest.java

示例13: SafeDeleteUI

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
private SafeDeleteUI(NonRecursiveFolder nonRecursiveFolder, boolean regulardelete) {
    refactoring = new SafeDeleteRefactoring(Lookups.fixed(nonRecursiveFolder));
    refactoring.getContext().add(JavaRefactoringUtils.getClasspathInfoFor(nonRecursiveFolder.getFolder()));
    this.regulardelete = regulardelete;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:SafeDeleteUI.java

示例14: RemoteNode

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
public RemoteNode (File repository, GitRemoteConfig remote) {
    super(new RemoteChildren(remote), repository, Lookups.fixed(remote));
    this.repository = repository;
    this.remoteName = remote.getRemoteName();
    setIconBaseWithExtension("org/netbeans/modules/git/resources/icons/remote.png"); //NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:RepositoryBrowserPanel.java

示例15: getLookup

import org.openide.util.lookup.Lookups; //导入方法依赖的package包/类
@Override
public Lookup getLookup() {
    return Lookups.fixed(fileObject);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:SingleDiffPanel.java


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