Package org.gudy.azureus2.plugins.ui.model

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


      // slip the non-standard "plugins" initialisation inbetween the internal ones
      // and the plugin ones so plugin ones can be children of it
     
      boolean  plugin_section = i >= internalSections.length;
     
      ConfigSection section = pluginSections.get(i);
     
      if (section instanceof ConfigSectionSWT || section instanceof UISWTConfigSection ) {
        String name;
        try {
          name = section.configSectionGetName();
         } catch (Exception e) {
           Logger.log(new LogEvent(LOGID, "A ConfigSection plugin caused an "
              + "error while trying to call its "
              + "configSectionGetName function", e));
          name = "Bad Plugin";
        }

         String  section_key = name;
        
         if ( plugin_section ){
             // if resource exists without prefix then use it as plugins don't
             // need to start with the prefix
          
           if ( !MessageText.keyExists(section_key)){
            
             section_key = sSectionPrefix + name;
           }
          
         }else{
          
           section_key = sSectionPrefix + name;
         }
        
         String  section_name = MessageText.getString( section_key );
        
         try {
          TreeItem treeItem;
          String location = section.configSectionGetParentSection();
 
          if ( location.length() == 0 || location.equalsIgnoreCase(ConfigSection.SECTION_ROOT)){
            //int position = findInsertPointFor(section_name, tree);
            //if ( position == -1 ){
              treeItem = new TreeItem(tree, SWT.NULL);
View Full Code Here


  private void ensureSectionBuilt(TreeItem treeSection, boolean recreateIfAlreadyThere) {
    ScrolledComposite item = (ScrolledComposite)treeSection.getData("Panel");

    if (item != null) {
     
      ConfigSection configSection = (ConfigSection)treeSection.getData("ConfigSectionSWT");
     
      if (configSection != null) {
       
        Control previous = item.getContent();
        if (previous instanceof Composite) {
          if (!recreateIfAlreadyThere) {
            return;
          }
          configSection.configSectionDelete();
          sectionsCreated.remove(configSection);     
          Utils.disposeComposite((Composite)previous,true);
        }
       
        Composite c;
View Full Code Here

   
    int userMode = COConfigurationManager.getIntParameter("User Mode");
    int maxUsermode = 0;
    try
    {
      ConfigSection sect = sections.get(section);
      if (sect instanceof UISWTConfigSection)
      {
        maxUsermode = ((UISWTConfigSection) sect).maxUserMode();
      }
    } catch (Error e)
View Full Code Here

   
    for (int i=0;i<items.length;i++){
     
      TreeItem  item = items[i];
             
      ConfigSection section = (ConfigSection)item.getData("ConfigSectionSWT");
       
      if ( section != null && section.getClass() == config_section_class ){
         
        tree.setSelection( new TreeItem[]{ item });
       
        showSection( item );
       
View Full Code Here

  public BasicPluginConfigModel
  createBasicPluginConfigModel(
    String    parent_section,
    String    section_name )
  {
    final BasicPluginConfigModel  model = new BasicPluginConfigModelImpl( this, parent_section, section_name );
   
    try{
        class_mon.enter();
   
      configModels.add(model);
View Full Code Here

  initStage(
    int  num )
  {
    if ( num == 1 ){
     
      BasicPluginConfigModel  config = getConfigModel();
     
      test_param = config.addHyperlinkParameter2( "rss.internal.test.url", "" );
     
      test_param.setEnabled( isPluginEnabled());
    }
  }
View Full Code Here

        }
      });
   
    updateLocale(lu);
   
    BasicPluginConfigModel config = plugin_interface.getUIManager().createBasicPluginConfigModel( "Views.plugins." + VIEW_ID + ".title" );
     
      // enabled

    enabled_param = config.addBooleanParameter2( "azbuddy.enabled", "azbuddy.enabled", false );
       
      // nickname

    nick_name_param = config.addStringParameter2( "azbuddy.nickname", "azbuddy.nickname", "" );

    nick_name_param.setGenerateIntermediateEvents( false );
   
    nick_name_param.addListener(
        new ParameterListener()
        {
          public void
          parameterChanged(
            Parameter  param )
          {
            updateNickName( nick_name_param.getValue());
          }
        });
   
      // online status

    String[]  os_values   = STATUS_VALUES;
    String[]  os_labels  = STATUS_STRINGS;
   
    online_status_param = config.addStringListParameter2(
        "azbuddy.online_status", "azbuddy.online_status",
        os_values,
        os_labels,
        os_values[0] );
       
    online_status_param.addListener(
        new ParameterListener()
        {
          public void
          parameterChanged(
            Parameter  param )
          {
             int status = Integer.parseInt( online_status_param.getValue());
            
             updateOnlineStatus( status );
          }
        });
   
    online_status_param.setVisible( SUPPORT_ONLINE_STATUS  ); // If we add this then use proper message texts in the STATUS_STRINGS
   
      // protocol speed
   
    final IntParameter  protocol_speed = config.addIntParameter2( "azbuddy.protocolspeed", "azbuddy.protocolspeed", 32 );
   
    protocol_speed.setMinimumRequiredUserMode( Parameter.MODE_ADVANCED );
   
    inbound_limit = protocol_speed.getValue()*1024;
   
    protocol_speed.addListener(
        new ParameterListener()
        {
          public void
          parameterChanged(
            Parameter  param )
          {
            inbound_limit = protocol_speed.getValue()*1024;
          }
        });
   
      // chat notifications
   
    enable_chat_notifications = config.addBooleanParameter2( "azbuddy.enable_chat_notif", "azbuddy.enable_chat_notif", true );
   
      // default published cats
   
    cat_pub = config.addStringParameter2( "azbuddy.enable_cat_pub", "azbuddy.enable_cat_pub", "" );
   
    cat_pub.setGenerateIntermediateEvents( false );
   
    setPublicCats( cat_pub.getValue(), false );
   
View Full Code Here

       
    logger = plugin_interface.getLogger().getChannel( "NetStatus" );
   
    logger.setDiagnostic();
       
    BasicPluginConfigModel config = plugin_interface.getUIManager().createBasicPluginConfigModel( "Views.plugins." + VIEW_ID + ".title" );
   
    ping_target = config.addStringParameter2( "plugin.aznetstatus.pingtarget", "plugin.aznetstatus.pingtarget", "www.google.com" );
   
    if ( Constants.isCVSVersion()){
     
      test_address = config.addStringParameter2( "plugin.aznetstatus.test_address", "plugin.aznetstatus.test_address", "" );
 
      test_button = config.addActionParameter2( "test", "test " );
     
      test_button.setEnabled( false );
     
      test_button.addListener(
        new ParameterListener()
View Full Code Here

    PluginInterface default_pi = PluginInitializer.getDefaultInterface();
   
    final UIManager  ui_manager = default_pi.getUIManager();
   
    BasicPluginConfigModel configModel = ui_manager.createBasicPluginConfigModel(
        ConfigSection.SECTION_CONNECTION, "Pairing");

    configModel.addHyperlinkParameter2( "ConfigView.label.please.visit.here", MessageText.getString( "ConfigView.section.connection.pairing.url" ));

    param_enable = configModel.addBooleanParameter2( "pairing.enable", "pairing.enable", false );
   
    String  access_code = readAccessCode();
   
    param_ac_info = configModel.addInfoParameter2( "pairing.accesscode", access_code);
   
    param_status_info   = configModel.addInfoParameter2( "pairing.status.info", "" );
   
    param_last_error  = configModel.addInfoParameter2( "pairing.last.error", "" );
   
    param_view = configModel.addHyperlinkParameter2( "pairing.view.registered", SERVICE_URL + "/web/view?ac=" + access_code);

    if ( access_code.length() == 0 ){
     
      param_view.setEnabled( false );
    }
   
    final ActionParameter ap = configModel.addActionParameter2( "pairing.ac.getnew", "pairing.ac.getnew.create" );
   
    ap.addListener(
      new ParameterListener()
      {
        public void
        parameterChanged(
          Parameter   param )
        {
          try{
            ap.setEnabled( false );
           
            allocateAccessCode( false );
           
            SimpleTimer.addEvent(
              "PM:enabler",
              SystemTime.getOffsetTime(30*1000),
              new TimerEventPerformer()
              {
                public void
                perform(
                  TimerEvent event )
                {
                  ap.setEnabled( true );
                }
              });
           
          }catch( Throwable e ){
           
            ap.setEnabled( true );
           
            String details = MessageText.getString(
                "pairing.alloc.fail",
                new String[]{ Debug.getNestedExceptionMessage( e )});
           
            ui_manager.showMessageBox(
                "pairing.op.fail",
                "!" + details + "!",
                UIManagerEvent.MT_OK );
          }
        }
      });
   
    LabelParameter  param_e_info = configModel.addLabelParameter2( "pairing.explicit.info" );
   
    param_e_enable = configModel.addBooleanParameter2( "pairing.explicit.enable", "pairing.explicit.enable", false );
   
    param_public_ipv4  = configModel.addStringParameter2( "pairing.ipv4", "pairing.ipv4", "" );
    param_public_ipv6  = configModel.addStringParameter2( "pairing.ipv6", "pairing.ipv6", "" );
    param_host      = configModel.addStringParameter2( "pairing.host", "pairing.host", "" );
   
    LabelParameter spacer = configModel.addLabelParameter2( "blank.resource" );
   
    param_local_ipv4  = configModel.addStringParameter2( "pairing.local.ipv4", "pairing.local.ipv4", "" );
    param_local_ipv6  = configModel.addStringParameter2( "pairing.local.ipv6", "pairing.local.ipv6", "" );

   
    param_public_ipv4.setGenerateIntermediateEvents( false );
    param_public_ipv6.setGenerateIntermediateEvents( false );
    param_host.setGenerateIntermediateEvents( false );
   
    ParameterListener change_listener =
      new ParameterListener()
      {
        public void
        parameterChanged(
          Parameter param )
        {
          updateNeeded();
         
          if ( param == param_enable ){
           
            fireChanged();
          }
        }
      };
     
    param_enable.addListener( change_listener );
    param_e_enable.addListenerchange_listener );
    param_public_ipv4.addListenerchange_listener );
    param_public_ipv6.addListenerchange_listener );
    param_local_ipv4.addListenerchange_listener );
    param_local_ipv6.addListenerchange_listener );
    param_host.addListenerchange_listener );
   
    param_e_enable.addEnabledOnSelection( param_public_ipv4 );
    param_e_enable.addEnabledOnSelection( param_public_ipv6 );
    param_e_enable.addEnabledOnSelection( param_local_ipv4 );
    param_e_enable.addEnabledOnSelection( param_local_ipv6 );
    param_e_enable.addEnabledOnSelection( param_host );
   
    configModel.createGroup(
      "pairing.group.explicit",
      new Parameter[]{
        param_e_info,
        param_e_enable,
        param_public_ipv4, 
View Full Code Here

  initialize(
    PluginInterface  _plugin_interface )
  {
    plugin_interface  = _plugin_interface;
   
    BasicPluginConfigModel  config =
      plugin_interface.getUIManager().createBasicPluginConfigModel( ConfigSection.SECTION_PLUGINS,
          PLUGIN_CONFIGSECTION_ID);
   
    secondary_lookup = config.addBooleanParameter2( "MagnetPlugin.use.lookup.service", "MagnetPlugin.use.lookup.service", true );
   
    MenuItemListener  listener =
      new MenuItemListener()
      {
        public void
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.ui.model.BasicPluginConfigModel

Copyright © 2018 www.massapicom. 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.