/**
* Creates a template proposal with a template and its context.
- *
+ *
* @param template
- * the template
+ * the template
* @param context
- * the context in which the template was requested.
+ * the context in which the template was requested.
* @param image
- * the icon of the proposal.
+ * the icon of the proposal.
*/
- public DeclarationProposal(IProject project, String identifierName, PHPIdentifierLocation location, TemplateContext context,
+ public DeclarationProposal(IProject project, String identifierName,
+ PHPIdentifierLocation location, TemplateContext context,
IRegion region, ITextViewer viewer) {
super(viewer);
// Image image_fun,
LinkedPositionUI editor = new LinkedPositionUI(fViewer, manager);
switch (fLocation.getType()) {
case PHPIdentifierLocation.FUNCTION:
- editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
+ editor
+ .setFinalCaretOffset(fIdentifierName.length() + start
+ + 1);
break;
case PHPIdentifierLocation.CONSTRUCTOR:
- editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
+ editor
+ .setFinalCaretOffset(fIdentifierName.length() + start
+ + 1);
break;
case PHPIdentifierLocation.METHOD:
- editor.setFinalCaretOffset(fIdentifierName.length() + start + 1);
+ editor
+ .setFinalCaretOffset(fIdentifierName.length() + start
+ + 1);
break;
default:
workspaceLocation = fProject.getLocation().toString() + '/';
} else {
// should never happen?
- workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+ workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot()
+ .getFullPath().toString();
}
String filename = workspaceLocation + fLocation.getFilename();
PHPDocUtil.appendPHPDoc(hoverInfoBuffer, filename, fLocation);
if (fLocation != null) {
fInfo = fLocation.getUsage();
if (fInfo != null) {
- // extract the parameter context information for the function:
+ // extract the parameter context information for the
+ // function:
int i0 = fInfo.indexOf('(');
int newline = fInfo.indexOf('\n');
if (i0 >= 0 && (i0 < newline || newline < 0)) {
int i1 = fInfo.indexOf(')', i0 + 1);
if (i1 > 0) {
- fContextInfo = new ContextInformation(null, fInfo.substring(i0+1, i1));
+ fContextInfo = new ContextInformation(null, fInfo
+ .substring(i0 + 1, i1));
} else {
fContextInfo = new ContextInformation(null, fInfo);
}
*/
public String getDisplayString() {
String workspaceLocation;
+ String workspaceName;
if (fProject != null) {
- workspaceLocation = fProject.getName().toString() + '/';
+ workspaceLocation = fProject.getFullPath().toString() + '/';
+ workspaceName = fProject.getName().toString() + '/';
} else {
// should never happen?
- workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot().getLocation().toString();
+ workspaceLocation = PHPeclipsePlugin.getWorkspace().getRoot()
+ .getFullPath().toString();
+ workspaceName = workspaceLocation;
}
- String filename = workspaceLocation + fLocation.getFilename();
- String usage = PHPDocUtil.getUsage(filename, fLocation);
- String result = fIdentifierName + TemplateMessages.getString("TemplateProposal.delimiter");
+ String filename = fLocation.getFilename();
+ String usage = PHPDocUtil.getUsage(workspaceLocation + filename, fLocation);
+ String result = fIdentifierName
+ + TemplateMessages.getString("TemplateProposal.delimiter");
if (usage.length() > 0) {
- result += usage + TemplateMessages.getString("TemplateProposal.delimiter");
+ result += usage
+ + TemplateMessages.getString("TemplateProposal.delimiter");
}
- result += filename;
+ result += workspaceName + filename;
return result;
}