SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
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);

Weitere ähnliche Inhalte

Andere mochten auch

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
Prabhat Taneja
 
Binomial heap presentation
Binomial heap presentationBinomial heap presentation
Binomial heap presentation
Hafsa.Naseem
 

Andere mochten auch (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
 

Ähnlich wie 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
 

Mehr von SangHun Lee

Mehr von 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
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Kürzlich hochgeladen (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

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);