public class LocalVariableProposal extends AbstractProposal {
private final String fIdentifierName;
+
private final IRegion fRegion;
- private int fRelevance;
+
+ private final int fRelevance;
/**
* Creates a template proposal with a template and its context.
+ *
* @param template
* the template
* @param image
* the icon of the proposal.
*/
public LocalVariableProposal(String identifierName, IRegion region, ITextViewer viewer) {
+ this(identifierName, region, viewer, 99);
+ }
+
+ public LocalVariableProposal(String identifierName, IRegion region, ITextViewer viewer, int relevance) {
super(viewer);
fIdentifierName = identifierName;
fRegion = region;
- fRelevance = 99;
+ fRelevance = relevance;
}
/*
*/
public String getAdditionalProposalInfo() {
StringBuffer hoverInfoBuffer = new StringBuffer();
- // String workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
-// String workspaceLocation;
-// if (fProject != null) {
-// workspaceLocation = fProject.getLocation().toString() + '/';
-// } else {
-// // should never happen?
-// workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
-// }
- hoverInfoBuffer.append("local variable -");
+ if (fRelevance>95) {
+ hoverInfoBuffer.append("function source variable -");
+ } else {
+ hoverInfoBuffer.append("editor source variable -");
+ }
hoverInfoBuffer.append(fIdentifierName);
return hoverInfoBuffer.toString();
}
public int hashCode() {
return fIdentifierName.hashCode();
}
- /**
- * @param relevance The relevance to set.
- */
- public void setRelevance(int relevance) {
- fRelevance = relevance;
- }
+
}
\ No newline at end of file