public void putData(String kind, String realm, Object data) {
   if (data == null) {
     myStorage.remove(kind + "$" + realm);
   } else {
     myStorage.put(kind + "$" + realm, data);
   }
 }
예제 #2
0
  private void updateWatchedRoots() {
    Set<String> pathsToRemove = new HashSet<String>(myWatchedOutputs.keySet());
    Set<String> toAdd = new HashSet<String>();
    for (Artifact artifact : getArtifacts()) {
      final String path = artifact.getOutputPath();
      if (path != null && path.length() > 0) {
        pathsToRemove.remove(path);
        if (!myWatchedOutputs.containsKey(path)) {
          toAdd.add(path);
        }
      }
    }

    List<LocalFileSystem.WatchRequest> requestsToRemove =
        new ArrayList<LocalFileSystem.WatchRequest>();
    for (String path : pathsToRemove) {
      final LocalFileSystem.WatchRequest request = myWatchedOutputs.remove(path);
      ContainerUtil.addIfNotNull(request, requestsToRemove);
    }

    Set<LocalFileSystem.WatchRequest> newRequests =
        LocalFileSystem.getInstance().replaceWatchedRoots(requestsToRemove, toAdd, null);
    for (LocalFileSystem.WatchRequest request : newRequests) {
      myWatchedOutputs.put(request.getRootPath(), request);
    }
  }
  private void doUpdate(@Nullable Runnable onComplete) {
    try {
      List<Task> issues =
          getIssuesFromRepositories(
              null, myConfig.updateIssuesCount, 0, false, new EmptyProgressIndicator());
      if (issues == null) return;

      synchronized (myIssueCache) {
        myIssueCache.clear();
        for (Task issue : issues) {
          myIssueCache.put(issue.getId(), issue);
        }
      }
      // update local tasks
      synchronized (myTasks) {
        for (Map.Entry<String, LocalTask> entry : myTasks.entrySet()) {
          Task issue = myIssueCache.get(entry.getKey());
          if (issue != null) {
            entry.getValue().updateFromIssue(issue);
          }
        }
      }
    } finally {
      if (onComplete != null) {
        onComplete.run();
      }
      myUpdating = false;
    }
  }
 public void setHighlightingSettingForRoot(
     @NotNull PsiElement root, @NotNull FileHighlightingSetting setting) {
   final PsiFile containingFile = root.getContainingFile();
   final VirtualFile virtualFile = containingFile.getVirtualFile();
   if (virtualFile == null) return;
   FileHighlightingSetting[] defaults = myHighlightSettings.get(virtualFile);
   int rootIndex = PsiUtilBase.getRootIndex(root);
   if (defaults != null && rootIndex >= defaults.length) defaults = null;
   if (defaults == null) defaults = getDefaults(containingFile);
   defaults[rootIndex] = setting;
   boolean toRemove = true;
   for (FileHighlightingSetting aDefault : defaults) {
     if (aDefault != FileHighlightingSetting.NONE) toRemove = false;
   }
   if (toRemove) {
     myHighlightSettings.remove(virtualFile);
   } else {
     myHighlightSettings.put(virtualFile, defaults);
   }
 }
 @Override
 public void loadState(Element element) {
   List children = element.getChildren(SETTING_TAG);
   for (final Object aChildren : children) {
     final Element child = (Element) aChildren;
     final String url = child.getAttributeValue(FILE_ATT);
     if (url == null) continue;
     final VirtualFile fileByUrl = VirtualFileManager.getInstance().findFileByUrl(url);
     if (fileByUrl != null) {
       final List<FileHighlightingSetting> settings = new ArrayList<FileHighlightingSetting>();
       int index = 0;
       while (child.getAttributeValue(ROOT_ATT_PREFIX + index) != null) {
         final String attributeValue = child.getAttributeValue(ROOT_ATT_PREFIX + index++);
         settings.add(Enum.valueOf(FileHighlightingSetting.class, attributeValue));
       }
       myHighlightSettings.put(
           fileByUrl, settings.toArray(new FileHighlightingSetting[settings.size()]));
     }
   }
 }
예제 #6
0
 static {
   ourLafClassesAliases.put("idea.dark.laf.classname", DarculaLookAndFeelInfo.CLASS_NAME);
 }
 public UpdateRootInfo getUpdateRootInfo(File file, final SvnVcs svnVcs) {
   if (!myUpdateRootInfos.containsKey(file)) {
     myUpdateRootInfos.put(file, new UpdateRootInfo(file, svnVcs));
   }
   return myUpdateRootInfos.get(file);
 }
 public MergeRootInfo getMergeRootInfo(final File file, final SvnVcs svnVcs) {
   if (!myMergeRootInfos.containsKey(file)) {
     myMergeRootInfos.put(file, new MergeRootInfo(file, svnVcs));
   }
   return myMergeRootInfos.get(file);
 }
 private void addTask(LocalTaskImpl task) {
   myTasks.put(task.getId(), task);
   myDispatcher.getMulticaster().taskAdded(task);
 }