Search in sources :

Example 1 with PartEventAction

use of org.eclipse.ui.actions.PartEventAction in project xtext-eclipse by eclipse.

the class DefaultMergeViewer method setActionsActivated.

@Override
protected void setActionsActivated(SourceViewer sourceViewer, boolean state) {
    DefaultMergeEditor mergeEditor = getEditor(sourceViewer);
    if (mergeEditor != null) {
        mergeEditor.setActionsActivated(state);
        IAction saveAction = mergeEditor.getAction(ITextEditorActionConstants.SAVE);
        if (saveAction instanceof IPageListener) {
            PartEventAction partEventAction = (PartEventAction) saveAction;
            IWorkbenchPart compareEditorPart = getCompareConfiguration().getContainer().getWorkbenchPart();
            if (state) {
                partEventAction.partActivated(compareEditorPart);
            } else {
                partEventAction.partDeactivated(compareEditorPart);
            }
        }
    }
}
Also used : IAction(org.eclipse.jface.action.IAction) PartEventAction(org.eclipse.ui.actions.PartEventAction) IWorkbenchPart(org.eclipse.ui.IWorkbenchPart) IPageListener(org.eclipse.ui.IPageListener)

Aggregations

IAction (org.eclipse.jface.action.IAction)1 IPageListener (org.eclipse.ui.IPageListener)1 IWorkbenchPart (org.eclipse.ui.IWorkbenchPart)1 PartEventAction (org.eclipse.ui.actions.PartEventAction)1