use of org.jetbrains.plugins.ipnb.editor.actions.IpnbSplitCellAction in project intellij-community by JetBrains.
the class IpnbEditablePanel method addRightClickMenu.
@Override
protected void addRightClickMenu() {
myViewPanel.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e) && e.getClickCount() == 1) {
final DefaultActionGroup group = new DefaultActionGroup(new IpnbMergeCellAboveAction(), new IpnbMergeCellBelowAction());
final ListPopup menu = createPopupMenu(group);
menu.show(RelativePoint.fromScreen(e.getLocationOnScreen()));
}
}
});
myEditableTextArea.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
if (SwingUtilities.isRightMouseButton(e) && e.getClickCount() == 1) {
final DefaultActionGroup group = new DefaultActionGroup(new IpnbSplitCellAction());
final ListPopup menu = createPopupMenu(group);
menu.show(RelativePoint.fromScreen(e.getLocationOnScreen()));
}
}
});
}
Aggregations