Package org.gudy.azureus2.plugins.ui

Examples of org.gudy.azureus2.plugins.ui.UIManager


          runSupport()
          {
            try{
              final AESemaphore done_sem = new AESemaphore( "PluginInstall:fio" );
                                 
              final UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
                 
              new AEThread2( "PluginInstall:fio", true )
                {
                  public void
                  run()
                  {
                    if ( installer.isAlreadyInstalled()){
                                           
                      String details = MessageText.getString(
                          "fileplugininstall.duplicate.desc",
                          new String[]{ installer.getName(), installer.getVersion()});
                     
                      ui_manager.showMessageBox(
                          "fileplugininstall.duplicate.title",
                          "!" + details + "!",
                          UIManagerEvent.MT_OK );
 
                      done_sem.release();
                     
                    }else{
 
                      String details = MessageText.getString(
                          "fileplugininstall.install.desc",
                          new String[]{ installer.getName(), installer.getVersion()});
                                                   
                      long res = ui_manager.showMessageBox(
                          "fileplugininstall.install.title",
                          "!" + details + "!",
                          UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
                     
                      if ( res == UIManagerEvent.MT_YES ){
View Full Code Here


  {
    must_update_once = COConfigurationManager.getBooleanParameter( "pairing.updateoutstanding" );

    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 );
          }
        }
View Full Code Here

            new AEThread2( "PairMsg", true )
            {
              public void
              run()
              {
                UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
               
                if ( ui_manager != null ){
               
                  ui_manager.showMessageBox(
                      "pairing.server.warning.title",
                      "!" + message + "!",
                      UIManagerEvent.MT_OK );
                }
              }
View Full Code Here

        for (Licence licence : licences) {
          fml.licenceAdded(licence);
        }
       

        UIManager ui_manager = pi.getUIManager();

        ui_manager.addUIListener(new UIManagerListener() {
          public void UIDetached(UIInstance instance) {
          }

          public void UIAttached(UIInstance instance) {
            if (!(instance instanceof UISWTInstance)) {
View Full Code Here

       
    dht_data_port = UDPNetworkManager.getSingleton().getUDPNonDataListeningPortNumber();

    log = plugin_interface.getLogger().getTimeStampedChannel(PLUGIN_NAME);
   
    UIManager  ui_manager = plugin_interface.getUIManager();

    final BasicPluginViewModel model =
      ui_manager.createBasicPluginViewModel( PLUGIN_RESOURCE_ID );

    model.setConfigSectionID(PLUGIN_CONFIGSECTION_ID);
   
    BasicPluginConfigModel  config = ui_manager.createBasicPluginConfigModel(ConfigSection.SECTION_PLUGINS, PLUGIN_CONFIGSECTION_ID);
     
    config.addLabelParameter2( "dht.info" );
   
    final BooleanParameter  enabled_param = config.addBooleanParameter2( "dht.enabled", "dht.enabled", true );
   
View Full Code Here

    log = plugin_interface.getLogger().getTimeStampedChannel(PLUGIN_NAME);
   
    ta_networks   = plugin_interface.getTorrentManager().getAttribute( TorrentAttribute.TA_NETWORKS );
    ta_peer_sources = plugin_interface.getTorrentManager().getAttribute( TorrentAttribute.TA_PEER_SOURCES );

    UIManager  ui_manager = plugin_interface.getUIManager();

    model =
      ui_manager.createBasicPluginViewModel( PLUGIN_RESOURCE_ID );
   
    model.setConfigSectionID(PLUGIN_CONFIGSECTION_ID);
   
    BasicPluginConfigModel  config =
      ui_manager.createBasicPluginConfigModel( ConfigSection.SECTION_PLUGINS,
          PLUGIN_CONFIGSECTION_ID);
     
    track_normal_when_offline = config.addBooleanParameter2( "dhttracker.tracknormalwhenoffline", "dhttracker.tracknormalwhenoffline", TRACK_NORMAL_DEFAULT );

    track_limited_when_online = config.addBooleanParameter2( "dhttracker.tracklimitedwhenonline", "dhttracker.tracklimitedwhenonline", TRACK_LIMITED_DEFAULT );
View Full Code Here

    download_manager = pi.getDownloadManager();

    // Create a configModel for StartStopRules
    // We always need to do this in order to set up configuration defaults
    UIManager manager = pi.getUIManager();
   
    // TODO: don't name it Q
    final BasicPluginConfigModel configModel = manager.createBasicPluginConfigModel(
        ConfigSection.SECTION_ROOT, "Q");
    setupConfigModel(configModel);

    pi.addListener(new PluginListener() {
      public void initializationComplete() {}
View Full Code Here

       
        if ( existing == null ){
         
          if ( warn_user ){
           
            UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
     
            String details = MessageText.getString(
                "device.import.desc",
                new String[]{ device.getName()});
           
            long res = ui_manager.showMessageBox(
                "device.import.title",
                "!" + details + "!",
                UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
           
            if ( res != UIManagerEvent.MT_YES ){ 
           
              return;
            }
          }
         
          addDevice( device, false );
         
        }else{
         
          if ( warn_user ){
           
            UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
           
            String details = MessageText.getString(
                "device.import.dup.desc",
                new String[]{ existing.getName()});
           
            ui_manager.showMessageBox(
                "device.import.dup.title",
                "!" + details + "!",
                UIManagerEvent.MT_OK );
          }
         
View Full Code Here

       
        if ( existing.sameLogicAs( engine )){
         
          if ( warn_user ){
           
            UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
           
            String details = MessageText.getString(
                "metasearch.addtemplate.dup.desc",
                new String[]{ engine.getName() });
           
            ui_manager.showMessageBox(
                "metasearch.addtemplate.dup.title",
                "!" + details + "!",
                UIManagerEvent.MT_OK );
          }
         
          return( existing );
        }
      }else{
                 
        try{           
          Engine[] engines = meta_search.getEngines( false, false );
           
          for ( Engine e: engines ){
             
            if ( e.sameLogicAs( engine )){
               
              return( e );
            }
          }
        }catch( Throwable e ){
         
        }
      }
     
      if ( warn_user ){
       
        UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
        String details = MessageText.getString(
            "metasearch.addtemplate.desc",
            new String[]{ engine.getName() });
       
        long res = ui_manager.showMessageBox(
            "metasearch.addtemplate.title",
            "!" + details + "!",
            UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
       
        if ( res != UIManagerEvent.MT_YES ){
         
          throw( new MetaSearchException( "User declined the template" ));
        }
      }
        // if local template then we try to use the id as is otherwise we emsure that
        // it is a local one
     
      if ( id >= 0 && id < Integer.MAX_VALUE ){
       
        id = getLocalTemplateID();
       
        engine.setId( id );
      }
     
      engine.setSource( Engine.ENGINE_SOURCE_LOCAL );
     
      engine.setSelectionState( Engine.SEL_STATE_MANUAL_SELECTED );
     
      meta_search.addEngine( engine );
     
      if ( warn_user ){
       
        UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
        String details = MessageText.getString(
            "metasearch.addtemplate.done.desc",
            new String[]{ engine.getName() });
       
        ui_manager.showMessageBox(
            "metasearch.addtemplate.done.title",
            "!" + details + "!",
            UIManagerEvent.MT_OK );
      }
     
      return( engine );
     
    }catch( Throwable e ){
     
      if ( warn_user ){
       
        UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
        String details = MessageText.getString(
            "metasearch.addtemplate.failed.desc",
            new String[]{ Debug.getNestedExceptionMessage(e) });
       
        ui_manager.showMessageBox(
            "metasearch.addtemplate.failed.title",
            "!" + details + "!",
            UIManagerEvent.MT_OK );
      }
     
View Full Code Here

         
          if ( existing != null && existing.isSubscribed()){
           
            if ( warn_user ){
             
              UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
             
              String details = MessageText.getString(
                  "subscript.add.dup.desc",
                  new String[]{ existing.getName()});
             
              ui_manager.showMessageBox(
                  "subscript.add.dup.title",
                  "!" + details + "!",
                  UIManagerEvent.MT_OK );
            }
           
            selectSubscription( existing );
           
            return( existing );
           
          }else{
           
            if ( warn_user ){
             
              UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
              String details = MessageText.getString(
                  "subscript.add.desc",
                  new String[]{ name });
             
              long res = ui_manager.showMessageBox(
                  "subscript.add.title",
                  "!" + details + "!",
                  UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
             
              if ( res != UIManagerEvent.MT_YES ){ 
             
                log_errors = false;
               
                throw( new SubscriptionException( "User declined addition" ));
              }
            }
           
            if ( existing == null ){
         
              SubscriptionImpl new_subs = (SubscriptionImpl)createSingletonRSSSupport( name, url, is_public, check_interval_mins, SubscriptionImpl.ADD_TYPE_IMPORT, true );
                                 
              log( "Imported new singleton subscription: " + new_subs.getString());
                 
              return( new_subs );
             
            }else{
             
              existing.setSubscribed( true );
             
              selectSubscription( existing );
             
              return( existing );
            }
          }
        }else{
         
          SubscriptionBodyImpl body = new SubscriptionBodyImpl( this, map );
             
          SubscriptionImpl existing = getSubscriptionFromSID( body.getShortID());
         
          if ( existing != null && existing.isSubscribed()){
         
            if ( existing.getVersion() >= body.getVersion()){
             
              log( "Not upgrading subscription: " + existing.getString() + " as supplied (" +  body.getVersion() + ") is not more recent than existing (" + existing.getVersion() + ")");
             
              if ( warn_user ){
               
                UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
               
                String details = MessageText.getString(
                    "subscript.add.dup.desc",
                    new String[]{ existing.getName()});
               
                ui_manager.showMessageBox(
                    "subscript.add.dup.title",
                    "!" + details + "!",
                    UIManagerEvent.MT_OK );
              }
                // we have a newer one, ignore
             
              selectSubscription( existing );
             
              return( existing );
             
            }else{
             
              if ( warn_user ){
               
                UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
                String details = MessageText.getString(
                    "subscript.add.upgrade.desc",
                    new String[]{ existing.getName()});
               
                long res = ui_manager.showMessageBox(
                    "subscript.add.upgrade.title",
                    "!" + details + "!",
                    UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
               
                if ( res != UIManagerEvent.MT_YES ){ 
               
                  throw( new SubscriptionException( "User declined upgrade" ));
                }
              }
             
              log( "Upgrading subscription: " + existing.getString());
     
              existing.upgrade( body );
             
              saveConfig();
             
              subscriptionUpdated();
             
              return( existing );
            }
          }else{
           
            SubscriptionImpl new_subs = new SubscriptionImpl( this, body, SubscriptionImpl.ADD_TYPE_IMPORT, true );
     
            if ( warn_user ){
             
              UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
              String details = MessageText.getString(
                  "subscript.add.desc",
                  new String[]{ new_subs.getName()});
             
              long res = ui_manager.showMessageBox(
                  "subscript.add.title",
                  "!" + details + "!",
                  UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
             
              if ( res != UIManagerEvent.MT_YES ){ 
             
                throw( new SubscriptionException( "User declined addition" ));
              }
            }
           
            log( "Imported new subscription: " + new_subs.getString());
           
            if ( existing != null ){
             
              existing.remove();
            }
           
            new_subs = addSubscription( new_subs );
           
            return( new_subs );
          }
        }
      }catch( Throwable e ){
       
        throw( new SubscriptionException( "Subscription import failed", e ));
      }
    }catch( SubscriptionException e ){
     
      if ( warn_user && log_errors ){
       
        UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
       
        String details = MessageText.getString(
            "subscript.import.fail.desc",
            new String[]{ Debug.getNestedExceptionMessage(e)});
       
        ui_manager.showMessageBox(
            "subscript.import.fail.title",
            "!" + details + "!",
            UIManagerEvent.MT_OK );
      }
     
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.ui.UIManager

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.