本文整理汇总了Java中com.intellij.openapi.components.StateStorage类的典型用法代码示例。如果您正苦于以下问题:Java StateStorage类的具体用法?Java StateStorage怎么用?Java StateStorage使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StateStorage类属于com.intellij.openapi.components包,在下文中一共展示了StateStorage类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerProjectToReload
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
private void registerProjectToReload(@Nullable final Project project, final VirtualFile cause, @Nullable final StateStorage storage) {
if (LOG.isDebugEnabled()) {
LOG.debug("[RELOAD] Registering project to reload: " + cause, new Exception());
}
if (project != null) {
synchronized (myChangedProjectFiles) {
List<Pair<VirtualFile, StateStorage>> changedProjectFiles = myChangedProjectFiles.get(project);
if (changedProjectFiles == null) {
changedProjectFiles = new ArrayList<Pair<VirtualFile, StateStorage>>();
myChangedProjectFiles.put(project, changedProjectFiles);
}
changedProjectFiles.add(new Pair<VirtualFile, StateStorage>(cause, storage));
}
}
else {
myChangedApplicationFiles.add(new Pair<VirtualFile, StateStorage>(cause, storage));
}
myChangedFilesAlarm.cancelAllRequests();
myChangedFilesAlarm.addRequest(new Runnable() {
@Override
public void run() {
LOG.debug("[RELOAD] Scheduling reload application & project, myReloadBlockCount = " + myReloadBlockCount);
if (myReloadBlockCount.get() == 0) {
scheduleReloadApplicationAndProject();
}
}
}, 444);
}
示例2: CompoundSaveSession
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public CompoundSaveSession(final CompoundExternalizationSession compoundExternalizationSession) {
final Collection<StateStorage> stateStorages = compoundExternalizationSession.getStateStorages();
for (StateStorage stateStorage : stateStorages) {
mySaveSessions.put(stateStorage, stateStorage.startSave(compoundExternalizationSession.getExternalizationSession(stateStorage)));
}
}
示例3: getAllStorageFilesToSave
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public List<IFile> getAllStorageFilesToSave() throws StateStorageException {
List<IFile> result = new ArrayList<IFile>();
for (StateStorage stateStorage : mySaveSessions.keySet()) {
final StateStorage.SaveSession saveSession = mySaveSessions.get(stateStorage);
result.addAll(saveSession.getStorageFilesToSave());
}
return result;
}
示例4: finishSave
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public void finishSave() {
RuntimeException re = null;
for (StateStorage stateStorage : mySaveSessions.keySet()) {
final StateStorage.SaveSession saveSession = mySaveSessions.get(stateStorage);
try {
stateStorage.finishSave(saveSession);
} catch(RuntimeException t) {
re = t;
}
}
if (re != null) {
throw re;
}
}
示例5: getAllStorageFiles
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public List<IFile> getAllStorageFiles() {
List<IFile> result = new ArrayList<IFile>();
for (StateStorage.SaveSession saveSession : mySaveSessions.values()) {
result.addAll(saveSession.getAllStorageFiles());
}
return result;
}
示例6: getExternalizationSession
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@NotNull
public StateStorage.ExternalizationSession getExternalizationSession(@NotNull StateStorage stateStore) {
StateStorage.ExternalizationSession session = mySessions.get(stateStore);
if (session == null) {
mySessions.put(stateStore, session = stateStore.startExternalization());
}
return session;
}
示例7: testSetStateOverridesOldState
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public void testSetStateOverridesOldState() throws Exception {
MyXmlElementStorage storage =
new MyXmlElementStorage(document(tag("root", tag("component", attr("name", "test"), tag("foo")))), myParentDisposable);
Element newState = tag("component", attr("name", "test"), tag("bar"));
StateStorage.ExternalizationSession externalizationSession = storage.startExternalization();
externalizationSession.setState(this, "test", newState, null);
storage.startSave(externalizationSession).save();
assertNotNull(storage.mySavedDocument);
assertNotNull(storage.mySavedDocument.getRootElement().getChild("component").getChild("bar"));
assertNull(storage.mySavedDocument.getRootElement().getChild("component").getChild("foo"));
}
示例8: analyzeExternalChanges
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Override
@Nullable
public Set<String> analyzeExternalChanges(@NotNull final Set<Pair<VirtualFile,StateStorage>> changedFiles) {
final Set<String> result = super.analyzeExternalChanges(changedFiles);
if (result == null) return null;
for (SaveSession moduleSaveSession : myModuleSaveSessions) {
final Set<String> s = moduleSaveSession.analyzeExternalChanges(changedFiles);
if (s == null) return null;
result.addAll(s);
}
return result;
}
示例9: testSetStateOverridesOldState
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public void testSetStateOverridesOldState() throws Exception {
MyXmlElementStorage storage =
new MyXmlElementStorage(tag("root", tag("component", attr("name", "test"), tag("foo"))));
Element newState = tag("component", attr("name", "test"), tag("bar"));
StateStorage.ExternalizationSession externalizationSession = storage.startExternalization();
externalizationSession.setState(this, "test", newState, null);
externalizationSession.createSaveSession().save();
assertNotNull(storage.mySavedElement);
assertNotNull(storage.mySavedElement.getChild("component").getChild("bar"));
assertNull(storage.mySavedElement.getChild("component").getChild("foo"));
}
示例10: ReadOnlyModificationException
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
public ReadOnlyModificationException(@NotNull VirtualFile file, @Nullable Throwable cause, StateStorage.SaveSession session) {
super(cause);
myFile = file;
mySession = session;
}
示例11: getSession
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Nullable
public StateStorage.SaveSession getSession() {
return mySession;
}
示例12: startExternalization
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@NotNull
StateStorage.ExternalizationSession startExternalization();
示例13: createSaveSession
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Nullable
@Override
public StateStorage.SaveSession createSaveSession() {
return modifiedContent.isEmpty() && deletedContent.isEmpty() ? null : this;
}
示例14: reload
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Override
public boolean reload(@NotNull final Set<Pair<VirtualFile,StateStorage>> changedFiles) {
throw new UnsupportedOperationException("Method reload not implemented in " + getClass());
}
示例15: saveChangedProjectFile
import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
private void saveChangedProjectFile(final VirtualFile file, @Nullable final Project project, final StateStorage storage) {
if (file.exists()) {
copyToTemp(file);
}
registerProjectToReload(project, file, storage);
}