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


Java Lookup.Provider方法代码示例

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


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

示例1: configureSettings

import org.openide.util.Lookup; //导入方法依赖的package包/类
void configureSettings(ProfilingSettings settings) {
    super.configureSettings(settings);
    
    StringBuilder filter = new StringBuilder();
    
    for (Lookup.Provider project : selectedProjects) {
        ProjectContentsSupport pcs = ProjectContentsSupport.get(project);
        filter.append(pcs.getInstrumentationFilter(false));
        filter.append(" "); // NOI18N
        pcs.reset();
    }
    
    String s  = filter.toString().replace(". ", ".* ").replace(".,", ".*,").trim(); // NOI18N
    JavaTypeFilter f = new JavaTypeFilter(s, JavaTypeFilter.TYPE_INCLUSIVE);
    settings.setInstrumentationFilter(f);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:ObjectsFeatureModes.java

示例2: getComponent

import org.openide.util.Lookup; //导入方法依赖的package包/类
public JComponent getComponent() {
    if (panel == null) {
        final BeanTreeView view = new BeanTreeView();
        view.setRootVisible(true);
        view.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        class Panel extends JPanel implements ExplorerManager.Provider, Lookup.Provider {
            // Make sure action context works correctly:
            private final Lookup lookup = ExplorerUtils.createLookup(manager, new ActionMap());
            {
                setLayout(new BorderLayout());
                add(view, BorderLayout.CENTER);
            }
            public ExplorerManager getExplorerManager() {
                return manager;
            }
            public Lookup getLookup() {
                return lookup;
            }
        }
        panel = new Panel();
    }
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:ElementNavigatorProviderImpl.java

示例3: loadProfilingPoint

import org.openide.util.Lookup; //导入方法依赖的package包/类
protected ProfilingPoint loadProfilingPoint(Lookup.Provider project, Properties properties, int index) {
    String name = properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_NAME, null); // NOI18N
    String enabledStr = properties.getProperty(index + "_" + ProfilingPoint.PROPERTY_ENABLED, null); // NOI18N
    CodeProfilingPoint.Location startLocation = CodeProfilingPoint.Location.load(project, index, START_LOCATION_PREFIX,
                                                                                 properties);
    CodeProfilingPoint.Location endLocation = CodeProfilingPoint.Location.load(project, index, END_LOCATION_PREFIX, properties);

    if ((name == null) || (enabledStr == null) || (startLocation == null)) {
        return null;
    }

    StopwatchProfilingPoint profilingPoint = null;

    try {
        profilingPoint = new StopwatchProfilingPoint(name, startLocation, endLocation, project, this);
        profilingPoint.setEnabled(Boolean.parseBoolean(enabledStr));
    } catch (Exception e) {
        ErrorManager.getDefault().log(ErrorManager.ERROR, e.getMessage());
    }

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

示例4: getCurrentProject

import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
public Lookup.Provider getCurrentProject() {
    try {
        return performOnAWT(new Callable<Lookup.Provider>() {

            @Override
            public Lookup.Provider call() throws Exception {
                TopComponent tc = TopComponent.getRegistry().getActivated();

                if (tc != null) {
                    return tc.getLookup().lookup(Project.class);
                }

                return null;
            }
        });
    } catch (Exception e)  {
        Exceptions.printStackTrace(e);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:ProjectEditorSupportImpl.java

示例5: setValue

import org.openide.util.Lookup; //导入方法依赖的package包/类
public void setValue(Object value, int row) {
    
    if (value instanceof Lookup.Provider || value instanceof ProfilingPoint) {
        if (value instanceof ProfilingPoint) {
            ProfilingPoint ppoint = (ProfilingPoint)value;
            value = ppoint.getProject();
            setEnabled(ppoint.isEnabled());
        } else {
            setEnabled(true);
        }
        
        Lookup.Provider project = (Lookup.Provider)value;
        setText(ProjectUtilities.getDisplayName(project));
        Icon icon = ProjectUtilities.getIcon(project);
        setIcon(isEnabled() ? icon : disabledIcon(icon));
        setFont(Objects.equals(ProjectUtilities.getMainProject(), value) ? font.deriveFont(Font.BOLD) : font); // bold for main project
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:19,代码来源:Utils.java

示例6: computeHeapDumpProject

import org.openide.util.Lookup; //导入方法依赖的package包/类
private static Lookup.Provider computeHeapDumpProject(File heapDumpFile) {
    if (heapDumpFile == null) {
        return null;
    }

    File heapDumpDir = heapDumpFile.getParentFile();

    if (heapDumpDir == null) {
        return null;
    }

    FileObject heapDumpDirObj = FileUtil.toFileObject(heapDumpDir);

    if ((heapDumpDirObj == null) || !heapDumpDirObj.isValid()) {
        return null;
    }

    return ProfilerStorage.getProjectFromFolder(heapDumpDirObj);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:HeapWalker.java

示例7: get

import org.openide.util.Lookup; //导入方法依赖的package包/类
/**
 * Returns ProjectContentsSupport instance for the provided project.
 * 
 * @param project project
 * @return ProjectContentsSupport instance for the provided project
 */
public static ProjectContentsSupport get(Lookup.Provider project) {
    Collection<? extends ProjectContentsSupportProvider> providers =
            project != null ? project.getLookup().lookupAll(ProjectContentsSupportProvider.class) : null;
    if (providers == null || providers.isEmpty()) return defaultImpl();
    else return new ProjectContentsSupport(providers);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ProjectContentsSupport.java

示例8: find

import org.openide.util.Lookup; //导入方法依赖的package包/类
private static IONotifier find(InputOutput io) {
    if (io instanceof Lookup.Provider) {
        Lookup.Provider p = (Lookup.Provider) io;
        return p.getLookup().lookup(IONotifier.class);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:IONotifier.java

示例9: find

import org.openide.util.Lookup; //导入方法依赖的package包/类
private static IOConnect find(InputOutput io) {
    if (io instanceof Lookup.Provider) {
        Lookup.Provider p = (Lookup.Provider) io;
        return p.getLookup().lookup(IOConnect.class);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:IOConnect.java

示例10: createPane

import org.openide.util.Lookup; //导入方法依赖的package包/类
@Override
protected Pane createPane(CloneableEditorSupport sup) {
    final Lookup lkp = Lookups.fixed(sup);
    class P implements Serializable, Lookup.Provider {
        @Override
        public Lookup getLookup() {
            return lkp;
        }
    }
    CloneableTopComponent pane = MultiViews.createCloneableMultiView("text/x-compat-test", new P());
    return (Pane) pane;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:MultiViewEditorCreationFinishedTest.java

示例11: openSource

import org.openide.util.Lookup; //导入方法依赖的package包/类
private static void openSource(final Lookup.Provider project, final String className, final String methodName, final String signature, final int line) {
    srcOpenerRP.post(new Runnable() {
        
        @Override
        public void run() {
            openSourceImpl(project, className, methodName, signature, line);
        }
    });
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:GoToSource.java

示例12: store

import org.openide.util.Lookup; //导入方法依赖的package包/类
public void store(Lookup.Provider project, int index, String prefix, Properties properties) {
    String absPrefix = (prefix == null) ? (index + "_") : (index + "_" + prefix); // NOI18N
    properties.put(absPrefix + PROPERTY_TRIGGCOND_METRIC, Integer.toString(metric));
    properties.put(absPrefix + PROPERTY_TRIGGCOND_VALUE, Long.toString(value));
    properties.put(absPrefix + PROPERTY_TRIGGCOND_ONETIME, Boolean.toString(onetime));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:TriggeredGlobalProfilingPoint.java

示例13: setMimeLookup

import org.openide.util.Lookup; //导入方法依赖的package包/类
public <T extends Serializable & Lookup.Provider> void setMimeLookup(String mimeType, T context) {
    peer.setMimeLookup(mimeType, context);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:MultiViewCloneableTopComponent.java

示例14: ResetResultsProfilingPoint

import org.openide.util.Lookup; //导入方法依赖的package包/类
public ResetResultsProfilingPoint(String name, Location location, Lookup.Provider project, ProfilingPointFactory factory) {
    super(name, location, project, factory);
    getChangeSupport().addPropertyChangeListener(this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ResetResultsProfilingPoint.java

示例15: DefaultPositionRefProvider

import org.openide.util.Lookup; //导入方法依赖的package包/类
private DefaultPositionRefProvider(EditorSupport es, Lookup.Provider lkpProv) {
    this.es = es;
    this.ces = null;
    this.lkpProv = lkpProv;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:DefaultPositionRefProvider.java


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