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