当前位置: 首页>>代码示例>>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;未经允许,请勿转载。