mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
improve ScmWebPlugin api
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user