improve ScmWebPlugin api

This commit is contained in:
Sebastian Sdorra
2010-09-20 14:51:10 +02:00
parent 2e4d54b325
commit 075e266620
12 changed files with 266 additions and 127 deletions

View File

@@ -1,37 +0,0 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sonia.scm;
//~--- JDK imports ------------------------------------------------------------
import java.io.InputStream;
/**
*
* @author Sebastian Sdorra
*/
public class HgPlugin extends ScmWebPluginAdapter
{
/** Field description */
public static final String SCRIPT = "/sonia/scm/hg.config.js";
//~--- get methods ----------------------------------------------------------
/**
* Method description
*
*
* @return
*/
@Override
public InputStream getScript()
{
return HgPlugin.class.getResourceAsStream(SCRIPT);
}
}

View File

@@ -0,0 +1,50 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sonia.scm.web;
//~--- JDK imports ------------------------------------------------------------
import java.io.InputStream;
/**
*
* @author Sebastian Sdorra
*/
public class HgWebPlugin implements ScmWebPlugin
{
/** Field description */
public static final String SCRIPT = "/sonia/scm/hg.config.js";
//~--- methods --------------------------------------------------------------
/**
* Method description
*
*
* @param context
*/
@Override
public void contextDestroyed(ScmWebPluginContext context)
{
// do nothing
}
/**
* Method description
*
*
* @param context
*/
@Override
public void contextInitialized(ScmWebPluginContext context)
{
context.addScriptResource(new ClasspathWebResource(SCRIPT));
}
}