Skip to content

Commit

Permalink
Make some internal methods accessible to help Postfix Code Completion
Browse files Browse the repository at this point in the history
plug-in

Bug: 433500
Change-Id: I94ebd51c67d7f7c804d175e33fceb80d6216330d
Signed-off-by: Nicolaj Hoess <[email protected]>
  • Loading branch information
trylimits authored and dmegert committed Aug 22, 2014
1 parent 475982c commit 2a4886c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Lars Vogel <[email protected]> - [templates][content assist] Ctrl+Space without any starting letter shows to no templates - https://bugs.eclipse.org/406463
* Lukas Hanke <[email protected]> - [templates][content assist] Content assist for 'for' loop should suggest member variables - https://bugs.eclipse.org/117215
* Nicolaj Hoess <[email protected]> - Make some internal methods accessible to help Postfix Code Completion plug-in - https://bugs.eclipse.org/433500
*******************************************************************************/
package org.eclipse.jdt.internal.corext.template.java;

Expand Down Expand Up @@ -759,7 +760,7 @@ public static String evaluateTemplate(Template template, ICompilationUnit compil
return buffer.getString();
}

TemplateVariable getTemplateVariable(String name) {
public TemplateVariable getTemplateVariable(String name) {
TemplateVariable variable= fVariables.get(name);
if (variable != null && !variable.isResolved())
getContextType().resolve(variable, this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/*******************************************************************************
* Copyright (c) 2000, 2011 IBM Corporation and others.
* Copyright (c) 2000, 2014 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are 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:
* IBM Corporation - initial API and implementation
* Nicolaj Hoess <[email protected]> - Make some internal methods accessible to help Postfix Code Completion plug-in - https://bugs.eclipse.org/433500
*******************************************************************************/
package org.eclipse.jdt.internal.ui.text.template.contentassist;

Expand Down Expand Up @@ -148,7 +149,15 @@ public void complete(ITextViewer viewer, int completionPosition, ICompilationUni
}
}

private Image getImage() {
protected TemplateContextType getContextType() {
return fContextType;
}

protected ArrayList<TemplateProposal> getProposals() {
return fProposals;
}

protected Image getImage() {
if (fContextType instanceof SWTContextType)
return JavaPluginImages.get(JavaPluginImages.IMG_OBJS_SWT_TEMPLATE);
else
Expand Down

0 comments on commit 2a4886c

Please sign in to comment.