本文整理匯總了Java中com.intellij.openapi.actionSystem.AnActionEvent.getPlace方法的典型用法代碼示例。如果您正苦於以下問題:Java AnActionEvent.getPlace方法的具體用法?Java AnActionEvent.getPlace怎麽用?Java AnActionEvent.getPlace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.actionSystem.AnActionEvent
的用法示例。
在下文中一共展示了AnActionEvent.getPlace方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: beforeActionPerformed
import com.intellij.openapi.actionSystem.AnActionEvent; //導入方法依賴的package包/類
@Override
public void beforeActionPerformed(AnAction action, DataContext dataContext, AnActionEvent event) {
final InputEvent input = event.getInputEvent();
if (input instanceof MouseEvent && wasMouseClick) {
final String place = event.getPlace();
KeyPromoterAction kpAction;
if ("MainMenu".equals(place)) {
if (keyPromoterSettings.isMenusEnabled()) {
kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.MENU_ENTRY);
showTip(kpAction);
}
} else if ("MainToolbar".equals(place)) {
if (keyPromoterSettings.isToolbarButtonsEnabled()) {
kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.MAIN_TOOLBAR);
showTip(kpAction);
}
} else if (place.matches(".*Popup")) {
if (keyPromoterSettings.isEditorPopupEnabled()) {
kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.POPUP);
showTip(kpAction);
}
} else if (keyPromoterSettings.isAllButtonsEnabled()) {
kpAction = new KeyPromoterAction(action, event, KeyPromoterAction.ActionSource.OTHER);
showTip(kpAction);
}
}
wasMouseClick = false;
}