コード例 #1
0
 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);
    }
  }
コード例 #3
0
  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);
 }
コード例 #7
0
 public UpdateRootInfo getUpdateRootInfo(File file, final SvnVcs svnVcs) {
   if (!myUpdateRootInfos.containsKey(file)) {
     myUpdateRootInfos.put(file, new UpdateRootInfo(file, svnVcs));
   }
   return myUpdateRootInfos.get(file);
 }
コード例 #8
0
 public MergeRootInfo getMergeRootInfo(final File file, final SvnVcs svnVcs) {
   if (!myMergeRootInfos.containsKey(file)) {
     myMergeRootInfos.put(file, new MergeRootInfo(file, svnVcs));
   }
   return myMergeRootInfos.get(file);
 }
コード例 #9
0
 private void addTask(LocalTaskImpl task) {
   myTasks.put(task.getId(), task);
   myDispatcher.getMulticaster().taskAdded(task);
 }