명령 이미지

org.eclipse.ui.commandImages

3.2

이미지 확장점은 여러 유형의 이미지 및 아이콘을 특정 명령에 링크시키는 방법을 제공합니다. 사용자 인터페이스에 명령이 표시될 때마다 이러한 이미지를 적절하게 사용할 수 있습니다. 일부 경계 케이스(예: 도구 모음 드롭 다운 항목)를 수용하려면 특정 명령의 이미지를 "스타일"로 그룹화할 수 있습니다. 그런 다음 명령을 표시할 때 이러한 스타일을 특별히 요청할 수 있습니다.

<!ELEMENT extension (image*)>

<!ATTLIST extension

point CDATA #REQUIRED

id    CDATA #IMPLIED

name  CDATA #IMPLIED>


<!ELEMENT image EMPTY>

<!ATTLIST image

commandId    CDATA #REQUIRED

icon         CDATA #REQUIRED

disabledIcon CDATA #IMPLIED

hoverIcon    CDATA #IMPLIED

style        CDATA #IMPLIED>

특정 명령과 연관시킬 이미지



<extension point=

"org.eclipse.ui.commandsImages"

>

<image commandId=

"ProfileLast"

hoverIcon=

"icons/full/etool16/profile.gif"

disabledIcon=

"icons/full/dtool16/profile.gif"

icon=

"icons/full/etool16/profile.gif"

/>

<image commandId=

"ProfileLast"

hoverIcon=

"icons/full/etool16/history.gif"

disabledIcon=

"icons/full/dtool16/history.gif"

icon=

"icons/full/etool16/history.gif"

imageStyle=

"toolbar"

/>

</extension>

Workbench 안에서 org.eclipse.ui.handlers.ICommandImageService 인터페이스를 사용하여 명령에 해당하는 이미지를 가져올 수 있습니다. 이 인터페이스는 IWorkbench 자체 같이 지원 Workbench 오브젝트로부터 검색할 수 있습니다. 서비스를 검색하려면 IWorkbench.getAdapter(ICommandImageService.class)와 같은 호출을 작성할 수 있습니다.