SlideShare une entreprise Scribd logo
1  sur  2
Télécharger pour lire hors ligne
activeWhen, enabledWhen
1. Workbench core expression
2. Expression Definitions
http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide
%2Fworkbench_cmd_expressions.html
3. Difference :
To show / hide commands from menus, play with the activeWhen clause
To grey / ungrey commands from menu, play with the enabledWhen clause
A command is enabled when at least 1 handler is active and enabled
4. Add extension : plugin.xml > Extensions
<extension point="org.eclipse.ui.handlers">
<handler class="filebrowser.AboutHandler"
commandId="FileBrowser.command.About">
<enabledWhen>
<with variable="activePart">
<instanceof value="filebrowser.BrowserView">
</instanceof>
</with>
</enabledWhen>
</handler>
</extension>
07.15 학습내용
Context Menu
1. Add extension : pluin.xml > Extensions
Org.eclipse.ui.menu : context 메뉴를 사용할 클래스의 ID를 LocationURL에 입력
Ex) popup:FileBrowser.browserView
해당 extentsion에 메뉴에 들어갈 command 추가
2. 해당 클래스에 menuManget와 menu생성
MenuManager menuManager = new MenuManager();
Menu menu = menuManager.createContextMenu(Control parent);
parent.setMenu(menu);
getSite().registerContextMenu(menuManager, ISelectionProvider);

Contenu connexe

En vedette

Microsoft Security Incident Report
Microsoft Security Incident ReportMicrosoft Security Incident Report
Microsoft Security Incident Reportukdpe
 
Binomial heap (a concept of Data Structure)
Binomial heap (a concept of Data Structure)Binomial heap (a concept of Data Structure)
Binomial heap (a concept of Data Structure)Saliha Bilal
 
Team learning in the upper secondary school - focus changes from teaching to ...
Team learning in the upper secondary school - focus changes from teaching to ...Team learning in the upper secondary school - focus changes from teaching to ...
Team learning in the upper secondary school - focus changes from teaching to ...Sanna Leinonen
 
Linear programming production strategy body plus 100, 200
Linear programming   production strategy body plus 100, 200Linear programming   production strategy body plus 100, 200
Linear programming production strategy body plus 100, 200Prabhat Taneja
 
Create Agile confidence for better application security
Create Agile confidence for better application securityCreate Agile confidence for better application security
Create Agile confidence for better application securityRogue Wave Software
 
Fibonacci Heaps
Fibonacci Heaps Fibonacci Heaps
Fibonacci Heaps Naseeba P P
 
Linear Programming Application
Linear Programming ApplicationLinear Programming Application
Linear Programming ApplicationKashif Latif
 
Navigating agile automotive software development
Navigating agile automotive software development Navigating agile automotive software development
Navigating agile automotive software development Rogue Wave Software
 
Agile Software Development - Learn It Yourself
Agile Software Development - Learn It YourselfAgile Software Development - Learn It Yourself
Agile Software Development - Learn It YourselfTathagat Varma
 
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)Mikhail Kurnosov
 
Binomial heap presentation
Binomial heap presentationBinomial heap presentation
Binomial heap presentationHafsa.Naseem
 
Binomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsBinomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsAmrinder Arora
 
The Art of Managing the Team Learning and Peter Senge's Fifth Discipline
The Art of Managing the Team Learning and Peter Senge's Fifth DisciplineThe Art of Managing the Team Learning and Peter Senge's Fifth Discipline
The Art of Managing the Team Learning and Peter Senge's Fifth DisciplineVijay Krishnan Anantharaman
 

En vedette (17)

Microsoft Security Incident Report
Microsoft Security Incident ReportMicrosoft Security Incident Report
Microsoft Security Incident Report
 
Borgman - Privacy, Policy and Data Governance in the University
Borgman - Privacy, Policy and Data Governance in the UniversityBorgman - Privacy, Policy and Data Governance in the University
Borgman - Privacy, Policy and Data Governance in the University
 
Binomial heap (a concept of Data Structure)
Binomial heap (a concept of Data Structure)Binomial heap (a concept of Data Structure)
Binomial heap (a concept of Data Structure)
 
ISTR XV
ISTR XVISTR XV
ISTR XV
 
android menus
android menusandroid menus
android menus
 
Team learning in the upper secondary school - focus changes from teaching to ...
Team learning in the upper secondary school - focus changes from teaching to ...Team learning in the upper secondary school - focus changes from teaching to ...
Team learning in the upper secondary school - focus changes from teaching to ...
 
Linear programming production strategy body plus 100, 200
Linear programming   production strategy body plus 100, 200Linear programming   production strategy body plus 100, 200
Linear programming production strategy body plus 100, 200
 
Create Agile confidence for better application security
Create Agile confidence for better application securityCreate Agile confidence for better application security
Create Agile confidence for better application security
 
Fibonacci Heaps
Fibonacci Heaps Fibonacci Heaps
Fibonacci Heaps
 
Linear Programming Application
Linear Programming ApplicationLinear Programming Application
Linear Programming Application
 
Navigating agile automotive software development
Navigating agile automotive software development Navigating agile automotive software development
Navigating agile automotive software development
 
Agile Software Development - Learn It Yourself
Agile Software Development - Learn It YourselfAgile Software Development - Learn It Yourself
Agile Software Development - Learn It Yourself
 
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)
Лекция 6. Фибоначчиевы кучи (Fibonacci heaps)
 
Binomial heap presentation
Binomial heap presentationBinomial heap presentation
Binomial heap presentation
 
Binomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci HeapsBinomial Heaps and Fibonacci Heaps
Binomial Heaps and Fibonacci Heaps
 
The Art of Managing the Team Learning and Peter Senge's Fifth Discipline
The Art of Managing the Team Learning and Peter Senge's Fifth DisciplineThe Art of Managing the Team Learning and Peter Senge's Fifth Discipline
The Art of Managing the Team Learning and Peter Senge's Fifth Discipline
 
Fibonacci Heap
Fibonacci HeapFibonacci Heap
Fibonacci Heap
 

Similaire à Eclipse rcp 정리(enabled when, contextmenu)

Similaire à Eclipse rcp 정리(enabled when, contextmenu) (13)

L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
 
Drupal Menu System
Drupal Menu SystemDrupal Menu System
Drupal Menu System
 
DRUPAL Menu System
DRUPAL Menu SystemDRUPAL Menu System
DRUPAL Menu System
 
Rupicon 2014 Action pack
Rupicon 2014 Action packRupicon 2014 Action pack
Rupicon 2014 Action pack
 
Android session 3
Android session 3Android session 3
Android session 3
 
Les14
Les14Les14
Les14
 
Oracle 10g Forms Lesson 15
Oracle 10g Forms Lesson  15Oracle 10g Forms Lesson  15
Oracle 10g Forms Lesson 15
 
Menu bars and menus
Menu bars and menusMenu bars and menus
Menu bars and menus
 
Writing first-hudson-plugin
Writing first-hudson-pluginWriting first-hudson-plugin
Writing first-hudson-plugin
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorial
 
Plug in development
Plug in developmentPlug in development
Plug in development
 
Lab3-Android
Lab3-AndroidLab3-Android
Lab3-Android
 
Write your first WordPress plugin
Write your first WordPress pluginWrite your first WordPress plugin
Write your first WordPress plugin
 

Plus de SangHun Lee

PWA 파헤치기
PWA 파헤치기PWA 파헤치기
PWA 파헤치기SangHun Lee
 
Angular CodeLab 두번째
Angular CodeLab 두번째Angular CodeLab 두번째
Angular CodeLab 두번째SangHun Lee
 
Angular CodeLab 첫번째
Angular CodeLab 첫번째Angular CodeLab 첫번째
Angular CodeLab 첫번째SangHun Lee
 
Angular Popular Tools
Angular Popular ToolsAngular Popular Tools
Angular Popular ToolsSangHun Lee
 
Chrome 69 updates
Chrome 69 updatesChrome 69 updates
Chrome 69 updatesSangHun Lee
 
Angular Component Interaction
Angular Component InteractionAngular Component Interaction
Angular Component InteractionSangHun Lee
 
Chrome 68 updates
Chrome 68 updatesChrome 68 updates
Chrome 68 updatesSangHun Lee
 
Reactive Programming with Rxjs
Reactive Programming with RxjsReactive Programming with Rxjs
Reactive Programming with RxjsSangHun Lee
 
Angular Features and New Things
Angular Features and New ThingsAngular Features and New Things
Angular Features and New ThingsSangHun Lee
 
SSG광고의 오마주_에드워드 호퍼
SSG광고의 오마주_에드워드 호퍼SSG광고의 오마주_에드워드 호퍼
SSG광고의 오마주_에드워드 호퍼SangHun Lee
 
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기SangHun Lee
 
Ror 4주차(루비맛보기, form 태그)
Ror 4주차(루비맛보기, form 태그)Ror 4주차(루비맛보기, form 태그)
Ror 4주차(루비맛보기, form 태그)SangHun Lee
 
Ror 2주차(컨트롤러 생성)
Ror 2주차(컨트롤러 생성)Ror 2주차(컨트롤러 생성)
Ror 2주차(컨트롤러 생성)SangHun Lee
 
루비온레일즈_01_간단한 정적인 홈페이지 제작
루비온레일즈_01_간단한 정적인 홈페이지 제작루비온레일즈_01_간단한 정적인 홈페이지 제작
루비온레일즈_01_간단한 정적인 홈페이지 제작SangHun Lee
 
Basic of web ref.웹을지탱하는기술_02
Basic of web ref.웹을지탱하는기술_02Basic of web ref.웹을지탱하는기술_02
Basic of web ref.웹을지탱하는기술_02SangHun Lee
 
Basic of web ref.웹을지탱하는기술_01
Basic of web ref.웹을지탱하는기술_01Basic of web ref.웹을지탱하는기술_01
Basic of web ref.웹을지탱하는기술_01SangHun Lee
 

Plus de SangHun Lee (20)

PWA 파헤치기
PWA 파헤치기PWA 파헤치기
PWA 파헤치기
 
Angular Library
Angular LibraryAngular Library
Angular Library
 
Angular CodeLab 두번째
Angular CodeLab 두번째Angular CodeLab 두번째
Angular CodeLab 두번째
 
Angular CodeLab 첫번째
Angular CodeLab 첫번째Angular CodeLab 첫번째
Angular CodeLab 첫번째
 
Angular Popular Tools
Angular Popular ToolsAngular Popular Tools
Angular Popular Tools
 
Chrome 69 updates
Chrome 69 updatesChrome 69 updates
Chrome 69 updates
 
Angular Component Interaction
Angular Component InteractionAngular Component Interaction
Angular Component Interaction
 
Chrome 68 updates
Chrome 68 updatesChrome 68 updates
Chrome 68 updates
 
Reactive Programming with Rxjs
Reactive Programming with RxjsReactive Programming with Rxjs
Reactive Programming with Rxjs
 
Angular Features and New Things
Angular Features and New ThingsAngular Features and New Things
Angular Features and New Things
 
SSG광고의 오마주_에드워드 호퍼
SSG광고의 오마주_에드워드 호퍼SSG광고의 오마주_에드워드 호퍼
SSG광고의 오마주_에드워드 호퍼
 
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
[IOS말고 Android] Inflation을 이용하여 부분 Activity 띄우기
 
Ror 4주차(루비맛보기, form 태그)
Ror 4주차(루비맛보기, form 태그)Ror 4주차(루비맛보기, form 태그)
Ror 4주차(루비맛보기, form 태그)
 
Ror 2주차(컨트롤러 생성)
Ror 2주차(컨트롤러 생성)Ror 2주차(컨트롤러 생성)
Ror 2주차(컨트롤러 생성)
 
루비온레일즈_01_간단한 정적인 홈페이지 제작
루비온레일즈_01_간단한 정적인 홈페이지 제작루비온레일즈_01_간단한 정적인 홈페이지 제작
루비온레일즈_01_간단한 정적인 홈페이지 제작
 
Basic of web ref.웹을지탱하는기술_02
Basic of web ref.웹을지탱하는기술_02Basic of web ref.웹을지탱하는기술_02
Basic of web ref.웹을지탱하는기술_02
 
Eclipse gef
Eclipse gefEclipse gef
Eclipse gef
 
Gef 정리
Gef 정리Gef 정리
Gef 정리
 
2015.07.01
2015.07.012015.07.01
2015.07.01
 
Basic of web ref.웹을지탱하는기술_01
Basic of web ref.웹을지탱하는기술_01Basic of web ref.웹을지탱하는기술_01
Basic of web ref.웹을지탱하는기술_01
 

Dernier

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 

Dernier (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 

Eclipse rcp 정리(enabled when, contextmenu)

  • 1. activeWhen, enabledWhen 1. Workbench core expression 2. Expression Definitions http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide %2Fworkbench_cmd_expressions.html 3. Difference : To show / hide commands from menus, play with the activeWhen clause To grey / ungrey commands from menu, play with the enabledWhen clause A command is enabled when at least 1 handler is active and enabled 4. Add extension : plugin.xml > Extensions <extension point="org.eclipse.ui.handlers"> <handler class="filebrowser.AboutHandler" commandId="FileBrowser.command.About"> <enabledWhen> <with variable="activePart"> <instanceof value="filebrowser.BrowserView"> </instanceof> </with> </enabledWhen> </handler> </extension> 07.15 학습내용
  • 2. Context Menu 1. Add extension : pluin.xml > Extensions Org.eclipse.ui.menu : context 메뉴를 사용할 클래스의 ID를 LocationURL에 입력 Ex) popup:FileBrowser.browserView 해당 extentsion에 메뉴에 들어갈 command 추가 2. 해당 클래스에 menuManget와 menu생성 MenuManager menuManager = new MenuManager(); Menu menu = menuManager.createContextMenu(Control parent); parent.setMenu(menu); getSite().registerContextMenu(menuManager, ISelectionProvider);