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


Java IJavaModelMarker.TASK_MARKER属性代码示例

本文整理汇总了Java中org.eclipse.jdt.core.IJavaModelMarker.TASK_MARKER属性的典型用法代码示例。如果您正苦于以下问题:Java IJavaModelMarker.TASK_MARKER属性的具体用法?Java IJavaModelMarker.TASK_MARKER怎么用?Java IJavaModelMarker.TASK_MARKER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jdt.core.IJavaModelMarker的用法示例。


在下文中一共展示了IJavaModelMarker.TASK_MARKER属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testTodoTasks1

@Test
public void testTodoTasks1() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        // TODO: XXX\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:38,代码来源:ReorgQuickFixTest.java

示例2: testTodoTasks2

@Test
public void testTodoTasks2() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        // Some other text TODO: XXX\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        // Some other text \n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:ReorgQuickFixTest.java

示例3: testTodoTasks3

@Test
public void testTodoTasks3() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        /* TODO: XXX */\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:38,代码来源:ReorgQuickFixTest.java

示例4: testTodoTasks4

@Test
public void testTodoTasks4() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        /**\n");
  buf.append("        TODO: XXX\n");
  buf.append("        */\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:40,代码来源:ReorgQuickFixTest.java

示例5: testTodoTasks6

@Test
public void testTodoTasks6() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        ;// TODO: XXX\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        ;\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:ReorgQuickFixTest.java

示例6: testTodoTasks7

@Test
public void testTodoTasks7() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        /* TODO: XXX*/;\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        ;\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:39,代码来源:ReorgQuickFixTest.java

示例7: testTodoTasks5

@Test
public void testTodoTasks5() throws Exception {
  IPackageFragment pack1 = fSourceFolder.createPackageFragment("test1", false, null);
  StringBuffer buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        /**\n");
  buf.append("        Some other text: TODO: XXX\n");
  buf.append("        */\n");
  buf.append("    }\n");
  buf.append("}\n");
  ICompilationUnit cu = pack1.createCompilationUnit("E.java", buf.toString(), false, null);

  String str = "TODO: XXX";
  AssistContext context = getCorrectionContext(cu, buf.toString().indexOf(str), 0);
  ProblemLocation problem =
      new ProblemLocation(
          buf.toString().indexOf(str),
          str.length(),
          IProblem.Task,
          new String[0],
          true,
          IJavaModelMarker.TASK_MARKER);
  ArrayList proposals = collectCorrections(context, problem);

  assertNumberOfProposals(proposals, 1);
  assertCorrectLabels(proposals);

  CUCorrectionProposal proposal = (CUCorrectionProposal) proposals.get(0);
  String preview = getPreviewContent(proposal);

  buf = new StringBuffer();
  buf.append("package test1;\n");
  buf.append("public class E {\n");
  buf.append("    public void foo() {\n");
  buf.append("        /**\n");
  buf.append("        Some other text: \n");
  buf.append("        */\n");
  buf.append("    }\n");
  buf.append("}\n");
  assertEqualString(preview, buf.toString());
}
 
开发者ID:eclipse,项目名称:che,代码行数:43,代码来源:ReorgQuickFixTest.java


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