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);
}
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;
}
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);
}
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);
}
Aggregations