当前位置: 首页>>代码示例>>Java>>正文


Java StateStorage类代码示例

本文整理汇总了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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:ProjectManagerImpl.java

示例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)));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:CompoundSaveSession.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:CompoundSaveSession.java

示例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;
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:CompoundSaveSession.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:9,代码来源:CompoundSaveSession.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:CompoundExternalizationSession.java

示例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"));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:XmlElementStorageTest.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:ProjectWithModulesStoreImpl.java

示例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"));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:XmlElementStorageTest.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ReadOnlyModificationException.java

示例11: getSession

import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Nullable
public StateStorage.SaveSession getSession() {
  return mySession;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ReadOnlyModificationException.java

示例12: startExternalization

import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@NotNull
StateStorage.ExternalizationSession startExternalization();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:3,代码来源:ClasspathStorageProvider.java

示例13: createSaveSession

import com.intellij.openapi.components.StateStorage; //导入依赖的package包/类
@Nullable
@Override
public StateStorage.SaveSession createSaveSession() {
  return modifiedContent.isEmpty() && deletedContent.isEmpty() ? null : this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ClasspathSaveSession.java

示例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());
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:MockProjectStore.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:7,代码来源:ProjectManagerImpl.java


注:本文中的com.intellij.openapi.components.StateStorage类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。