[jbosstools-commits] JBoss Tools SVN: r17568 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Sep 14 18:20:05 EDT 2009


Author: vrubezhny
Date: 2009-09-14 18:20:05 -0400 (Mon, 14 Sep 2009)
New Revision: 17568

Modified:
   trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
Log:
JBIDE-512 context variable code completion dropdown should show their "source"
JBIDE-2541 Show java-doc for EL content assist item

The values of type, sourceType and JavaDoc are gathered to be displayed in CA

Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java	2009-09-14 22:16:37 UTC (rev 17567)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/text/TextProposal.java	2009-09-14 22:20:05 UTC (rev 17568)
@@ -45,12 +45,31 @@
 	private int relevance = R_NONE;
 	private int position = -1;
 	private boolean autoActivationContentAssistantAfterApplication = false;
-
+	
+	private String type;
+	private String sourceType;
+	
 	private int start = -1;
 	private int end = -1;
 
 	PostProcessing postProcessing;
 
+	public String getType() {
+		return type;
+	}
+	
+	public void setType(String typeName) {
+		this.type = typeName;
+	}
+	
+	public String getSourceType() {
+		return sourceType;
+	}
+	
+	public void setSourceType(String sourceTypeName) {
+		this.sourceType = sourceTypeName;
+	}
+	
 	/**
 	 * 
 	 * @return
@@ -85,7 +104,19 @@
 	 * @return
 	 */
 	public String getLabel() {
-		return label;
+		String l = label != null ? label : getReplacementString() == null ? "" : getReplacementString(); //$NON-NLS-1$
+	
+		StringBuffer dispLabel = new StringBuffer(l);
+		if (type != null) {
+			dispLabel.append(" : ");  //$NON-NLS-1$
+			dispLabel.append(type);
+		}
+		if (sourceType != null) {
+			dispLabel.append(" - ");  //$NON-NLS-1$
+			dispLabel.append(sourceType);
+		}
+		
+		return dispLabel.toString();
 	}
 
 	/**



More information about the jbosstools-commits mailing list