コード例 #1
0
ファイル: TreeHighlighter.java プロジェクト: Guojin118/MPS-1
 private void registerNode(@NotNull final MPSTreeNode node) {
   final Feature feature = myFeatureExtractor.getFeature(node);
   if (feature != null) {
     synchronized (myFeaturesHolder) {
       myFeaturesHolder.putNodeWithFeature(feature, node);
     }
     myCommandQueue.runTask(
         new Runnable() {
           public void run() {
             ModelAccess.instance()
                 .runReadAction(
                     new Runnable() {
                       public void run() {
                         synchronized (myFeaturesHolder) {
                           // check if node isn't already removed from tree
                           if (myFeaturesHolder.getNodesByFeature(feature).contains(node)) {
                             rehighlightNode(node, feature);
                           }
                         }
                       }
                     });
           }
         });
   }
 }
コード例 #2
0
ファイル: TreeHighlighter.java プロジェクト: Guojin118/MPS-1
 public void rehighlightAllFeaturesNow() {
   ModelAccess.assertLegalRead();
   synchronized (myFeaturesHolder) {
     for (Feature f : ListSequence.fromList(myFeaturesHolder.getAllModelFeatures())) {
       rehighlightFeatureAndDescendants(f);
     }
   }
 }
コード例 #3
0
ファイル: TreeHighlighter.java プロジェクト: Guojin118/MPS-1
 private void unregisterNode(@NotNull MPSTreeNode node) {
   Feature feature = myFeatureExtractor.getFeature(node);
   if (feature != null) {
     synchronized (myFeaturesHolder) {
       if (myFeaturesHolder.getNodesByFeature(feature).contains(node)) {
         myFeaturesHolder.removeNodeWithFeature(feature, node);
       } else {
         if (LOG.isEnabledFor(Priority.ERROR)) {
           LOG.error(
               "trying to remove tree node which was not registered: "
                   + node.getClass().getName()
                   + " "
                   + feature);
         }
       }
     }
     unhighlightNode(node);
   }
 }
コード例 #4
0
ファイル: TreeHighlighter.java プロジェクト: Guojin118/MPS-1
 private void rehighlightFeature(@NotNull Feature feature) {
   for (MPSTreeNode node :
       CollectionSequence.fromCollection(myFeaturesHolder.getNodesByFeature(feature))) {
     rehighlightNode(node, feature);
   }
 }