コード例 #1
0
 @Override
 public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
   DartX.todo("indent");
   String partitioning = getConfiguredDocumentPartitioning(sourceViewer);
   if (DartPartitions.DART_DOC.equals(contentType)
       || DartPartitions.DART_MULTI_LINE_COMMENT.equals(contentType)) {
     return new IAutoEditStrategy[] {new DartDocAutoIndentStrategy(partitioning)};
   } else if (DartPartitions.DART_MULTI_LINE_STRING.equals(contentType)) {
     return new IAutoEditStrategy[] {
       new SmartSemicolonAutoEditStrategy(partitioning),
       new DartStringAutoIndentStrategy(partitioning)
     };
   } else if (DartPartitions.DART_STRING.equals(contentType)) {
     return new IAutoEditStrategy[] {
       new SmartSemicolonAutoEditStrategy(partitioning),
       new DartStringAutoIndentStrategy(partitioning)
     };
   } else if (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType)) {
     return new IAutoEditStrategy[] {
       new SmartSemicolonAutoEditStrategy(partitioning),
       new DartAutoIndentStrategy(partitioning, getProject(), sourceViewer)
     };
   } else {
     return new IAutoEditStrategy[] {
       new DartAutoIndentStrategy(partitioning, getProject(), sourceViewer)
     };
   }
 }
コード例 #2
0
 @Override
 public ITextDoubleClickStrategy getDoubleClickStrategy(
     ISourceViewer sourceViewer, String contentType) {
   if (DartPartitions.DART_DOC.equals(contentType)
       || DartPartitions.DART_SINGLE_LINE_DOC.equals(contentType)) {
     return new DartDocDoubleClickStrategy();
   }
   if (DartPartitions.DART_MULTI_LINE_COMMENT.equals(contentType)
       || DartPartitions.DART_SINGLE_LINE_COMMENT.equals(contentType)) {
     return new DefaultTextDoubleClickStrategy();
   } else if (DartPartitions.DART_STRING.equals(contentType)
       || DartPartitions.DART_MULTI_LINE_STRING.equals(contentType)) {
     return new DartStringDoubleClickSelector(getConfiguredDocumentPartitioning(sourceViewer));
   }
   if (fJavaDoubleClickSelector == null) {
     fJavaDoubleClickSelector = new DartDoubleClickSelector();
     fJavaDoubleClickSelector.setSourceVersion(
         fPreferenceStore.getString(JavaScriptCore.COMPILER_SOURCE));
   }
   return fJavaDoubleClickSelector;
 }