Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2015-11-30 19:23:22 +0000
committerMarkus Keller2015-12-01 12:59:16 +0000
commit96da92a20589d62dad534245c5d9c4d45618ee95 (patch)
treedb7f27dc0839db136db463ad28a7e763a6a07a91 /org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui
parent0bbe21e0e553957dd09eda0b29e8c77a98f38048 (diff)
downloadeclipse.platform.text-96da92a20589d62dad534245c5d9c4d45618ee95.tar.gz
eclipse.platform.text-96da92a20589d62dad534245c5d9c4d45618ee95.tar.xz
eclipse.platform.text-96da92a20589d62dad534245c5d9c4d45618ee95.zip
Diffstat (limited to 'org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui')
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaContentOutlinePage.java4
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java9
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java2
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java2
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java2
-rw-r--r--org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java8
6 files changed, 14 insertions, 13 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 78ec2f00c..f6c19201b 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, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -69,7 +69,7 @@ public class JavaContentOutlinePage extends ContentOutlinePage {
protected final static String SEGMENTS= "__java_segments"; //$NON-NLS-1$
protected IPositionUpdater fPositionUpdater= new DefaultPositionUpdater(SEGMENTS);
- protected List fContent= new ArrayList(10);
+ protected List<Segment> fContent= new ArrayList<>(10);
protected void parse(IDocument document) {
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
index 7153eb98e..69df362ec 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 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
@@ -189,19 +189,20 @@ public class JavaEditor extends TextEditor {
* @param required the required type
* @return an adapter for the required type or <code>null</code>
*/
+ @SuppressWarnings("unchecked")
@Override
- public Object getAdapter(Class required) {
+ public <T> T getAdapter(Class<T> required) {
if (IContentOutlinePage.class.equals(required)) {
if (fOutlinePage == null) {
fOutlinePage= new JavaContentOutlinePage(getDocumentProvider(), this);
if (getEditorInput() != null)
fOutlinePage.setInput(getEditorInput());
}
- return fOutlinePage;
+ return (T) fOutlinePage;
}
if (fProjectionSupport != null) {
- Object adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
+ T adapter= fProjectionSupport.getAdapter(getSourceViewer(), required);
if (adapter != null)
return adapter;
}
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
index 66c0fc143..404a1c5fd 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/JavaPartitionScanner.java
@@ -83,7 +83,7 @@ public class JavaPartitionScanner extends RuleBasedPartitionScanner {
IToken javaDoc= new Token(JAVA_DOC);
IToken comment= new Token(JAVA_MULTILINE_COMMENT);
- List rules= new ArrayList();
+ List<IPredicateRule> rules= new ArrayList<>();
// Add rule for single line comments.
rules.add(new EndOfLineRule("//", Token.UNDEFINED)); //$NON-NLS-1$
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
index e3a0c413c..1f22d8bd4 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/java/JavaCodeScanner.java
@@ -52,7 +52,7 @@ public class JavaCodeScanner extends RuleBasedScanner {
IToken comment= new Token(new TextAttribute(provider.getColor(JavaColorProvider.SINGLE_LINE_COMMENT)));
IToken other= new Token(new TextAttribute(provider.getColor(JavaColorProvider.DEFAULT)));
- List rules= new ArrayList();
+ List<IRule> rules= new ArrayList<>();
// Add rule for single line comments.
rules.add(new EndOfLineRule("//", comment)); //$NON-NLS-1$
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
index 85e6af4b3..44c25024e 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/javadoc/JavaDocScanner.java
@@ -64,7 +64,7 @@ public class JavaDocScanner extends RuleBasedScanner {
IToken tag= new Token(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_TAG)));
IToken link= new Token(new TextAttribute(provider.getColor(JavaColorProvider.JAVADOC_LINK)));
- List list= new ArrayList();
+ List<IRule> list= new ArrayList<>();
// Add rule for tags.
list.add(new SingleLineRule("<", ">", tag)); //$NON-NLS-2$ //$NON-NLS-1$
diff --git a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
index d3e16d81c..fd69adf71 100644
--- a/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
+++ b/org.eclipse.ui.examples.javaeditor/Eclipse Java Editor Example/org/eclipse/ui/examples/javaeditor/util/JavaColorProvider.java
@@ -35,15 +35,15 @@ public class JavaColorProvider {
public static final RGB JAVADOC_LINK= new RGB(128, 128, 128);
public static final RGB JAVADOC_DEFAULT= new RGB(0, 128, 128);
- protected Map fColorTable= new HashMap(10);
+ protected Map<RGB, Color> fColorTable= new HashMap<>(10);
/**
* Release all of the color resources held onto by the receiver.
*/
public void dispose() {
- Iterator e= fColorTable.values().iterator();
+ Iterator<Color> e= fColorTable.values().iterator();
while (e.hasNext())
- ((Color) e.next()).dispose();
+ e.next().dispose();
}
/**
@@ -54,7 +54,7 @@ public class JavaColorProvider {
* @return the color stored in the color table for the given RGB value
*/
public Color getColor(RGB rgb) {
- Color color= (Color) fColorTable.get(rgb);
+ Color color= fColorTable.get(rgb);
if (color == null) {
color= new Color(Display.getCurrent(), rgb);
fColorTable.put(rgb, color);

Back to the top