Eclipse Keybinding Context

Status
Nicht offen für weitere Antworten.

nilspils

Mitglied
Hi Java und Eclipse Freunde,

ich bin neu hier. Weil ich echt nicht weiter weiss, wende ich mich hoffnungsvoll an Euch.
Für meine Plattform möchte ich Tastaturkürzel an diverse Actions binden. Das ist soweit auch alles recht easy. Nur mit den Context (also org.eclipse.ui.context) klappts irgendwie nicht so wie es soll.

Ich habe ein paar Eclipse UI basierte Commands, die ich an, die von mir gewünschten Keys binde. Als Context habe ich org.eclipse.ui.contexts.window gewählt. Das funktioniert so weit auch prima. Auch wenn keine Perspektiven geöffnet sind. Denn da liegt mein Problem:
Für meine eigene Actions, die mittels org.eclipse.ui.commands an ein org.eclipse.ui.binding Key binden kann (als contextId auch org.eclipse.ui.contexts.window gewählt) funktioniert die Tastaturkürzel nur wenn ich eine Perspektive geöffnet habe. Ich will aber, dass die Aktion mir ohne geöffnete Perspektive zur Verfügung steht!!!

Kennt sich da jemand mit aus, und kann mir "glücklicherweise" weiterhelfen?

Hier noch ein wenig Code wie das in meiner plugin.xml aussieht (soweit alles richtig meines Erachtens):
Java:
<plugin>
    <extension
         point="org.eclipse.ui.commands">
      	<!-- Hier org.eclipse.ui commands -->
      <category
            description="%category.tabs.description"
            id="com.abc.bindings.category.tabs"
            name="%category.tabs.name">
      </category>
      <command
            categoryId="com.abc.bindings.category.tabs"
            id="org.eclipse.ui.window.nextPerspective"
            name="%command.nextTab.name">
      </command>
      <command
            categoryId="com.abc.bindings.category.tabs"
            id="org.eclipse.ui.window.previousPerspective"
            name="%command.previousTab.name">
      </command>
      	<!-- Hier meine eigene commands -->
      <command
            categoryId="com.abc.bindings.category.tabs"
            id="com.abc.bindings.test"
            name="MEIN EIGENER KEY">
      </command>
   </extension>
   <extension
         point="org.eclipse.ui.bindings">
	<!-- Hier meine Scheme -->
      <scheme
            description="%keyConfiguration.abc.description"
            id="com.abc.bindings.scheme"
            name="%keyConfiguration.abc.name"
            parentId="org.eclipse.ui.defaultAcceleratorConfiguration">
      </scheme>
	<!-- Hier meine Key Bindings -->
      <key
            commandId="org.eclipse.ui.window.nextPerspective"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="com.abc.bindings.scheme"
            sequence="M1+TAB">
      </key>
      <key
            commandId="org.eclipse.ui.window.previousPerspective"
            contextId="org.eclipse.ui.contexts.window"
            schemeId="com.abc.bindings.scheme"
            sequence="M1+M2+TAB">
      </key>
      <key
            commandId="com.abc.bindings.test"
            contextId="org.eclipse.ui.contexts.dialogAndWindow"
            schemeId="com.abc.bindings.scheme"
            sequence="M1+Ä">
      </key>
   </extension>
   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            id="com.abc.bindings.actionSet1"
            label="Meine Test Actions">
         <action
               class="com.abc.bindings.TestAction"
               definitionId="com.abc.bindings.test"
               id="com.abc.bindings.action1"
               label="TestAction">
         </action>
      </actionSet>
   </extension>
</plugin>
 

Wildcard

Top Contributor
Ich verstehe die Frage insofern nicht, das es den Zustand 'keine Perspektive offen' doch gar nicht gibt. Es ist immer eine Perspektive aktiv.
 

nilspils

Mitglied
Hmmm... da hast Du natürlich Recht. Trotzdem funktioniert mein eigener KeyBinding nicht direkt nach den Eclipse-Anwendungsstart, sondern erst, wenn ich eine meiner Perspectiven (mit einer View) geöffnet habe. Ich weiss nicht wo da der Hund begraben ist? Liegts daran, dass eine View geöffnet sein muss?

Vielleicht nochmal die Definition abklappern, was man unter org.eclipse.ui.contexts.window versteht: Ist damit das Eclipse-Window gemeint? Eigentlich sollte mir der Key doch dann immer zur Verfügung stehen, oder?
 
G

Gonzo17

Gast
Wie ist es denn, wenn du danach alle deine Views wieder schliesst und Eclipse verwendest, wie du es sonst auch tust? Ist es dann verfügbar oder nicht?
 

nilspils

Mitglied
Nein, wenn ich alle meine Views schliesse, geht die Key-Kombi nicht mehr. Allerdings ist das nur so bei Commands, die auf selbst geschriebene Actions verweisen (siehe com.abc.bindings.test).
Eclipse Commands (wie z.B. org.eclipse.ui.window.nextPerspective) gehen mit meiner key-Kombi immer, selbst wenn alle Views geschlossen sind.

Schon komisch oder?
 
Status
Nicht offen für weitere Antworten.
Ähnliche Java Themen
  Titel Forum Antworten Datum
M Keybinding in Eclipse Plugin Plattformprogrammierung 3
E OSGi Eclipse Plug-in programmierung: java.lang.NullPointerException: Cannot enter synchronized block because "profile" is null Plattformprogrammierung 4
R Eclipse Bundles Plattformprogrammierung 2
Robertop RCP Command in bereits bestehendes Eclipse-Menü einbauen Plattformprogrammierung 4
T Java Projekt läuft nur in Eclipse Plattformprogrammierung 6
M Eclipse Plugin PreferencePage BooleanFieldEditor Plattformprogrammierung 1
F OSGi Plugin unter Eclipse arbeitet anders als wenn veröffentlicht Plattformprogrammierung 2
D RCP P2-Repository für Eclipse-Plugins Plattformprogrammierung 0
M Debuging in Eclipse Annotations Processor Plattformprogrammierung 0
D Nach Sprachpaket Installation kann eclipse nicht mehr gestartet werden Plattformprogrammierung 4
L0MiN Wie kann ich ein Klassendiagramm aus Eclipse heraus erstellen? Plattformprogrammierung 5
M Eclipse Probleme beim Ausführen eines Programms Plattformprogrammierung 3
feinperligekohlensaeure Eclipse Workspace gemeinsam Nutzen -> keine .project Datei Plattformprogrammierung 1
F Eclipse Build Path auf benötigte Projekte Plattformprogrammierung 4
B Daten von Eclipse extern sichern Plattformprogrammierung 2
B Eclipse zeigt Fehler nach Java-Update auf 1.8.0_40 Plattformprogrammierung 3
VfL_Freak [Eclipse] Fehleranzeige im Reiter "Problems" Plattformprogrammierung 1
S Errors in workspace bei eclipse Plattformprogrammierung 3
T eclipse bietet keine META-INF an Plattformprogrammierung 1
N Eclipse wo starten Plattformprogrammierung 6
A Eclipse schließt einfach ohne Fehlermeldung Plattformprogrammierung 4
W Eclipse vergißt beim Exportieren Resources-Ordner Plattformprogrammierung 11
A RCP Eclipse e4 und Injection-Contexts Plattformprogrammierung 0
K Eclipse fährt nicht mehr hoch. Metadatendatei schuld? Plattformprogrammierung 7
C [Eclipse RCP E4]InjectionException: no actual value was found for the argument "MDirtyable" Plattformprogrammierung 8
T Eclipse Eigenschaften hinzufügen Plattformprogrammierung 2
M RCP [Eclipse RCP 3.4] ViewTab Kontextmenu "Alle schließen" Plattformprogrammierung 0
D Problem mit eclipse Plattformprogrammierung 2
S Verschieben des Verzeichnis .eclipse aus Userprofile Plattformprogrammierung 3
A RCP Kann kein Eclipse 4 Projekt anlegen Plattformprogrammierung 0
S RCP Exportiertes RCP Produkt lädt Datei nicht, bei Start aus Eclipse wird Datei jedoch gefunden Plattformprogrammierung 6
G Eine Library in Eclipse zur Verfügung stellen Plattformprogrammierung 14
Gregorrr Eclipse RCP Product Build-Nummer + Jenkins Plattformprogrammierung 6
R Einfaches Eclipse-Plugin-Beispiel funktioniert nicht Plattformprogrammierung 5
H OSGi OSGi + Logback + slf4j - Eclipse Run Configuration Plattformprogrammierung 7
C plugin development environment eclipse Plattformprogrammierung 4
R RCP Commands nutzen / org.eclipse.ui.file.save Plattformprogrammierung 7
O Installiere externe Methode "containsNone" in Eclipse Plattformprogrammierung 2
TheWhiteShadow RCP Konstrukt für Editor in Eclipse gesucht. Plattformprogrammierung 3
B Eclipse Probleme mit build Plattformprogrammierung 8
H Keine Hilfe/API mehr in Eclipse Juno? Plattformprogrammierung 4
B Neue SuppressWarning in Eclipse Juno Plattformprogrammierung 6
B Eclipse Property Page Plattformprogrammierung 6
B Eclipse PreferencePage Plattformprogrammierung 3
B Eclipse Plugin Einstellungsleiste Plattformprogrammierung 2
B Birt-Previewer über Eclipse Plattformprogrammierung 14
J Eclipse Plug-In für UML-Diagramme Problem Plattformprogrammierung 4
O Eclipse Plugin - Einfachstes Problem, das es gibt. Plattformprogrammierung 2
R Eclipse RCP Tabellen-View (Anfängerfrage) Plattformprogrammierung 3
C Eclipse: Notification beim umbennen von Methoden? Plattformprogrammierung 4
schalentier Eclipse Sourcecode Plattformprogrammierung 4
A Eclipse undo/redo button reagiert nicht auf Änderungen in der OperationHistory Plattformprogrammierung 5
P Eclipse M2_REPO (NON MODIFIABLE) Plattformprogrammierung 8
B Eclipse: Contextmenu id erhalten? Plattformprogrammierung 9
H Datei in eclipse wird nicht erkannt Plattformprogrammierung 3
O Neues Tastenkürzel für Eclipse Editorfenster registrieren Plattformprogrammierung 2
3 Eclipse Editor Plugin selektiert Projekt nicht Plattformprogrammierung 10
Madlip RCP eclipse.ui.bindings (Key-Problematik) Plattformprogrammierung 2
S Eclipse vs. JavaMail vs. Ubuntu vs. Windows Plattformprogrammierung 3
M eclipse führt applikationen nicht mehr aus Plattformprogrammierung 6
S Eclipse: Auf CTRL-C/CTRL-V im Package Explorer? Plattformprogrammierung 4
M Eclipse und Hilfen Plattformprogrammierung 5
G Eclipse buggt rum!!! Plattformprogrammierung 4
B Eclipse RCP und Java 7 Plattformprogrammierung 7
G RCP Eclipse Editor + Guice Plattformprogrammierung 8
T RCP Eclipse RCP: Wo/wann im Plugin ist workbench initialisiert? Plattformprogrammierung 14
G Eclipse Plug-in: wie refreshe ich eine combobox? Plattformprogrammierung 4
M Eclipse Plug-in: Wie eine Grafik einfügen? Plattformprogrammierung 20
M RCP [Eclipse RCP] Feature Export und "Fehler"... Plattformprogrammierung 3
P Eclipse speichert keine Änderungen Plattformprogrammierung 5
M Eclipse - Dokumentation nicht über das Internet benutzen Plattformprogrammierung 3
C Eclipse Plugin NoClassDefFoundError Plattformprogrammierung 4
E org.eclipse.ui.dialogs.ListSelectionDialog erzeugt ClassNotFoundException zur Laufzeit Plattformprogrammierung 4
M Eclipse Plugin Entwicklung - NoClassDefFoundError Plattformprogrammierung 10
C RCP Verständnisfrage Eclipse/Equinox Plattformprogrammierung 4
D eclipse-RCP von der Konsole baut nicht Plattformprogrammierung 3
L RCP Eclipse Popupmenu im PackageExplorer erweitern? Plattformprogrammierung 7
C Eclipse Plugin Entwicklung: Editor für Flussdiagramme Plattformprogrammierung 6
S (OSGI - EQUINOX) Welche Eclipse IDE? Plattformprogrammierung 3
C Pdf in jar datei einbinden mit eclipse Plattformprogrammierung 23
G neuer branch in SVN mit Eclipse Plattformprogrammierung 6
F RCP eclipse rcp ohne eclipse? Plattformprogrammierung 15
dzim RCP Eclipse Provisioning Plattformprogrammierung 3
G RCP Abhängigkeiten von Eclipse Plugins Plattformprogrammierung 9
K Eclipse RCP, EMF, Hibernate Problem Plattformprogrammierung 7
B RCP eigenes Eclipse Plugin wird nicht aufgelöst Plattformprogrammierung 7
T Eclipse Helios XMLUnit importieren Plattformprogrammierung 6
R Verwendung pdfbox in Maven-Projekt in Eclipse Plattformprogrammierung 3
lumo RCP wechseln der Font von Eclipse per code Plattformprogrammierung 10
lumo RCP Eclipse internationalisierung Plattformprogrammierung 5
jemandzehage Kurze Fehlernachricht beim starten in Eclipse Plattformprogrammierung 5
A RCP java.lang.ClassNotFoundException: org.eclipse.core.runtime.adaptor.EclipseStarter Plattformprogrammierung 7
P Wie bekomme ich ICompilationUnit aus dem event? bei Eclipse-Plugin Plattformprogrammierung 3
Rudolf External Libs dauerhaft in Eclipse einbinden Plattformprogrammierung 3
G RCP Eclipse UI Forms Plattformprogrammierung 10
musiKk RCP Eclipse: Speichern von Spaltenbreiten Plattformprogrammierung 9
X Datei in einem Eclipse Projekt über Plugin zugreifen Plattformprogrammierung 2
P Eclipse Help: Wie Links zu anderer Hilfeseite setzen ? Plattformprogrammierung 5
F Eclipse EMF Modelltransformation Plattformprogrammierung 3
tfa RCP Compilereinstellungen festlegen bei Eclipse-Batch-Build Plattformprogrammierung 9

Ähnliche Java Themen

Neue Themen


Oben