Author: dazarov
Date: 2012-01-10 13:59:00 -0500 (Tue, 10 Jan 2012)
New Revision: 37747
Added:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
Removed:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
Log:
Renamed JBDSQuickAssistProcessor -> BaseQuickAssistProcessor
Copied:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
(from rev 37745,
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java)
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
(rev 0)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java 2012-01-10
18:59:00 UTC (rev 37747)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.common.text.xml;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
+import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
+import org.eclipse.jface.text.source.Annotation;
+import org.eclipse.jface.text.source.IAnnotationModel;
+import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
+import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
+import org.jboss.tools.common.text.xml.MarkerAnnotationInfo.AnnotationInfo;
+
+public class BaseQuickAssistProcessor implements IQuickAssistProcessor {
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ public boolean canFix(Annotation annotation) {
+ if(annotation instanceof SimpleMarkerAnnotation || annotation instanceof
TemporaryAnnotation)
+ return true;
+ return false;
+ }
+
+ public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
+ return false;
+ }
+
+ public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext
invocationContext) {
+ List<AnnotationInfo> all = new ArrayList<AnnotationInfo>();
+ List<AnnotationInfo> high = new ArrayList<AnnotationInfo>();
+ List<AnnotationInfo> low = new ArrayList<AnnotationInfo>();
+
+ IAnnotationModel model = invocationContext.getSourceViewer().getAnnotationModel();
+ if (model != null) {
+ Iterator<Annotation> iterator = model.getAnnotationIterator();
+ while (iterator.hasNext()) {
+ Annotation annotation = (Annotation) iterator.next();
+ if (!canFix(annotation))
+ continue;
+
+ Position position = model.getPosition(annotation);
+
+ if (position.overlapsWith(invocationContext.getOffset(), 1)) {
+ AnnotationInfo info = new AnnotationInfo(annotation, position);
+ if(info.isTop())
+ high.add(info);
+ else
+ low.add(info);
+ }
+ }
+ all.addAll(high);
+ all.addAll(low);
+ }
+ MarkerAnnotationInfo mai = new MarkerAnnotationInfo(all,
invocationContext.getSourceViewer());
+ List<ICompletionProposal> proposals = new
ArrayList<ICompletionProposal>();
+ for(AnnotationInfo info : all){
+ proposals.addAll(mai.getCompletionProposals(info));
+ }
+ return proposals.toArray(new ICompletionProposal[]{});
+ }
+
+}
Property changes on:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/BaseQuickAssistProcessor.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Deleted:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java 2012-01-10
17:40:29 UTC (rev 37746)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/JBDSQuickAssistProcessor.java 2012-01-10
18:59:00 UTC (rev 37747)
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.text.xml;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.quickassist.IQuickAssistInvocationContext;
-import org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.IAnnotationModel;
-import org.eclipse.ui.texteditor.SimpleMarkerAnnotation;
-import org.eclipse.wst.sse.ui.internal.reconcile.TemporaryAnnotation;
-import org.jboss.tools.common.text.xml.MarkerAnnotationInfo.AnnotationInfo;
-
-public class JBDSQuickAssistProcessor implements IQuickAssistProcessor {
-
- public String getErrorMessage() {
- return null;
- }
-
- public boolean canFix(Annotation annotation) {
- if(annotation instanceof SimpleMarkerAnnotation || annotation instanceof
TemporaryAnnotation)
- return true;
- return false;
- }
-
- public boolean canAssist(IQuickAssistInvocationContext invocationContext) {
- return false;
- }
-
- public ICompletionProposal[] computeQuickAssistProposals(IQuickAssistInvocationContext
invocationContext) {
- List<AnnotationInfo> all = new ArrayList<AnnotationInfo>();
- List<AnnotationInfo> high = new ArrayList<AnnotationInfo>();
- List<AnnotationInfo> low = new ArrayList<AnnotationInfo>();
-
- IAnnotationModel model = invocationContext.getSourceViewer().getAnnotationModel();
- if (model != null) {
- Iterator<Annotation> iterator = model.getAnnotationIterator();
- while (iterator.hasNext()) {
- Annotation annotation = (Annotation) iterator.next();
- if (!canFix(annotation))
- continue;
-
- Position position = model.getPosition(annotation);
-
- if (position.overlapsWith(invocationContext.getOffset(), 1)) {
- AnnotationInfo info = new AnnotationInfo(annotation, position);
- if(info.isTop())
- high.add(info);
- else
- low.add(info);
- }
- }
- all.addAll(high);
- all.addAll(low);
- }
- MarkerAnnotationInfo mai = new MarkerAnnotationInfo(all,
invocationContext.getSourceViewer());
- List<ICompletionProposal> proposals = new
ArrayList<ICompletionProposal>();
- for(AnnotationInfo info : all){
- proposals.addAll(mai.getCompletionProposals(info));
- }
- return proposals.toArray(new ICompletionProposal[]{});
- }
-
-}
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2012-01-10
17:40:29 UTC (rev 37746)
+++
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2012-01-10
18:59:00 UTC (rev 37747)
@@ -263,7 +263,7 @@
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
if (fQuickAssistant == null) {
IQuickAssistAssistant assistant = new QuickAssistAssistant();
- assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setQuickAssistProcessor(new BaseQuickAssistProcessor());
assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
if (fPreferenceStore != null) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2012-01-10
17:40:29 UTC (rev 37746)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2012-01-10
18:59:00 UTC (rev 37747)
@@ -50,7 +50,7 @@
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
-import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
+import org.jboss.tools.common.text.xml.BaseQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
import org.jboss.tools.common.text.xml.info.ChainTextHover;
import org.jboss.tools.common.text.xml.info.TextHoverInformationProvider;
@@ -282,7 +282,7 @@
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
if (fQuickAssistant == null) {
IQuickAssistAssistant assistant = new QuickAssistAssistant();
- assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setQuickAssistProcessor(new BaseQuickAssistProcessor());
assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
if (fPreferenceStore != null) {
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2012-01-10
17:40:29 UTC (rev 37746)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2012-01-10
18:59:00 UTC (rev 37747)
@@ -43,7 +43,7 @@
import org.eclipse.wst.sse.ui.internal.taginfo.TextHoverManager;
import org.eclipse.wst.sse.ui.internal.util.EditorUtility;
import org.jboss.tools.common.text.ext.hyperlink.HyperlinkDetector;
-import org.jboss.tools.common.text.xml.JBDSQuickAssistProcessor;
+import org.jboss.tools.common.text.xml.BaseQuickAssistProcessor;
import org.jboss.tools.common.text.xml.contentassist.ProposalSorter;
import org.jboss.tools.common.text.xml.info.ChainTextHover;
import org.jboss.tools.common.text.xml.info.TextHoverInformationProvider;
@@ -262,7 +262,7 @@
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
if (fQuickAssistant == null) {
IQuickAssistAssistant assistant = new QuickAssistAssistant();
- assistant.setQuickAssistProcessor(new JBDSQuickAssistProcessor());
+ assistant.setQuickAssistProcessor(new BaseQuickAssistProcessor());
assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
if (fPreferenceStore != null) {