Java Code Examples for com.intellij.util.ui.UIUtil#TextPainter
The following examples show how to use
com.intellij.util.ui.UIUtil#TextPainter .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 5 votes |
public void paintEmptyText(@Nonnull final JComponent splitters, @Nonnull Graphics g) { UISettings.setupAntialiasing(g); g.setColor(new JBColor(Gray._80, Gray._160)); g.setFont(JBUI.Fonts.label(16f)); UIUtil.TextPainter painter = new UIUtil.TextPainter().withLineSpacing(1.8f); advertiseActions(splitters, painter); painter.draw(g, (width, height) -> { Dimension s = splitters.getSize(); int w = (s.width - width) / 2; int h = (int)(s.height * heightRatio()); return Couple.of(w, h); }); }
Example 2
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 5 votes |
protected void advertiseActions(@Nonnull JComponent splitters, @Nonnull UIUtil.TextPainter painter) { appendSearchEverywhere(painter); appendToolWindow(painter, "Project View", ToolWindowId.PROJECT_VIEW, splitters); appendAction(painter, "Go to File", getActionShortcutText("GotoFile")); appendAction(painter, "Recent Files", getActionShortcutText(IdeActions.ACTION_RECENT_FILES)); appendAction(painter, "Navigation Bar", getActionShortcutText("ShowNavBar")); appendDnd(painter); }
Example 3
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 4 votes |
protected void appendDnd(@Nonnull UIUtil.TextPainter painter) { appendLine(painter, "Drop files here to open"); }
Example 4
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 4 votes |
protected void appendSearchEverywhere(@Nonnull UIUtil.TextPainter painter) { Shortcut[] shortcuts = KeymapManager.getInstance().getActiveKeymap().getShortcuts(IdeActions.ACTION_SEARCH_EVERYWHERE); appendAction(painter, "Search Everywhere", shortcuts.length == 0 ? "Double " + (SystemInfo.isMac ? MacKeymapUtil.SHIFT : "Shift") : KeymapUtil.getShortcutsText(shortcuts)); }
Example 5
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 4 votes |
protected void appendToolWindow(@Nonnull UIUtil.TextPainter painter, @Nonnull String action, @Nonnull String toolWindowId, @Nonnull JComponent splitters) { if (!isToolwindowVisible(splitters, toolWindowId)) { String activateActionId = ActivateToolWindowAction.getActionIdForToolWindow(toolWindowId); appendAction(painter, action, getActionShortcutText(activateActionId)); } }
Example 6
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 4 votes |
protected void appendAction(@Nonnull UIUtil.TextPainter painter, @Nonnull String action, @Nullable String shortcut) { if (StringUtil.isEmpty(shortcut)) return; appendLine(painter, action + " " + "<shortcut>" + shortcut + "</shortcut>"); }
Example 7
Source File: EditorEmptyTextPainter.java From consulo with Apache License 2.0 | 4 votes |
protected void appendLine(@Nonnull UIUtil.TextPainter painter, String line) { painter.appendLine(line); }