本文整理汇总了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;
}
示例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);
}
示例3: isTopComponentPersistentWhenClosed
public static boolean isTopComponentPersistentWhenClosed(TopComponent tc) {
int persistenceType = persistenceType(tc);
if (persistenceType == TopComponent.PERSISTENCE_ALWAYS) {
return true;
} else {
return false;
}
}
示例4: getPersistenceType
@Override
public int getPersistenceType() {
return TopComponent.PERSISTENCE_ALWAYS;
}
示例5: getPersistenceType
public int getPersistenceType() {
return TopComponent.PERSISTENCE_ALWAYS;
}
示例6: getPersistenceType
/**
*/
@Override
public int getPersistenceType() {
return TopComponent.PERSISTENCE_ALWAYS;
}
示例7: getPersistenceType
/** Overriden to explicitely set persistence type of TestComponent00
* to PERSISTENCE_ALWAYS */
public int getPersistenceType() {
return TopComponent.PERSISTENCE_ALWAYS;
}