@Override public void update(final AnActionEvent e) { super.update(e); Presentation presentation = e.getPresentation(); boolean enabled = presentation.isEnabled(); boolean selected = false; if (enabled) { final EditorEx editor = (EditorEx) CommonDataKeys.EDITOR.getData(e.getDataContext()); if (editor != null) { LineSelectionManager manager = LineSelectionManager.getInstance(editor); RangeLimitedCaretSpawningHandler spawningHandler = manager.getCaretSpawningHandler(); if (spawningHandler != null && !spawningHandler.isBackwards()) { selected = true; } } } presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); e.getPresentation().setVisible(!ApplicationSettings.getInstance().isHideDisabledButtons() || e.getPresentation().isEnabled()); }
@Override public void update(final AnActionEvent e) { super.update(e); Presentation presentation = e.getPresentation(); boolean enabled = presentation.isEnabled(); boolean selected = false; if (enabled) { final EditorEx editor = (EditorEx) CommonDataKeys.EDITOR.getData(e.getDataContext()); if (editor != null) { LineSelectionManager manager = LineSelectionManager.getInstance(editor); RangeLimitedCaretSpawningHandler spawningHandler = manager.getCaretSpawningHandler(); if (spawningHandler != null && spawningHandler.isBackwards()) { selected = true; } } } presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); e.getPresentation().setVisible(!ApplicationSettings.getInstance().isHideDisabledButtons() || e.getPresentation().isEnabled()); }
@Nullable @Override public Rectangle onMouseMove(@NotNull MouseEvent event) { myEditButton.setVisible(myControl.getSelectedModelRows().size() <= 1); Rectangle bounds = getButtonScreenBounds(); if (!myBeingEdited && bounds != null) { boolean selected = bounds.contains(event.getLocationOnScreen()); boolean wasSelected = myEditButton.getPresentation().getClientProperty(Toggleable.SELECTED_PROPERTY) == Boolean.TRUE; myEditButton.getPresentation().putClientProperty(Toggleable.SELECTED_PROPERTY, selected); if (selected ^ wasSelected) { return myScreenBounds; } } return myDelegate.onMouseMove(event); }
@Nullable @Override public Rectangle onMouseMove(@Nonnull MouseEvent event) { myEditButton.setVisible(myControl.getSelectedModelRows().size() <= 1); Rectangle bounds = getButtonScreenBounds(); if (!myBeingEdited && bounds != null) { boolean selected = bounds.contains(event.getLocationOnScreen()); boolean wasSelected = myEditButton.getPresentation().getClientProperty(Toggleable.SELECTED_PROPERTY) == Boolean.TRUE; myEditButton.getPresentation().putClientProperty(Toggleable.SELECTED_PROPERTY, selected); if (selected ^ wasSelected) { return myScreenBounds; } } return myDelegate.onMouseMove(event); }
@Override public final void actionPerformed(AnActionEvent e) { final boolean state = !isSelected(e); setSelected(e, state); final Boolean selected = state; final Presentation presentation = e.getPresentation(); presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); }
public void setBeingEdited(boolean beingEdited) { if (myBeingEdited && !beingEdited) { myEditButton.getPresentation().putClientProperty(Toggleable.SELECTED_PROPERTY, false); } if (!beingEdited && !myUnderMouse) { myEditButton.setVisible(false); } if (beingEdited && !myBeingEdited) { myEditButton.setVisible(true); myEditButton.getPresentation().putClientProperty(Toggleable.SELECTED_PROPERTY, true); } myBeingEdited = beingEdited; }
@Override public final void actionPerformed(AnActionEvent e) { final boolean state = !isSelected(e); setSelected(e, state); final Boolean selected = state ? Boolean.TRUE : Boolean.FALSE; final Presentation presentation = e.getPresentation(); presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); }
@Override public final void updateButton(AnActionEvent e) { final Boolean selected = isSelected(e); final Presentation presentation = e.getPresentation(); presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); }
@Override public final void updateButton(AnActionEvent e) { final Boolean selected = isSelected(e) ? Boolean.TRUE : Boolean.FALSE; final Presentation presentation = e.getPresentation(); presentation.putClientProperty(Toggleable.SELECTED_PROPERTY, selected); }
@Override public void update(AnActionEvent e) { super.update(e); e.getPresentation().putClientProperty(Toggleable.SELECTED_PROPERTY, !myInspectionsFilter.isEmptyFilter()); }