本文整理匯總了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;
}