• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FoldManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



FoldManager类属于org.netbeans.spi.editor.fold包,在下文中一共展示了FoldManager类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getFoldOperation

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
private static FoldOperation getFoldOperation(FoldManager m) {
    if (!(m instanceof FM)) {
        return null;
    } else {
        return ((FM)m).operation;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:ParsingFoldSupport.java


示例2: removeManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
synchronized void removeManager(FoldManager m) {
    for (Iterator<Reference<FoldManager>> it = managers.iterator(); it.hasNext(); ) {
        Reference<FoldManager> ref = it.next();
        FoldManager x = ref.get();
        if (x == null) {
            it.remove();
        } else if (x == m) {
            it.remove();
            break;
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:ParsingFoldSupport.java


示例3: getManagers

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
synchronized List<FoldManager> getManagers() {
    List<FoldManager> live = new ArrayList<>(managers.size());
    for (Iterator<Reference<FoldManager>> it = managers.iterator(); it.hasNext(); ) {
        Reference<FoldManager> ref = it.next();
        FoldManager x = ref.get();
        if (x == null) {
            it.remove();
        } else {
            live.add(x);
        }
    }
    return live;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ParsingFoldSupport.java


示例4: addFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FileData addFoldManager(FileObject f, FoldManager m) {
    if (f == null) {
        return null;
    }
    FileData fd = getFileData(f);
    fd.addManager(m);
    return fd;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ParsingFoldSupport.java


示例5: FoldOperationImpl

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldOperationImpl(FoldHierarchyExecution execution,
FoldManager manager, int priority) {
    this.execution = execution;
    this.manager = manager;
    this.priority = priority;

    this.operation = SpiPackageAccessor.get().createFoldOperation(this);
    if (manager != null) { // manager for root-fold is null
        manager.init(getOperation());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:FoldOperationImpl.java


示例6: setUp

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public void setUp() throws Exception {
    super.setUp();
    manager = new TestFoldManager();
    
    class FMF implements FoldManagerFactory {
        @Override
        public FoldManager createFoldManager() {
            return manager;
        }
    }

    final FoldHierarchyTestEnv env = new FoldHierarchyTestEnv(
            new FMF()
    );
    doc = env.getDocument();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < 20; i++) {
        sb.append("12345678901234567890");
    }
    doc.insertString(0, sb.toString(), null);
    
    hierarchy = env.getHierarchy();
    fold35 = FoldUtilities.findOffsetFold(hierarchy, 35);
    fold90 = FoldUtilities.findOffsetFold(hierarchy, 90);
    fold102 = FoldUtilities.findOffsetFold(hierarchy, 102);
    hierarchy.collapse(fold35);
    hierarchy.collapse(fold90);

    hierarchy.addFoldHierarchyListener(this);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:31,代码来源:FoldGuardTest.java


示例7: setUp

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public void setUp() throws Exception {
    super.setUp();
    Lookup.getDefault();
    prepareTest(new String[] {
            "/org/netbeans/modules/editor/resources/layer.xml",
            "/META-INF/generated-layer.xml",
            "/org/netbeans/modules/defaults/mf-layer.xml",
    },
    new Object[0]);
    // hack:
    MimeLookup.getLookup("").lookup(FoldHierarchyMonitor.class);
    env = new FoldHierarchyTestEnv(new FoldManagerFactory() {
        @Override
        public FoldManager createFoldManager() {
            return fm = new FM();
        }
    });
    pane = env.getPane();
    env.getPane().setEditorKit(new Kit());
    env.getDocument().insertString(0, "123456789-123456789-123 aa 89-123456789-1234567890", null);
    
    // ensure initialized
    env.getHierarchy(); 
    // cannot be done in FoldManager, as setEditorKit() will replace document and reinitialize folds in 2nd thread, which may
    // complete even faster than insertString(), so BLE could be thrown.
    FoldHierarchyTransaction tran = fm.op.openTransaction();
    fm.op.addToHierarchy(
            FT, 
            "", 
            true, 
            10, 
            40, 
            1, 1, 
            null, 
            tran);
    tran.commit();
                
    fold = FoldUtilities.findOffsetFold(env.getHierarchy(), 25);
   // get x/y of the folded part:
    JFrame fr = new JFrame("test");
    fr.setBounds(0, 0, 400, 100);
    fr.add(pane);
    fr.setVisible(true);
    
    delegate = (Callable<Boolean>)pane.getClientProperty("org.netbeans.api.fold.expander");
    pane.putClientProperty("org.netbeans.api.fold.expander", new Callable<Boolean>() {
        public Boolean call() throws Exception {
            return retValue = delegate.call();
        }
        
        public boolean equals(Object o) {
            return retValue = delegate.equals(o);
        }
    });
    pane.requestFocus();
    selectWordCalled = false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:58,代码来源:BaseCaretTest.java


示例8: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager createFoldManager() {
    return new CustomFoldManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:CustomFoldManager.java


示例9: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager createFoldManager () {
    return new LanguagesFoldManager ();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:LanguagesFoldManager.java


示例10: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager createFoldManager() {
    return new GsfFoldManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:GsfFoldManagerFactory.java


示例11: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
@Override
public FoldManager createFoldManager() {
    return new ConsoleFoldManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ConsoleFoldManager.java


示例12: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager createFoldManager() {
    return new JavaElementFoldManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:JavaElementFoldManagerFactory.java


示例13: setManagersAndCarets

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
synchronized void setManagersAndCarets(List<FoldManager> mgrs, int[] poss) {
    this.mgrsToUpdate = mgrs.iterator();
    this.caretPositions = poss;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ParsingFoldSupport.java


示例14: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
@Override
public final FoldManager createFoldManager() {
    return new FM(getRegistrar(this));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:ParsingFoldSupport.java


示例15: addManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
synchronized void addManager(FoldManager m) {
    managers.add(new WeakReference(m));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ParsingFoldSupport.java


示例16: removeFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public void removeFoldManager(FileObject f, FoldManager m) {
    if (f == null) {
        return;
    }
    getFileData(f).removeManager(m);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:7,代码来源:ParsingFoldSupport.java


示例17: getFoldManagers

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public Collection<FoldManager> getFoldManagers(FileObject f) {
    return getFileData(f).getManagers();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:ParsingFoldSupport.java


示例18: createFoldManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager createFoldManager() {
    return new XmlFoldManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:XmlFoldManagerFactory.java


示例19: getManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
private FoldManager getManager(Fold fold) {
    return getOperation(fold).getManager();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:FoldHierarchyTransactionImpl.java


示例20: getManager

import org.netbeans.spi.editor.fold.FoldManager; //导入依赖的package包/类
public FoldManager getManager() {
    return manager;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:4,代码来源:FoldOperationImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BrowserView类代码示例发布时间:2022-05-22
下一篇:
Java Envelope类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap