diff options
Diffstat (limited to 'changelog')
-rw-r--r-- | changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java index 0ba6ad5ad6..59c9c0c185 100644 --- a/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java +++ b/changelog/org.eclipse.linuxtools.changelog.core/src/org/eclipse/linuxtools/internal/changelog/core/actions/FormatChangeLogAction.java @@ -25,15 +25,12 @@ public class FormatChangeLogAction extends AbstractHandler { @Override public Object execute(ExecutionEvent event) { IEditorPart editor = HandlerUtil.getActiveEditor(event); - if (editor == null || !(editor instanceof ChangeLogEditor)) { - return null; + if (editor instanceof ChangeLogEditor) { + SourceViewer srcViewer = (SourceViewer) ((ChangeLogEditor) editor).getMySourceViewer(); + if (srcViewer != null) { + srcViewer.doOperation(ISourceViewer.FORMAT); + } } - - SourceViewer srcViewer = (SourceViewer) ((ChangeLogEditor) editor).getMySourceViewer(); - if (srcViewer != null) { - srcViewer.doOperation(ISourceViewer.FORMAT); - } - return null; } |