Examples of BasicPluginConfigModel


Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

    private PluginInterface _pluginInterface;

// -------------------------- STATIC METHODS --------------------------

    public static void initializeConfigPage(final PluginInterface pluginInterface) {
        final BasicPluginConfigModel cfg = pluginInterface.getUIManager().createBasicPluginConfigModel(_BaseConfigName);
        LocaleUtilities localeUtil = pluginInterface.getUtilities().getLocaleUtilities();

        cfg.addBooleanParameter2(_PluginActive, _BaseConfigName + "." + _PluginActive, false);
        cfg.addIntParameter2(_IntervalSearch, _BaseConfigName + "." + _IntervalSearch, _IntervalSearchDefault);
        cfg.addStringParameter2(_ExcludeFilesRegex, _BaseConfigName + "." + _ExcludeFilesRegex, "");

        BooleanParameter useLanguageOnSubTitle =
                cfg.addBooleanParameter2(_UseLanguageOnSubtitle, _BaseConfigName + "." + _UseLanguageOnSubtitle, false);
        String[] subTitleValues = SubTitleLanguage.getValues();
        String[] subTitleLabels = SubTitleLanguage.getDescriptions();
        StringListParameter languageOnSubtitle =
                cfg.addStringListParameter2(_LanguageOnSubtitle, _BaseConfigName + "." + _LanguageOnSubtitle, subTitleValues, subTitleLabels, "");
        useLanguageOnSubTitle.addEnabledOnSelection(languageOnSubtitle);

        // Configuração dos Handlers
        final List<IDownloadHandler> handlersList = SubTitleManager.getExistingHandlers();
        for (IDownloadHandler handler : handlersList) {
            try {
                DownloadHandlerVO handlerVO = (DownloadHandlerVO) handler.getHandlerVOType().newInstance();
                Method[] metodos = handlerVO.getClass().getMethods();

                int paramCount = 2;
                for (Method metodo : metodos)
                    if (metodo.getName().startsWith("set"))
                        paramCount++;

                String nomeHandle = handler.getClass().getSimpleName();
                addLocalisedMessage(localeUtil, nomeHandle, handler.getDescription());
                addLocalisedMessage(localeUtil, handler.getSiteUrl(), handler.getSiteUrl());

                Parameter[] parametros = new Parameter[paramCount];
                parametros[0] = cfg.addHyperlinkParameter2(handler.getSiteUrl(), handler.getSiteUrl());
                parametros[1] = cfg.addBooleanParameter2(nomeHandle, _BaseConfigName + ".Active", false);

                paramCount = 2;
                for (Method metodo : metodos) {
                    if (metodo.getName().startsWith("set")) {
                        Class<?> typeParam = metodo.getParameterTypes()[0];
                        String nomeProp = metodo.getName().substring(3);
                        String nomePropPlugin = handler.getClass().getSimpleName() + "." + nomeProp;
                        String resourceMessage = _BaseConfigName + "." + handlerVO.getClass().getSimpleName() + "." + nomeProp;

                        if ((handler.getLogonType() == IDownloadHandler.LogonType.None) &
                                ((metodo.getName().equals("setUserName")) || (metodo.getName().equals("setPassword"))))
                            continue;

                        if (typeParam == SubTitleLanguage.class) {
                            // Na lista de idiomas coloco só os que o Handler suporta
                            SubTitleLanguage[] enumValores = handler.getSupportedLanguages();
                            String[] valores = SubTitleLanguage.getValues(enumValores);
                            String[] labels = SubTitleLanguage.getDescriptions(enumValores);
                            parametros[paramCount] = cfg.addStringListParameter2(nomePropPlugin, resourceMessage, valores, labels, "");
                        } else if (typeParam == FileUtils.SubTitleExtensions.class) {
                            // Na lista de extensões coloca só as que o Handler suporta
                            FileUtils.SubTitleExtensions[] enumValores = handler.getSupportedSubTitleExtensions();
                            if (enumValores.length > 0) {
                                String[] valores = new String[enumValores.length];
                                for (int j = 0; j < enumValores.length; j++)
                                    valores[j] = enumValores[j].toString();
                                parametros[paramCount] = cfg.addStringListParameter2(nomePropPlugin, resourceMessage, valores, "");
                            }
                        } else if (typeParam == int.class) {
                            parametros[paramCount] = cfg.addIntParameter2(nomePropPlugin, resourceMessage, 0);
                        } else if (typeParam == String.class) {
                            if (nomeProp.equalsIgnoreCase("Password"))
                                parametros[paramCount] = cfg.addPasswordParameter2(nomePropPlugin, resourceMessage, PasswordParameter.ET_PLAIN, new byte[0]);
                            else
                                parametros[paramCount] = cfg.addStringParameter2(nomePropPlugin, resourceMessage, "");
                        } else if (typeParam.isEnum()) {
                            Object[] enumValores = typeParam.getEnumConstants();
                            String[] valores = new String[enumValores.length];
                            for (int j = 0; j < enumValores.length; j++)
                                valores[j] = enumValores[j].toString();
                            parametros[paramCount] = cfg.addStringListParameter2(nomePropPlugin, resourceMessage, valores, "");
                        }
                        ((BooleanParameter) parametros[1]).addEnabledOnSelection(parametros[paramCount]);
                        paramCount++;
                    }
                }
                cfg.createGroup(nomeHandle, parametros);
            } catch (Exception e) {
                throw new RuntimeException(e.getMessage());
            }
        }

        // Configuração das Categorias
        String[] existingCategories = getExistingCategories(pluginInterface);
        Parameter[] parametros = new Parameter[existingCategories.length];
        BooleanParameter paramCatAll = cfg.addBooleanParameter2(_CategoryAll, _BaseConfigName + "." + _CategoryAll, true);
        int paramCount = 0;
        for (String category : existingCategories) {
            String nomeCfgCategory = _CategoryList + "." + category;
            String nomeResMessage = _BaseConfigName + "." + nomeCfgCategory;
            addLocalisedMessage(localeUtil, nomeResMessage, category);
            parametros[paramCount] = cfg.addBooleanParameter2(nomeCfgCategory, nomeResMessage, false);
            paramCatAll.addDisabledOnSelection(parametros[paramCount]);
            paramCount++;
        }
        cfg.createGroup(_BaseConfigName + "." + _CategoryList, parametros);
    }
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

  public void initialize(PluginInterface pluginInterface) {
    this.pluginInterface = pluginInterface;
    //View view = new View(pluginInterface);
    um = this.pluginInterface.getUpdateManager();
    UIManager  ui_manager = pluginInterface.getUIManager();
    BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.restarter");
   
    config_model.addStringParameter2( "restarter_value", "restarter.time.value", "24:00");
    config_model.addBooleanParameter2("restarter_active","restarter.active.switch",false);
    config_model.addIntParameter2( "restarter_interval_value","restarter.time.interval",480);
    config_model.addBooleanParameter2("interval_active","restarter.interval.active",false);
    config_model.addBooleanParameter2("restarter_stop","restarter.stop",false);
    config_model.addBooleanParameter2("auto_open","restarter.auto.open",false);
    original_time=getCurrentTime();
    View view = new View(pluginInterface);
    restartCheck(timer, view);
    config_getter = pluginInterface.getPluginconfig();
   
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

 
  public void initialize(PluginInterface pluginInterface) {
    this.pluginInterface = pluginInterface;
    Utilities utils = pluginInterface.getUtilities();
    UIManager  ui_manager = pluginInterface.getUIManager();
    BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.AzTrackerFind");
    total_ip_count = 0;
    config_model.addBooleanParameter2("AutoOpen","AzTrackerFind.auto.open",false);
    config_model.addIntParameter2( "timeout_value", "AzTrackerFind.timeout.value", 30);
    config_model.addIntParameter2("AzTrackerFind_port1","AzTrackerFind.port1",6969 );
    config_model.addIntParameter2("AzTrackerFind_port2","AzTrackerFind.port2",0 );
    config_model.addIntParameter2("AzTrackerFind_port3","AzTrackerFind.port3",0);
    config_model.addStringParameter2( "AzTrackerFind_url_user","AzTrackerFind.url.user","username");
    config_model.addStringParameter2("AzTrackerFind_url_password", "AzTrackerFind.url.password", "password");
    config_model.addBooleanParameter2("AzTrackerFind_autoinsert","AzTrackerFind.autoinsert",false);
    config_model.addBooleanParameter2("MilitaryTime", "AzTrackerFind.military.time", false);
    BooleanParameter enable = config_model.addBooleanParameter2("AutoDownload","AzTrackerFind.auto.download",false);
    String default_dir = pluginInterface.getPluginDirectoryName() + System.getProperty("file.separator") + "torrents";
    DirectoryParameter enabled_dir = config_model.addDirectoryParameter2("AutoDownload_dir","AzTrackerFind.autodownload.dir",default_dir);
    enable.addEnabledOnSelection( enabled_dir );
    if (utils.isLinux())
        {
      config_model.addStringParameter2("AzTrackerFind_url_commandline", "AzTrackerFind.url.commandline","firefox");
        }
        else if (utils.isOSX())
        {
          config_model.addLabelParameter2("AzTrackerFind.url.maclabel");
        }
    else
    {
    config_model.addLabelParameter2("AzTrackerFind.url.winlabel");
    }
   
    config_model.addLabelParameter2("AzTrackerFind.label.close" );
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    boolean autoOpen = config_getter.getPluginBooleanParameter("AutoOpen");
   
   
   
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

    this.pluginInterface = pluginInterface;

        pi=pluginInterface;
       
        UIManager   ui_manager = pluginInterface.getUIManager();
        BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.firefrog");
       
        //settings on main options panel
        config_model.addBooleanParameter2("firefrog_military_time","firefrog.military.time",false);
        config_model.addBooleanParameter2("firefrog_auto_open","firefrog.auto.open",true);
       
        pluginInterface.getUIManager().addUIListener(new UIManagerListener() {
            public void UIAttached(UIInstance instance) {
              if (instance instanceof UISWTInstance) {
                swtInstance = (UISWTInstance)instance;
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

  public static final String  OSName = System.getProperty("os.name");
  public void initialize(PluginInterface pluginInterface) {
    this.pluginInterface = pluginInterface;
 
    UIManager  ui_manager = pluginInterface.getUIManager();
    BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.webpeerfinder");
   
    config_model.addBooleanParameter2("AutoOpen","webpeer.auto.open",false);
    config_model.addIntParameter2( "timeout_value", "webpeer.timeout.value", 30);
    config_model.addIntParameter2("webpeer_port1","webpeer.port1",6969 );
    config_model.addIntParameter2("webpeer_port2","webpeer.port2",0 );
    config_model.addIntParameter2("webpeer_port3","webpeer.port3",0);
    config_model.addStringParameter2( "webpeer_url_user","webpeer.url.user","username");
    config_model.addStringParameter2("webpeer_url_password", "webpeer.url.password", "password");
    config_model.addBooleanParameter2("webpeer_autoinsert","webpeer.autoinsert",false);
    if (OSName.equalsIgnoreCase("Linux"))
        {
      config_model.addStringParameter2("webpeer_url_commandline", "webpeer.url.commandline","%s");
        }
        else if (OSName.equalsIgnoreCase("Mac OS X"))
        {
          config_model.addStringParameter2("webpeer_url_commandline", "webpeer.url.commandline","%s");
        }
    else
    {
    config_model.addLabelParameter2("webpeer.url.winlabel");
    }
   
    config_model.addLabelParameter2("webpeer.label.close" );
    PluginConfig config_getter = pluginInterface.getPluginconfig();
    boolean autoOpen = config_getter.getPluginBooleanParameter("AutoOpen");
    //System.out.print("AutoInsert: " + config_getter.getPluginBooleanParameter("webpeer_autoinsert"));
   
   
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

    this.pluginInterface = pluginInterface;

        pi=pluginInterface;
       
        UIManager   ui_manager = pluginInterface.getUIManager();
        BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.userspace");
       
        //settings on main options panel
        config_model.addBooleanParameter2("userspace_military_time","userspace.military.time",false);
        config_model.addBooleanParameter2("userspace_auto_open","userspace.auto.open",true);
       
        pluginInterface.getUIManager().addUIListener(new UIManagerListener() {
            public void UIAttached(UIInstance instance) {
              if (instance instanceof UISWTInstance) {
                swtInstance = (UISWTInstance)instance;
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

   
        //Setting up the user interface manager so that we can set up the config section under options
    UIManager  ui_manager = pluginInterface.getUIManager();
       
        //BasicPluginConfigModel allows us to specify which options are under the Tools-Options-Plugins-TextAlert view
    BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.textalert");
   
        //Directory setup:  in the format of
        //"key" (which is how I call it later) ,
        //"Messages.properties key" to call from that file so you can word it how you want ,
        //default value -- here I use the plugin directory.
        config_model.addDirectoryParameter2("Directory_to_use","textalert.directory",pluginInterface.getPluginDirectoryName());
    config_model.addStringParameter2("File_to_use","textalert.file","completed.txt");
   
   
    //Call the listener so that we can listen for changes in the states of the torrents
        downloadListener();
   
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

    this.pluginInterface = pluginInterface;

        pi = pluginInterface;
       
        UIManager   ui_manager = pluginInterface.getUIManager();
        BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.azcatdest");
       
        //settings on main options panel
        //config_model.addBooleanParameter2("userspace_military_time","userspace.military.time",false);
        config_model.addBooleanParameter2("azcatdest_auto_open","azcatdest.auto.open",false);
       
        pluginInterface.getUIManager().addUIListener(new UIManagerListener() {
            public void UIAttached(UIInstance instance) {
              if (instance instanceof UISWTInstance) {
                swtInstance = (UISWTInstance)instance;
View Full Code Here

Examples of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

  public void initialize(final PluginInterface pluginInterface) {
    this.pluginInterface = pluginInterface;
    pi=pluginInterface;
    UIManager  ui_manager = pluginInterface.getUIManager();
    BasicPluginConfigModel config_model = ui_manager.createBasicPluginConfigModel( "plugins", "plugin.stuffer");

    config_model.addBooleanParameter2("stuffer_military_time","stuffer.military.time",false);
    config_model.addBooleanParameter2("stuffer_auto_open","stuffer.auto.open",true);

    config_getter = pluginInterface.getPluginconfig();

    //initialize strings
    areRulesPaused = false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.