Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNitin Dahyabhai2019-05-16 10:19:11 -0400
committerNitin Dahyabhai2019-05-16 10:19:11 -0400
commit935188c385be98636c9cde110bf090066923fb14 (patch)
tree754e855571c8bdd24b30d75da5bd96c99cceeb69
parent3c7efd9363a33997dbf158a410df2a9a27d7ecca (diff)
downloadwebtools.sourceediting-935188c385be98636c9cde110bf090066923fb14.tar.gz
webtools.sourceediting-935188c385be98636c9cde110bf090066923fb14.tar.xz
webtools.sourceediting-935188c385be98636c9cde110bf090066923fb14.zip
[285717] cleanups
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java16
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java6
-rw-r--r--core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java28
-rw-r--r--web/bundles/org.eclipse.wst.html.ui/icons/full/obj16/attribute_obj.gifbin0 -> 167 bytes
4 files changed, 29 insertions, 21 deletions
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
index f54051c0d..f0e711470 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/AnnotationQuery.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -71,10 +71,11 @@ class AnnotationQuery {
* @return a annotation query result or <code>null</code>
*/
public AnnotationQueryResult performQuery(Annotation anno) {
- if (!(anno instanceof TemporaryAnnotation))
+ if (!(anno instanceof TemporaryAnnotation)) {
return null;
+ }
- Map annoAttributes = ((TemporaryAnnotation) anno).getAttributes();
+ Map<String,String> annoAttributes = ((TemporaryAnnotation) anno).getAttributes();
/*
* https://bugs.eclipse.org/bugs/show_bug.cgi?id=243660
*
@@ -88,18 +89,19 @@ class AnnotationQuery {
// Check type
if (type != null) {
- String problemType = (String) annoAttributes.get("problemType"); //$NON-NLS-1$;
- if (!type.equals(problemType))
+ String problemType = annoAttributes.get("problemType"); //$NON-NLS-1$;
+ if (!type.equals(problemType)) {
return null;
+ }
}
String[] values = new String[attributes.length];
for (int i = 0; i < attributes.length; i++) {
- Object value = annoAttributes.get(attributes[i]);
+ String value = annoAttributes.get(attributes[i]);
if (value == null) {
return null;
}
- values[i] = value.toString();
+ values[i] = value;
}
// Create and return the result
return new AnnotationQueryResult(values);
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
index 146673760..7826836f7 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/correction/QuickFixRegistry.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
+ * Copyright (c) 2008, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -99,7 +99,7 @@ public class QuickFixRegistry {
public IQuickAssistProcessor[] getQuickFixProcessors(Annotation anno) {
// Collect all matches
- List processors = new ArrayList();
+ List<IQuickAssistProcessor> processors = new ArrayList<>();
for (Iterator iter = resolutionQueries.keySet().iterator(); iter.hasNext();) {
AnnotationQuery query = (AnnotationQuery) iter.next();
AnnotationQueryResult result = null;
@@ -134,6 +134,6 @@ public class QuickFixRegistry {
}
}
}
- return (IQuickAssistProcessor[]) processors.toArray(new IQuickAssistProcessor[processors.size()]);
+ return processors.toArray(new IQuickAssistProcessor[processors.size()]);
}
}
diff --git a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
index 7c239bb24..9b928aca7 100644
--- a/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
+++ b/core/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/reconcile/TemporaryAnnotation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2001, 2015 IBM Corporation and others.
+ * Copyright (c) 2001, 2019 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,6 +10,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Jens Lukowski/Innoopract - initial renaming/restructuring
+ * Lakshminarayana Nekkanti <narayana.nekkanti@gmail.com> - Support for showing quickfixes in the vertical ruler
*
*******************************************************************************/
package org.eclipse.wst.sse.ui.internal.reconcile;
@@ -37,11 +38,11 @@ import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.editors.text.EditorsUI;
import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
import org.eclipse.ui.texteditor.AnnotationPreference;
import org.eclipse.ui.texteditor.AnnotationPreferenceLookup;
import org.eclipse.ui.texteditor.IAnnotationImageProvider;
import org.eclipse.wst.sse.ui.internal.ITemporaryAnnotation;
+import org.eclipse.wst.sse.ui.internal.SSEUIPlugin;
/**
@@ -123,7 +124,7 @@ public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotat
private Object fKey = null;
private Position fPosition = null;
- private Map fAttributes = null;
+ private Map<String,String> fAttributes = null;
private boolean fIsQuickFixable = false;
private boolean fIsQuickFixableStateSet = false;
@@ -256,21 +257,23 @@ public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotat
* @see Annotation#paint
*/
public void paint(GC gc, Canvas canvas, Rectangle r) {
- if (fImage == null || fImage.isDisposed())
+ if (fImage == null || fImage.isDisposed()) {
fImage = getImage();
- if (fImage != null)
+ }
+ if (fImage != null) {
ImageUtilities.drawImage(fImage, gc, canvas, r, SWT.CENTER, SWT.TOP);
+ }
}
public String toString() {
return "" + fPosition.getOffset() + ':' + fPosition.getLength() + ": " + getText(); //$NON-NLS-1$ //$NON-NLS-2$
}
- public Map getAttributes() {
+ public Map<String,String> getAttributes() {
return fAttributes;
}
- public void setAttributes(Map attributes) {
+ public void setAttributes(Map<String,String> attributes) {
fAttributes = attributes;
}
@@ -305,14 +308,15 @@ public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotat
private Image getImage() {// Copied from org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess
AnnotationPreference preference = getAnnotationPreference();
- ImageRegistry registry = EditorsPlugin.getDefault().getImageRegistry();
+ ImageRegistry registry = SSEUIPlugin.getInstance().getImageRegistry();
IAnnotationImageProvider annotationImageProvider = preference.getAnnotationImageProvider();
if (annotationImageProvider != null) {
Image image = annotationImageProvider.getManagedImage(this);
- if (image != null)
+ if (image != null) {
return image;
+ }
String id = annotationImageProvider.getImageDescriptorId(this);
if (id != null) {
@@ -326,8 +330,9 @@ public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotat
}
}
String annotationType = getType();
- if (annotationType == null)
+ if (annotationType == null) {
return null;
+ }
if (hasQuickFix()) {
ImageDescriptor quickFixImageDesc = preference.getQuickFixImageDescriptor();
@@ -337,8 +342,9 @@ public class TemporaryAnnotation extends Annotation implements ITemporaryAnnotat
registry.put(quickFixImageDesc.toString(), quickFixImageDesc);
image = registry.get(quickFixImageDesc.toString());
}
- if (image != null)
+ if (image != null) {
return image;
+ }
}
}
diff --git a/web/bundles/org.eclipse.wst.html.ui/icons/full/obj16/attribute_obj.gif b/web/bundles/org.eclipse.wst.html.ui/icons/full/obj16/attribute_obj.gif
new file mode 100644
index 000000000..79d49d037
--- /dev/null
+++ b/web/bundles/org.eclipse.wst.html.ui/icons/full/obj16/attribute_obj.gif
Binary files differ

Back to the top