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


Java TopComponent.getPersistenceType方法代码示例

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


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

示例1: add

import org.openide.windows.TopComponent; //导入方法依赖的package包/类
/**
 * Track the given window
 * @param tc TopComponent
 * @param mode Mode the window is docked to
 */
void add( TopComponent tc, ModeImpl mode ) {
    if( tc.getPersistenceType() == TopComponent.PERSISTENCE_NEVER )
        return;
    String tcId = WindowManagerImpl.getInstance().findTopComponentID( tc );
    if( null == tcId )
        return;
    if( viewIds.contains( tcId ) || editorIds.contains( tcId ) )
        return;
    if( mode.getKind() != Constants.MODE_KIND_EDITOR ) {
        if( editors.contains( tc ) ) {
            editorIds.add( tcId );
        } else {
            viewIds.add( tcId );
        }
    } else {
        editors.add( tc );
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:24,代码来源:TopComponentTracker.java

示例2: assertPersistence

import org.openide.windows.TopComponent; //导入方法依赖的package包/类
private void assertPersistence(String msg, int pt, TopComponent cmv) {
    CharSequence log = Log.enable("org.netbeans.core.multiview", Level.WARNING);
    int res = cmv.getPersistenceType();
    if (log.length() > 0) {
        fail("There should be no warnings to compute getPersistenceType():\n" + log);
    }
    assertEquals(msg, pt, res);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:MultiViewProcessorTest.java

示例3: run

import org.openide.windows.TopComponent; //导入方法依赖的package包/类
@Override
public void run() {
    for (TopComponent tc : TopComponent.getRegistry().getOpened()) {
        if (TopComponent.PERSISTENCE_NEVER == tc.getPersistenceType()) {
            addFile(tc);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:RecentFiles.java

示例4: isViewTopComponent

import org.openide.windows.TopComponent; //导入方法依赖的package包/类
/**
 * Check whether the given TopComponent is an editor window or a view window.
 * @param tc
 * @return True if the given TopComponent has persistence type <code>PERSISTENCE_ALWAYS</code>
 * or <code>PERSISTENCE_ONLY_OPENED</code> and was initially opened in a view or
 * sliding mode. Also returns true if the given TopComponent has peristence type
 * <code>PERSISTENCE_NEVER</code> and is docked in non-editor mode.
 * Returns false in all other cases.
 */
public boolean isViewTopComponent( TopComponent tc ) {
    if( tc.getPersistenceType() == TopComponent.PERSISTENCE_NEVER ) {
        ModeImpl mode = ( ModeImpl ) WindowManagerImpl.getInstance().findMode( tc );
        return null != mode && mode.getKind() != Constants.MODE_KIND_EDITOR;
    }
    String id = WindowManagerImpl.getInstance().findTopComponentID( tc );
    return id != null && viewIds.contains( id );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:TopComponentTracker.java

示例5: persistenceType

import org.openide.windows.TopComponent; //导入方法依赖的package包/类
/** Just a method to wrap up all calls to TopComponent.getPersistenceType(),
 * so we can do some tricks with the return value in future.
 * 
 * @param tc top component to find persistence type for
 * @return the type
 */
private static int persistenceType(TopComponent tc) {
    return tc.getPersistenceType();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:PersistenceManager.java


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