지난일들/이클립스 플러그인개발

이클립스에 메뉴 추가

바위맨 2013. 12. 19. 17:07
반응형

이클립스 플러그인을 개발하는 과정에서 메뉴를 추가하는 방식으로 기능을 추가해야 한다. 

그런데 문제는 한개의 드롭다운 메뉴만 추가하는것은 sample을 사용해서 간단하게 진행할 수 있지만 이후에 같은 드롭다운 메뉴를 늘리는 과정에서는 간단하게 되지 못하는듯 하다. 

때문에, 기존의 sample드롭다운 메뉴의 구조를 분석하고 메뉴를 추가해 주도록 한다

기사 참고

http://eclipse.or.kr/wiki/%ED%8A%B9%EC%A7%91%EA%B8%B0%EC%82%AC:Eclipse_%EC%BB%A4%EB%A7%A8%EB%93%9C_%ED%8A%9C%ED%86%A0%EB%A6%AC%EC%96%BC

메뉴를 구성하는 Extentions의 구성

 org.eclipse.ui.commands

- command

  •  commands와 command categories를 선언
  • 각 기능에 대한 추상적인 선언
  • 실제적인 실행을 하지는 않는다.

 org.eclipse.ui.commands

- category

  •  다양한 element를 관리하는 과정에서 서로 다른 category라면 동일한 이름의 element가 존재할 수 있게 해준다.

 org.eclipse.ui.handlers

  • commands의 동작을 실행
  •  자바 클래스 호출 정의

 org.eclipse.ui.menu

  • commands가 사용자 인터페이스에 어느 위치에 어떤 식으로 표현되는지 정의 

 org.eclipse.ui.bindings

  •  키 바인딩은 command와 연결한다.
  • 키가 눌렸을 때, 커맨드가 핸드러를 가지고 있다면 핸들러가 커맨드 파라미트들이 ExecutionEvent로 부터 얻어내는 특정한 동작을 취하게 한다.

내부 구성

  • org.eclipse.ui.commands - command

 id

  The unique identifier of this command

 name

 The translatable name of this command for display in the UI. Commands are typically named in the form of an imperative verb.

 category 

 Please use categoryId instead.

 description 

  A translatable short description of this command for display in the UI.

 categoryId 

 The unique id of the category for this command. If this command does not specify a category it will be placed in an global "Uncategorized" category.

 defaultHandler 

 The default handler for this command (see the org.eclipse.ui.handlers extension point). If no other handler is active, this handler will be active. This handler will conflict with other handler definitions that specify no activeWhen conditions. If you are creating anIExecutableExtension, you can use the defaultHandler element instead

 returnTypeId 

 The id of a commandParameterType indicating the type of value returned by this command. Specifying a returnTypeId allows clients executing the command to associate the value returned with a Java type and to convert the value to a String form that may be stored and/or passed to another command that accepts parameters of the same type

 helpContextId 

 The identifier of the help context that relates to this command in general. Handlers can override this context identifier to provide help that is more specific to their particular behaviours

  • org.eclipse.ui.commands - category

 id

 The unique identifier for this parameter.

 name 

 The translatable name of this category for display in the UI

 description 

 A translatable short description of this category for display in the UI


반응형

'지난일들 > 이클립스 플러그인개발' 카테고리의 다른 글

java 에서 실행시킨 minicom에 명령 전달  (0) 2014.02.21
Java 공부  (0) 2013.11.05
이클립스 공부  (0) 2013.09.25