컴포지트 치트 시트

컴포지트 치트 시트는 복합 문제점을 소형 타스크 세트로 분해하여 해당 문제점을 해결할 수 있도록 안내합니다. 컴포지트 치트 시트는 org.eclipse.ui.cheatsheets.cheatSheetContent 확장점을 사용하여 등록됩니다.

컨텐츠 파일 형식

컴포지트 치트 시트 컨텐츠 자체는 컴포지트 치트 시트 컨텐츠 파일 스펙을 따르는 별도의 파일에 정의됩니다. 컨텐츠 파일은 XML 파일이며 그룹에서 트리 구조로 구성되는 타스크 세트로 구성됩니다.

<compositeCheatsheet>는 컴포지트 치트 시트의 루트 요소로, <task> 또는 <taskGroup>이 될 수 있는 단일 루트 타스크를 갖습니다. <taskGroup> 요소는 하나 이상의 하위를 가질 수 있으며, 각 하위는 <task> 또는 <taskGroup>일 수 있습니다. <task>에는 하위 타스크가 없습니다.

타스크 및 타스크 그룹에는 <intro> 요소(타스크를 시작하기 전에 표시되는 텍스트가 들어 있음) 및 <onCompletion> 요소(타스크가 완료된 경우 표시되는 텍스트가 들어 있음)가 포함될 수 있습니다. 두 <intro> 및 <onCompletion> 요소에는 양식 텍스트 마크업이 포함될 수 있습니다. 아래 예제에서 <b> 및 </b> 태그는 텍스트를 굵게 표시하는 데 사용됩니다.

타스크에는 <param> 요소도 포함될 수 있습니다. 치트 시트 타스크는 다음 매개변수를 가질 수 있습니다. "id"는 등록된 치트 시트의 ID이고, "path"는 치트 시트 컨텐츠 파일의 상대 경로 또는 URL이고, "skipIntro"는 true인 경우 소개 부분이 아닌 첫 번째 단계에서 치트 시트가 시작되게 하는 부울 매개변수입니다. "id" 또는 "path"를 지정해야 합니다(둘 모두를 지정할 수는 없음).

타스크 "B"에서 타스크 "A"로의 <dependency> 노드는 타스크 B를 시작하기 전에 타스크 A가 완료되어야 함을 나타냅니다.

치트 시트 타스크 매개변수

타스크에 kind = "cheatsheet"가 있는 경우 치트 시트는 해당 타스크가 시작되면 열립니다. 치트 시트 타스크에 사용할 수 있는 세 가지의 매개변수가 있습니다.

매개변수 이름  설명
id 확장점 org.eclipse.ui.cheatsheets.cheatSheetContent를 사용하여 등록된 치트 시트 ID. 이를 사용하여 해당 타스크와 연관되는 치트 시트를 식별합니다. ID나 경로 매개변수(둘 다는 아님)를 지정해야 합니다.
path 치트 시트 컨텐츠 파일의 URL. 절대 URL이거나 컴포지트 치트 시트 컨텐츠 파일의 상대 URL입니다. ID와 경로를 둘 다 지정한 경우 경로가 컨텐츠 파일을 찾는 데 사용되고 ID 매개변수는 무시됩니다.
showIntro 기본값으로 ture로 설정된 부울 매개변수. "false"인 경우 치트 시트가 시작될 때 소개 대신 첫 번째 단계가 처음에 표시됩니다.

컴포지트 치트 시트 예제

아래의 파일은 기존 치트 시트에서 컴포지트 치트 시트를 작성하는 방법에 대한 예제입니다. 타스크 그룹을 작성하고 타스크를 건너뛸 수 있게 하는 방법을 보여줍니다.

<?xml version="1.0" encoding="UTF-8" ?>
<compositeCheatsheet name="Composite cheat sheet example">
    <taskGroup name= "Composite cheat sheet example">
         <intro> This is an example of a <b>composite cheat sheet</b> built from existing cheat sheets.
                 <br/><br/>You can select a task to work on either by following the hyperlinks or by
                 selecting a task in the tree. 
  </intro>
         <onCompletion>Congratulations you have completed all the tasks.</onCompletion>             
         <task kind="cheatsheet" name= "Branching and merging using CVS" skip="true">
              <param name = "id" value = "org.eclipse.platform.cvs_1" />
              <intro>This cheat sheet is intended for CVS users. If you are not using CVS or do
              not intend to branch and merge you may skip this task.
  </intro>
               <onCompletion>Congratulations you now know how to branch and merge.</onCompletion>                  
             </task>
         <taskGroup name= "Create Java Projects" kind = "sequence">
             <intro> First you will learn how to create a simple java project, then you will create 
             an java project which uses SWT. 
             <br/><br/>This task group is a sequence which means that
             if you click on the subtask "Standalone SWT Application" it will not let that task be started 
             until "Create a java project" has been completed.
  </intro>
              <onCompletion>Congratulations you have built both Java applications.</onCompletion>
         <task kind="cheatsheet" name= "Create a java project" id = "createJavaProject">
             <param name="id" value = "org.eclipse.jdt.helloworld"/>
                 <param name="showIntro" value = "false"/>
                 <intro>This cheat sheet walks through the process of creating a simple hello world application. 
                        The cheat sheet can launch wizards to create a new project and a new class. 
  </intro>
             <onCompletion>Congratulations you have succeeded in creating a hello world application</onCompletion>
             </task>
             <task kind="cheatsheet" name= "Standalone SWT Application">
                  <intro>Eclipse plugins which contribute to the user interface use The Standard Widget Toolkit (SWT). 
                        This task guide can be used to learn more about SWT.
  </intro>
                  <param name = "id" value = "org.eclipse.jdt.helloworld.swt" />
                  <onCompletion>Congratulations you have succeeded in creating an SWT application.</onCompletion>           
             </task>
    </taskGroup>
    </taskGroup>
</compositeCheatsheet>

컴포지트 치트 시트 확장성 - Eclipse 3.2에서 일시적

컴포지트 치트 시트는 확장 가능하지만 Eclipse 3.2에서 이 확장성은 일시적이며 API가 되기 전에 클래스가 변경될 수 있습니다. 컴포지트 치트 시트 지원은 타스크 편집기 및 타스크 탐색기를 제공할 수 있는 새로운 두 요소인 taskEditor와 taskExplorer가 있는 org.eclipse.ui.cheatsheets.cheatSheetContent 확장점을 사용하여 확장할 수 있습니다.

타스크 편집기를 제공하면 타스크 세부사항 섹션에 표시되는 새로운 종류의 타스크가 정의됩니다. 타스크 편집기를 제공하려면 TaskEditor의 구체적 서브클래스를 구현한 다음 taskEditor 요소를 plugin.xml에 추가하십시오.

확장점을 사용하여 타스크 탐색기의 표시도 구성할 수 있습니다. 트리 탐색기는 Eclipse 플랫폼에 포함되어 있습니다. 기본적으로 첫 번째로 열린 항목이 <compositeCheatSheet> 요소의 속성인 트리인 경우 컴포지트 치트 시트 탐색기에서는 해당 기본값을 대체할 수 있습니다. 둘 이상의 탐색기가 등록된 경우 보기 메뉴에는 탐색기 간에 전환할 수 있는 메뉴 항목이 포함됩니다. 타스크 탐색기를 제공하려면 먼저 TaskExplorer의 구체적 서브클래스를 구현한 다음 taskExplorer 요소를 plugin.xml에 추가하십시오.

관련 링크

치트 시트에 대한 작업
컴포지트 치트 시트에 대한 작업
치트 시트 작성
작성 가이드라인
컴포지트 치트 시트 컨텐츠 파일 스펙
org.eclipse.ui.cheatsheets.cheatSheetContent 확장점