import java.net.URL;
import net.sourceforge.phpeclipse.webbrowser.views.BrowserView;
+import net.sourceforge.phpeclipse.wiki.internal.Configuration;
import net.sourceforge.phpeclipse.wiki.internal.ConfigurationWorkingCopy;
-import net.sourceforge.phpeclipse.wiki.internal.IConfiguration;
import net.sourceforge.phpeclipse.wiki.velocity.EditorText;
import org.apache.velocity.VelocityContext;
text = new EditorText(targetEditor);
}
- abstract protected IConfiguration getUrl();
+ abstract protected Configuration getConfiguration();
public void run(IAction action) {
-// String selection = findSelectedText();
-// if (selection == null || selection.trim().length() == 0) {
-// selection = "";
-// }
URL url;
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
} else {
page.bringToTop(part);
}
- IConfiguration config = getUrl();
- String templateString = generateUrl(config.getURL());
+ Configuration config = getConfiguration();
+ String templateString = generateUrl(config, config.getURL());
if (templateString != null && !templateString.equals("")) {
((BrowserView) part).setUrl(templateString);
}
public void selectionChanged(IAction action, ISelection selection) {
}
- public String generateUrl(String template) {
+ public String generateUrl(Configuration config, String template) {
/* first, we init the runtime engine. Defaults are fine. */
VelocityContext context = new VelocityContext();
- ConfigurationWorkingCopy config = new ConfigurationWorkingCopy();
- config.setName("test");
- config.setPassword("pw");
-
context.put("config", config);
text.clear();
context.put("text", text);