Search in sources :

Example 6 with Wrapper

use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.

the class GraphTableController method showToolTip.

private void showToolTip(@NotNull String text, @NotNull MouseEvent e) {
    // standard tooltip does not allow to customize its location, and locating tooltip above can obscure some important info
    Point point = new Point(e.getX() + 5, e.getY());
    JEditorPane tipComponent = IdeTooltipManager.initPane(text, new HintHint(myTable, point).setAwtTooltip(true), null);
    IdeTooltip tooltip = new IdeTooltip(myTable, point, new Wrapper(tipComponent)).setPreferredPosition(Balloon.Position.atRight);
    IdeTooltipManager.getInstance().show(tooltip, false);
}
Also used : Wrapper(com.intellij.ui.components.panels.Wrapper) HintHint(com.intellij.ui.HintHint) IdeTooltip(com.intellij.ide.IdeTooltip)

Example 7 with Wrapper

use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.

the class MainFrame method createActionsToolbar.

private JComponent createActionsToolbar() {
    DefaultActionGroup toolbarGroup = new DefaultActionGroup();
    toolbarGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.TOOLBAR_ACTION_GROUP));
    DefaultActionGroup mainGroup = new DefaultActionGroup();
    mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_TEXT_FILTER_SETTINGS_ACTION));
    mainGroup.add(new Separator());
    mainGroup.add(myFilterUi.createActionGroup());
    mainGroup.addSeparator();
    if (BekUtil.isBekEnabled()) {
        if (BekUtil.isLinearBekEnabled()) {
            mainGroup.add(new IntelliSortChooserPopupAction());
        // can not register both of the actions in xml file, choosing to register an action for the "outer world"
        // I can of course if linear bek is enabled replace the action on start but why bother
        } else {
            mainGroup.add(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_INTELLI_SORT_ACTION));
        }
    }
    mainGroup.add(toolbarGroup);
    ActionToolbar toolbar = createActionsToolbar(mainGroup);
    Wrapper textFilter = new Wrapper(myTextFilter);
    textFilter.setVerticalSizeReferent(toolbar.getComponent());
    textFilter.setBorder(JBUI.Borders.emptyLeft(5));
    ActionToolbar settings = createActionsToolbar(new DefaultActionGroup(ActionManager.getInstance().getAction(VcsLogActionPlaces.VCS_LOG_QUICK_SETTINGS_ACTION)));
    settings.setReservePlaceAutoPopupIcon(false);
    settings.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    JPanel panel = new JPanel(new MigLayout("ins 0, fill", "[left]0[left, fill]push[right]", "center"));
    panel.add(textFilter);
    panel.add(toolbar.getComponent());
    panel.add(settings.getComponent());
    return panel;
}
Also used : Wrapper(com.intellij.ui.components.panels.Wrapper) MigLayout(net.miginfocom.swing.MigLayout) IntelliSortChooserPopupAction(com.intellij.vcs.log.ui.actions.IntelliSortChooserPopupAction)

Example 8 with Wrapper

use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.

the class ReferencesPanel method addWrapped.

private void addWrapped(@NotNull JBLabel label, @NotNull JBLabel referent) {
    Wrapper wrapper = new Wrapper(label);
    wrapper.setVerticalSizeReferent(referent);
    add(wrapper);
}
Also used : Wrapper(com.intellij.ui.components.panels.Wrapper)

Example 9 with Wrapper

use of com.intellij.ui.components.panels.Wrapper in project intellij-community by JetBrains.

the class IdeTooltipManager method queueShow.

private void queueShow(final JComponent c, final MouseEvent me, final boolean toCenter, int shift, int posChangeX, int posChangeY) {
    IdeTooltip tooltip = getCustomTooltip(c);
    if (tooltip == null) {
        String aText = String.valueOf(c.getToolTipText(me));
        tooltip = new IdeTooltip(c, me.getPoint(), null, /*new Object()*/
        c, aText) {

            @Override
            protected boolean beforeShow() {
                myCurrentEvent = me;
                if (!c.isShowing())
                    return false;
                String text = c.getToolTipText(myCurrentEvent);
                if (text == null || text.trim().isEmpty())
                    return false;
                JLayeredPane layeredPane = UIUtil.getParentOfType(JLayeredPane.class, c);
                final JEditorPane pane = initPane(text, new HintHint(me).setAwtTooltip(true), layeredPane);
                final Wrapper wrapper = new Wrapper(pane);
                setTipComponent(wrapper);
                return true;
            }
        }.setToCenter(toCenter).setCalloutShift(shift).setPositionChangeShift(posChangeX, posChangeY).setLayer(Balloon.Layer.top);
    }
    show(tooltip, false);
}
Also used : Wrapper(com.intellij.ui.components.panels.Wrapper)

Aggregations

Wrapper (com.intellij.ui.components.panels.Wrapper)9 IdeTooltip (com.intellij.ide.IdeTooltip)2 HintHint (com.intellij.ui.HintHint)1 TabbedPaneWrapper (com.intellij.ui.TabbedPaneWrapper)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 LinkLabel (com.intellij.ui.components.labels.LinkLabel)1 LinkListener (com.intellij.ui.components.labels.LinkListener)1 NonOpaquePanel (com.intellij.ui.components.panels.NonOpaquePanel)1 DockableContent (com.intellij.ui.docking.DockableContent)1 TabInfo (com.intellij.ui.tabs.TabInfo)1 IntelliSortChooserPopupAction (com.intellij.vcs.log.ui.actions.IntelliSortChooserPopupAction)1 MigLayout (net.miginfocom.swing.MigLayout)1 Nullable (org.jetbrains.annotations.Nullable)1