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


Java EditorRegistry.componentList方法代码示例

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


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

示例1: getNextDoc

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
private BaseDocument getNextDoc(BaseDocument doc) {
    if (doc == getStaticWordsDoc()) {
        return null;
    }
    BaseDocument nextDoc = null;
    Set<BaseDocument> list = new LinkedHashSet<BaseDocument>();
    for(JTextComponent jtc : EditorRegistry.componentList()) {
        list.add(Utilities.getDocument(jtc));
    }
    for(Iterator<? extends BaseDocument> i = list.iterator(); i.hasNext(); ) {
        if (doc == i.next()) {
            if (i.hasNext()) {
                nextDoc = i.next();
            }
            break;
        }
    }
    if (nextDoc == null) {
        nextDoc = getStaticWordsDoc();
    }
    return nextDoc;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:WordMatch.java

示例2: getNextDocument

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
private Document getNextDocument() {
    // Initially documentIndex == -1
    if (documentIndex == documents.size() - 1) { // Check adding
        if (documentSet.isEmpty()) { // documents list not inited yet -> add 'doc'
            documentSet.put(doc, Boolean.TRUE);
        }
        for (JTextComponent tc : EditorRegistry.componentList()) {
            Document d = tc.getDocument();
            if (!documentSet.containsKey(d)) {
                documentSet.put(d, Boolean.TRUE);
                documents.add(new WeakReference<Document>(d));
            }
        }
    }
    Document retDoc = null;
    while (documentIndex < documents.size() - 1) {
        documentIndex++;
        retDoc = documents.get(documentIndex).get();
        if (retDoc != null) {
            break;
        }
    }
    return retDoc;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:WordMatch.java

示例3: getMostActiveJavaEditorContext

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
@Override
public EditorContext getMostActiveJavaEditorContext() {
    for (JTextComponent component : EditorRegistry.componentList()) {
        Document document = component.getDocument();
        FileObject fileObject = NbEditorUtilities.getFileObject(document);

        if ((fileObject != null) && fileObject.getExt().equalsIgnoreCase("java")) { // NOI18N
            return new EditorContext(component, document, fileObject);
        }
    }

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

示例4: getPaneFor

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
public static JTextComponent getPaneFor(FileObject fo) {
    JTextComponent pane = getOpenPane();
    if (pane != null && findFileObject(pane) == fo) {
        return pane;
    }

    for (JTextComponent c : EditorRegistry.componentList()) {
        if (findFileObject(c) == fo) {
            return c;
        }
    }

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

示例5: findEditor

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
/** TODO - MOVE TO UTILITTY LIBRARY */
private static JTextComponent findEditor(Document doc) {
    JTextComponent comp = EditorRegistry.lastFocusedComponent();
    if (comp.getDocument() == doc) {
        return comp;
    }
    List<? extends JTextComponent> componentList = EditorRegistry.componentList();
    for (JTextComponent component : componentList) {
        if (comp.getDocument() == doc) {
            return comp;
        }
    }

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

示例6: getActiveDocuments

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
@Override
public Set<? extends Document> getActiveDocuments() {
    final Set<Document> res = Collections.newSetFromMap(new IdentityHashMap<Document, Boolean>());
    for (JTextComponent jtc : EditorRegistry.componentList()) {
        final Document doc = jtc.getDocument();
        if (doc != null) {
            res.add(doc);
        }
    }
    return res;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:NbActiveDocumentProvider.java

示例7: refreshStatusLine

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
static void refreshStatusLine() {
    LOG.fine("StatusLineFactories.refreshStatusLine()\n");
    List<? extends JTextComponent> componentList = EditorRegistry.componentList();
    for (JTextComponent component : componentList) {
        boolean underMainWindow = (SwingUtilities.isDescendingFrom(component,
                WindowManager.getDefault().getMainWindow()));
        EditorUI editorUI = Utilities.getEditorUI(component);
        if (LOG.isLoggable(Level.FINE)) {
            String componentDesc = component.toString();
            Document doc = component.getDocument();
            Object streamDesc;
            if (doc != null && ((streamDesc = doc.getProperty(Document.StreamDescriptionProperty)) != null)) {
                componentDesc = streamDesc.toString();
            }
            LOG.fine("  underMainWindow=" + underMainWindow + // NOI18N
                    ", text-component: " + componentDesc + "\n");
        }
        if (editorUI != null) {
            StatusBar statusBar = editorUI.getStatusBar();
            statusBar.setVisible(!underMainWindow);
            boolean shouldUpdateGlobal = underMainWindow && component.isShowing();
            if (shouldUpdateGlobal) {
                statusBar.updateGlobal();
                LOG.fine("  end of refreshStatusLine() - found main window component\n\n"); // NOI18N
                return; // First non-docked one found and updated -> quit
            }
        }
    }
    clearStatusLine();
    LOG.fine("  end of refreshStatusLine() - no components - status line cleared\n\n"); // NOI18N
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:StatusLineFactories.java

示例8: resultsUpdated

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
@Override
public void resultsUpdated(Project project, CoverageProvider provider) {
    Set<String> mimeTypes = provider.getMimeTypes();
    for (JTextComponent target : EditorRegistry.componentList()) {
        Document document = target.getDocument();
        String mimeType = (String) document.getProperty(MIME_TYPE);
        if (mimeType != null && mimeTypes.contains(mimeType)) {
            FileObject fo = GsfUtilities.findFileObject(document);
            if (fo != null && FileOwnerQuery.getOwner(fo) == project) {
                FileCoverageDetails hitCounts = (FileCoverageDetails) document.getProperty(COVERAGE_DOC_PROPERTY);
                if (hitCounts == null) {
                    document.putProperty(COVERAGE_DOC_PROPERTY, null); // ehh... what?
                }
                if (isEnabled(project)) {
                    focused(fo, target);
                } else {
                    CoverageHighlightsContainer container = CoverageHighlightsLayerFactory.getContainer(target);
                    if (container != null) {
                        container.refresh();
                    }
                }
            }
        }
    }

    final CoverageReportTopComponent report = showingReports.get(project);
    if (report != null) {
        final List<FileCoverageSummary> coverage = provider.getResults();
        Mutex.EVENT.readAccess(new Runnable() {
            public @Override
            void run() {
                report.updateData(coverage);
            }
        });
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:CoverageManagerImpl.java

示例9: setShowEditorBar

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
public void setShowEditorBar(boolean on) {
    this.showEditorBar = on;
    NbPreferences.forModule(CoverageManager.class).putBoolean(PREF_EDITOR_BAR, on);

    // Update existing editors
    for (JTextComponent target : EditorRegistry.componentList()) {
        Document document = target.getDocument();
        CoverageSideBar sb = CoverageSideBar.getSideBar(target);
        if (sb != null) {
            sb.showCoveragePanel(on);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CoverageManagerImpl.java

示例10: getLeastActiveComponent

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
public static JTextComponent getLeastActiveComponent() {
    registerListener();
    List<? extends JTextComponent> l = EditorRegistry.componentList();
    return l.size() > 0 ? l.get(l.size() - 1) : null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:Registry.java

示例11: finish

import org.netbeans.api.editor.EditorRegistry; //导入方法依赖的package包/类
private void finish() {
    EditorRegistry.removePropertyChangeListener(editorsTracker);
    for(JTextComponent jtc : EditorRegistry.componentList()) {
        AbbrevDetection.remove(jtc);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:CodeTemplatesModule.java


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