Unterschiede

Hier werden die Unterschiede zwischen der gewählten und der aktuellen Version gezeigt.

en:eclipse-rcp:menues 2013/02/20 14:21 en:eclipse-rcp:menues 2020/01/22 21:00 aktuell
Zeile 25: Zeile 25:
\\ \\
===== with one handler per menu item ===== ===== with one handler per menu item =====
-In the example, a font with the menu item Tahoma 10 shall be created above a menu:+In the example, a script with the menu item Tahoma 10 shall be created above a menu:
  - open fragment.xml or plugin.xml and choose Register Extensions.   - open fragment.xml or plugin.xml and choose Register Extensions.
Zeile 35: Zeile 35:
  - now, click on the new menu on the left with the right mouse button and choose **New/command**.   - now, click on the new menu on the left with the right mouse button and choose **New/command**.
  - on the right, fill in the commandId (e.g. //com.sowas.demo.tahoma10//) and the label (//Tahoma 10//).   - on the right, fill in the commandId (e.g. //com.sowas.demo.tahoma10//) and the label (//Tahoma 10//).
-  - Falls noch nicht vorhanden den Extension-Point **org.eclipse.ui.commands** mit <**Add**> hinzufügen+  - if not available yet, add the extension-point **org.eclipse.ui.commands** with <**Add**>. 
-  - Mit der rechten Maustaste auf den Extension-Point klicken und **New/command** wählen+  - with the right mouse button click on the extension-point and choose **New/command**. 
-  - Rechts im Feld commandId die bereits unter Punkt 8 verwendete commandId (//com.sowas.demo.tahoma10//) eingeben+  - on the right in the array commandId enter the already under point 8 used commandId (//com.sowas.demo.tahoma10//). 
-  - Als name den Menüpunktnamen eingeben. +  - enter menu item name for name 
-  - Nun auf **Defaulthandler** klicken und einen neuen Handler erstellen. Der Handler ist die Methode, welche aufgerufen wird, wenn der Benutzer den Menüpunkt anklickt. Die Methode muss das Interface IHandler implementieren.+  - now, click on **Defaulthandler** and create a new handler. The handler is a method, which is called up when the user clicks on the menu item. The method has to implement the Interface IHandler.
Zeile 47: Zeile 47:
-===== Mit einem Handler für mehrere Menüpunkte ===== +===== with one handler for several menu items ===== 
-Im Beispiel soll dem oben erstellten Menü Schrift das Untermenü Schriftart mit den Menüpunkten Tahoma und Verdana hinzugefügt werden:+In the example, to the created menu script at the top the submenu font with the menu items Tahoma and Verdana shall be added:
-  - Die Schritte 1 - 6 von oben durchführen+  - carry out the steps 1 - 6 from above
-  - Links das Menü Schrift mit der rechten Maustaste anklicken und New/menu wählen+  - click on the menu script on the left with the right mouse button and choose New/menu. 
-  - Rechts im Feld label die Bezeichnung des Untermenüs (hier: Schriftart) eingeben+  - on the right in the array label, enter the term of the submenu (here: font). 
-  - Nun links das neue Untermenü mit der rechten Maustaste anklicken und New/command wählen+  - now, click on the new submenu on the left with the right mouse button and choose New/command. 
-  - Rechts eine CommandId (z.B.: com.sowas.demo.changefont) eingeben+  - enter a CommandId on the right (e.g.: com.sowas.demo.changefont). 
-  - Rechts als Label den Menüpunkt (Tahoma) eingeben+  - enter on the right as label the menu item (Tahoma). 
-  - Nun nochmals links das neue Untermenü mit der rechten Maustaste anklicken und New/command wählen+  - now, click on the new submenu on the left with the right mouse button again and choose New/command. 
-  - Rechts wieder die CommandId (com.sowas.demo.changefont) eingeben+  - enter the CommandId on the right again (e.g.: com.sowas.demo.changefont). 
-  - Und rechts ebenfals als Label den Menüpunkt (Verdana) eingeben+  - and also enter on the right as label the menu item (Verdana). 
-  - Nun links die Extension org.eclipse.ui.commands mit der rechten Maustaste anklicken+  - now, click on the extension org.eclipse.ui.commands on the left with the right mouse button
-  - Rechts die commandId (com.sowas.demo.changefont) und name (ChangeFont) ausfüllen+  - fill in the commandId (com.sowas.demo.changefont) and name (ChangeFont) on the right
-  - Nun auf Defaulthandler klicken und einen Handler (z.B.: com.sowas.demo.ChangeFontHandler) erstellen. Der Handler ist die Methode, welche aufgerufen wird, wenn der Benutzer den Menüpunkt anklickt. Die Methode muss das Interface IHandler implementieren+  - now, click on defaulthandler and create a handler (e.g.: com.sowas.demo.ChangeFontHandler). The handler is the method which is called up when the user clicks on the menu item. The method must implement the Interface IHandler. 
-  - Links mit der rechten Maustaste auf ChangeFont klicken und New/commandParameter klicken +  - on the left, click on ChangeFont with the right mouse button and choose New/commandParameter 
-  - Rechts als id com.sowas.demo.schriftart eingeben+  - enter com.sowas.demo.schriftart as id on the right
-  - Als name Schriftart eingeben+  - enter font as name. 
-  - Im Falle mehrerer Parameter optional auf true setzen.+  - in case of several parameters set optional on true.
-===== Allgemeiner Hinweis ===== +===== general advice ===== 
-Wird ein Menüpunkt nicht angezeigt, so ist in der Regel die Ursache, dass der Handler nicht gefunden wird.+Is a menu item not displayed, the reason is as a general rule, that the handler isn't found.

Eigene Werkzeuge
Werkzeuge

gratis Counter by GOWEB
seit 9.10.2007