當前位置: 首頁>>代碼示例>>Java>>正文


Java TopComponent.PERSISTENCE_ALWAYS屬性代碼示例

本文整理匯總了Java中org.openide.windows.TopComponent.PERSISTENCE_ALWAYS屬性的典型用法代碼示例。如果您正苦於以下問題:Java TopComponent.PERSISTENCE_ALWAYS屬性的具體用法?Java TopComponent.PERSISTENCE_ALWAYS怎麽用?Java TopComponent.PERSISTENCE_ALWAYS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.openide.windows.TopComponent的用法示例。


在下文中一共展示了TopComponent.PERSISTENCE_ALWAYS屬性的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getPersistenceType

/**
 * Delegates the value to the element descriptions.
 */
int getPersistenceType() {
    
    // should also take the opened/created elements into account.
    // no need to serialize the tc when the element that want to be serialized, was not 
    // even opened?!? but maybe handle this during the serialization proceess, avoid creating
    // the element when serializing.
    int type = TopComponent.PERSISTENCE_NEVER;
    if( null != model ) {
        MultiViewDescription[] descs = model.getDescriptions();
        for (int i = 0; i < descs.length; i++) {
            if (context == null && !(descs[i] instanceof Serializable)) {
                Logger.getLogger(MultiViewTopComponent.class.getName()).warning(
                        "The MultiviewDescription instance " + descs[i].getClass() + " is not serializable. Cannot persist TopComponent.");
                type = TopComponent.PERSISTENCE_NEVER;
                break;
            }
            if (descs[i].getPersistenceType() == TopComponent.PERSISTENCE_ALWAYS) {
                type = descs[i].getPersistenceType();
                // cannot ge any better than that.
            }
            if (descs[i].getPersistenceType() == TopComponent.PERSISTENCE_ONLY_OPENED &&
                 type != TopComponent.PERSISTENCE_ALWAYS) {
                type = descs[i].getPersistenceType();
                // go on searching..
            }

        }
    }
    return type;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:33,代碼來源:MultiViewPeer.java

示例2: create

@MultiViewElement.Registration(
    displayName="Contextual",
    mimeType="text/context",
    persistenceType=TopComponent.PERSISTENCE_ALWAYS,
    preferredID="context"
)
public static CntxMVE create(Lookup lkp) {
    return new CntxMVE(lkp);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:MultiViewProcessorTest.java

示例3: isTopComponentPersistentWhenClosed

public static boolean isTopComponentPersistentWhenClosed(TopComponent tc) {
    int persistenceType = persistenceType(tc);
    if (persistenceType == TopComponent.PERSISTENCE_ALWAYS) {
        return true;
    } else {
        return false;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:PersistenceManager.java

示例4: getPersistenceType

@Override
public int getPersistenceType() {
    return TopComponent.PERSISTENCE_ALWAYS;
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:4,代碼來源:FilterTopComponent.java

示例5: getPersistenceType

public int getPersistenceType() {
    return TopComponent.PERSISTENCE_ALWAYS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:3,代碼來源:SvnVersioningTopComponent.java

示例6: getPersistenceType

/**
 */
@Override
public int getPersistenceType() {
    return TopComponent.PERSISTENCE_ALWAYS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:ResultWindow.java

示例7: getPersistenceType

/** Overriden to explicitely set persistence type of TestComponent00
 * to PERSISTENCE_ALWAYS */
public int getPersistenceType() {
    return TopComponent.PERSISTENCE_ALWAYS;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:Component00.java


注:本文中的org.openide.windows.TopComponent.PERSISTENCE_ALWAYS屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。