diff options
author | Alexander Kurtakov | 2018-04-19 19:04:25 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-04-19 19:04:25 +0000 |
commit | d353d2648d4e1313a0c76cbd2333ead791caa3bb (patch) | |
tree | 5a919ebc3819fb567172ce9974169b5e159edebd /org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example | |
parent | bb7af253bd288e46ef1df9328d7bd26d53f5a9eb (diff) | |
download | eclipse.platform.text-d353d2648d4e1313a0c76cbd2333ead791caa3bb.tar.gz eclipse.platform.text-d353d2648d4e1313a0c76cbd2333ead791caa3bb.tar.xz eclipse.platform.text-d353d2648d4e1313a0c76cbd2333ead791caa3bb.zip |
Bug 533837 - Direct use of IStructuredSelection
Instead of getSelection and cast.
Enable save actions to automate cleanup actions.
Change-Id: I94a0037f7af2fa9d213a00f2bc385507891ae8e4
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example')
-rw-r--r-- | org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java index 62fa5c215de..e38eec277b5 100644 --- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java +++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2015 IBM Corporation and others. + * Copyright (c) 2000, 2018 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -18,7 +18,6 @@ import java.util.List; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.LabelProvider; @@ -194,11 +193,11 @@ public class JavaContentOutlinePage extends ContentOutlinePage { super.selectionChanged(event); - ISelection selection= event.getSelection(); + IStructuredSelection selection= event.getStructuredSelection(); if (selection.isEmpty()) fTextEditor.resetHighlightRange(); else { - Segment segment= (Segment) ((IStructuredSelection) selection).getFirstElement(); + Segment segment= (Segment) selection.getFirstElement(); int start= segment.position.getOffset(); int length= segment.position.getLength(); try { |