當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。