mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
[code] action.actionPerformed rewritten
This commit is contained in:
parent
142cc00bc9
commit
747b2bfde6
@ -1,7 +1,10 @@
|
||||
package org.jetbrains.tutorials.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
|
||||
/**
|
||||
* @author Anna Bulenkova
|
||||
@ -9,7 +12,10 @@ import com.intellij.openapi.project.Project;
|
||||
public class SimpleAction extends AnAction {
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent anActionEvent) {
|
||||
|
||||
Object navigatable = anActionEvent.getData(CommonDataKeys.NAVIGATABLE);
|
||||
if (navigatable != null) {
|
||||
Messages.showDialog(navigatable.toString(), "Selected Element:", new String[]{"OK"}, -1, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user