use of org.eclipse.core.resources.IStorage in project jbosstools-hibernate by jbosstools.
the class CriteriaEditorInputFactory method saveState.
public static void saveState(IMemento memento, CriteriaEditorInput input) {
// Save the editor input type.
memento.putString(KEY_EDITOR_INPUT_TYPE, ID_STORAGE_EDITOR_INPUT);
String storageName = null;
// $NON-NLS-1$
String storageContent = "";
// $NON-NLS-1$
String configurationName = "";
IStorage storage = input.getStorage();
if (storage != null) {
storageName = storage.getName();
if (storage instanceof CriteriaEditorStorage) {
CriteriaEditorStorage criteriaEditorStorage = (CriteriaEditorStorage) storage;
storageContent = criteriaEditorStorage.getContentsString();
configurationName = criteriaEditorStorage.getConfigurationName();
}
}
// Save the storage content name in the memento.
memento.putString(KEY_STORAGE_NAME, storageName);
// Save the storage content string in the memento.
memento.putString(KEY_STORAGE_CONTENT, storageContent);
memento.putString(KEY_CONFIGURATION_NAME, configurationName);
}
Aggregations