本文整理匯總了Java中org.eclipse.ui.IPersistableElement.saveState方法的典型用法代碼示例。如果您正苦於以下問題:Java IPersistableElement.saveState方法的具體用法?Java IPersistableElement.saveState怎麽用?Java IPersistableElement.saveState使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IPersistableElement
的用法示例。
在下文中一共展示了IPersistableElement.saveState方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveState
import org.eclipse.ui.IPersistableElement; //導入方法依賴的package包/類
/**
* Saves the object state in the given memento.
*
* @param memento the memento to save the object state in
*/
public void saveState(IMemento memento) {
if (!isConsistent() || input == null) {
return;
}
IPersistableElement persistable = input.getPersistable();
memento.putString("factoryID", persistable.getFactoryId());
memento.putString("id", editorId);
memento.putInteger("number", number);
/*
* Store IPersistable of the IEditorInput in a separate section
* since it could potentially use a tag already used in the parent
* memento and thus overwrite data.
*/
IMemento persistableMemento = memento.createChild("persistable");
persistable.saveState(persistableMemento);
}
示例2: saveItem
import org.eclipse.ui.IPersistableElement; //導入方法依賴的package包/類
public static void saveItem(IMemento memento, IAdaptable element) {
IPersistableElement persistable= (IPersistableElement)element.getAdapter(IPersistableElement.class);
if (persistable != null) {
memento.putString(
TAG_FACTORY_ID,
persistable.getFactoryId());
persistable.saveState(memento);
}
}