本文整理汇总了Java中com.intellij.openapi.keymap.KeymapUtil.createTooltipText方法的典型用法代码示例。如果您正苦于以下问题:Java KeymapUtil.createTooltipText方法的具体用法?Java KeymapUtil.createTooltipText怎么用?Java KeymapUtil.createTooltipText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.keymap.KeymapUtil
的用法示例。
在下文中一共展示了KeymapUtil.createTooltipText方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: update
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
public boolean update() {
AnActionEvent event = createAnEvent(null, 0);
if (event == null) return false;
myAction.update(event);
Presentation p = event.getPresentation();
boolean changed = !areEqual(p, myPrevPresentation);
setIcons(p.getIcon(), p.getDisabledIcon(), p.getHoveredIcon());
if (changed) {
myButton.setIcons(this);
String tooltipText = KeymapUtil.createTooltipText(p.getText(), myAction);
myButton.setToolTipText(tooltipText.length() > 0 ? tooltipText : null);
myButton.setVisible(p.isEnabled() && p.isVisible());
}
myPrevPresentation = p;
return changed;
}
示例2: ActionButton
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
public ActionButton(AnAction action) {
myAction = action;
Presentation presentation = action.getTemplatePresentation();
InplaceButton button = new InplaceButton(KeymapUtil.createTooltipText(presentation.getText(), action), EmptyIcon.ICON_16, this) {
@Override
public boolean isActive() {
return LightToolWindow.this.isActive();
}
};
button.setHoveringEnabled(!SystemInfo.isMac);
setContent(button);
Icon icon = presentation.getIcon();
Icon hoveredIcon = presentation.getHoveredIcon();
button.setIcons(icon, icon, hoveredIcon == null ? icon : hoveredIcon);
}
示例3: ActionButton
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
ActionButton(@NotNull AnAction action) {
myAction = action;
Icon icon = action.getTemplatePresentation().getIcon();
Icon hoveredIcon = action.getTemplatePresentation().getHoveredIcon();
if (hoveredIcon == null) {
hoveredIcon = icon;
}
String toolTip = KeymapUtil.createTooltipText(action.getTemplatePresentation().getText(), action);
myButton = new InplaceButton(toolTip, icon, this);
myButton.setIcons(icon, icon, hoveredIcon);
myButton.setHoveringEnabled(!SystemInfo.isMac);
setContent(myButton);
setOpaque(false);
}
示例4: propertyChange
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (comboBoxButton == null) return;
String propertyName = evt.getPropertyName();
if ("text".equals(propertyName)) {
comboBoxButton.setText((String) evt.getNewValue());
} else if ("description".equals(propertyName)) {
String tooltip = KeymapUtil.createTooltipText(((String) evt.getNewValue()), this);
comboBoxButton.setToolTipText(!tooltip.isEmpty() ? tooltip : null);
} else if ("icon".equals(propertyName)) {
comboBoxButton.setIcon((Icon) evt.getNewValue());
} else if ("enabled".equals(propertyName)) {
comboBoxButton.setEnabled((Boolean) evt.getNewValue());
}
}
示例5: getToolTipTextByAction
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private static String getToolTipTextByAction(AnAction action) {
String text = KeymapUtil.createTooltipText(action.getTemplatePresentation().getText(), action);
if (action instanceof HideAction) {
text += String.format(" (Click with %s to Hide Side)", KeymapUtil.getShortcutText(KeyboardShortcut.fromString("pressed ALT")));
}
return text;
}
示例6: updateTooltipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateTooltipText(String description) {
String tooltip = KeymapUtil.createTooltipText(description, ComboBoxAction.this);
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
}
示例7: updateTooltipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateTooltipText(String description) {
String tooltip = KeymapUtil.createTooltipText(description, ComboBoxAction.this);
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
}
示例8: setToolTipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
public void setToolTipText(String s) {
String tooltipText = KeymapUtil.createTooltipText(s, myAction);
super.setToolTipText(tooltipText.length() > 0 ? tooltipText : null);
}
示例9: onSetActive
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
protected void onSetActive(final boolean active) {
final String tooltip = KeymapUtil
.createTooltipText(ActionsBundle.message("action.FileChooser.TogglePathShowing.text"),
ActionManager.getInstance().getAction("FileChooser.TogglePathShowing"));
setToolTipText(tooltip);
}
示例10: updateTooltipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateTooltipText(String description) {
String tooltip = KeymapUtil.createTooltipText(description, FlatComboAction.this);
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
}
示例11: updateTooltipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateTooltipText(String description) {
String tooltip = KeymapUtil.createTooltipText(description, FlatAction.this);
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
}
示例12: onSetActive
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
protected void onSetActive(final boolean active) {
final String tooltip = KeymapUtil.createTooltipText(ActionsBundle.message("action.FileChooser.TogglePathShowing.text"),
ActionManager.getInstance().getAction("FileChooser.TogglePathShowing"));
setToolTipText(tooltip);
}
示例13: updateTooltipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
private void updateTooltipText(String description) {
String tooltip = KeymapUtil.createTooltipText(description, myComboBoxAction);
setToolTipText(!tooltip.isEmpty() ? tooltip : null);
}
示例14: setToolTipText
import com.intellij.openapi.keymap.KeymapUtil; //导入方法依赖的package包/类
@Override
public void setToolTipText(String s) {
String tooltipText = KeymapUtil.createTooltipText(s, myAction);
super.setToolTipText(tooltipText.length() > 0 ? tooltipText : null);
}