added disable option to each core plugin

This commit is contained in:
Sebastian Sdorra
2012-02-11 16:18:46 +01:00
parent 46c41b4ae4
commit f0364e1520
7 changed files with 80 additions and 12 deletions

View File

@@ -275,15 +275,15 @@ public abstract class AbstractRepositoryHandler<C extends SimpleRepositoryConfig
}
/**
* Method description
* Returns true if the plugin is configured and enabled.
*
*
* @return
* @return true if the plugin is configured and enabled
*/
@Override
public boolean isConfigured()
{
return (config != null) && config.isValid();
return (config != null) && config.isValid() &&!config.isDisabled();
}
//~--- set methods ----------------------------------------------------------

View File

@@ -63,6 +63,18 @@ public class SimpleRepositoryConfig implements Validateable
return repositoryDirectory;
}
/**
* Returns true if the plugin is disabled.
*
*
* @return true if the plugin is disabled
* @since 1.13
*/
public boolean isDisabled()
{
return disabled;
}
/**
* Returns true if the configuration object is valid.
*
@@ -77,6 +89,18 @@ public class SimpleRepositoryConfig implements Validateable
//~--- set methods ----------------------------------------------------------
/**
* Enable or disable the plugin.
*
*
* @param disabled
* @since 1.13
*/
public void setDisabled(boolean disabled)
{
this.disabled = disabled;
}
/**
* Sets the directory for the repositories
*
@@ -90,6 +114,9 @@ public class SimpleRepositoryConfig implements Validateable
//~--- fields ---------------------------------------------------------------
/** Field description */
/** true if the plugin is disabled */
private boolean disabled = false;
/** directory for repositories */
private File repositoryDirectory;
}