Examples of UIManager


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

    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

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

    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

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

       
        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

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

       
        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

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

         
          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

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

    SubscriptionImpl    subs,
    int            new_version )
  {
    subs.setHighestUserPromptedVersion( new_version );
   
    UIManager ui_manager = StaticUtilities.getUIManager( 120*1000 );
   
    String details = MessageText.getString(
        "subscript.add.upgradeto.desc",
        new String[]{ String.valueOf(new_version), subs.getName()});
   
    long res = ui_manager.showMessageBox(
        "subscript.add.upgrade.title",
        "!" + details + "!",
        UIManagerEvent.MT_YES | UIManagerEvent.MT_NO );
   
    if ( res != UIManagerEvent.MT_YES ){ 
View Full Code Here

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

    }
   
    setWarning();

    PluginInterface pi = PluginInitializer.getDefaultInterface();
    UIManager uim = pi.getUIManager();
   
    final MenuManager menuManager = uim.getMenuManager();
   
    MenuItem menuItem;
   
    menuItem = menuManager.addMenuItem("sidebar." + key,"Subscription.menu.forcecheck");
    menuItem.setText(MessageText.getString("Subscription.menu.forcecheck"));
View Full Code Here

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

      }

      columnsAdded = true;
    }

    UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();

    TableManager tableManager = uiManager.getTableManager();

    tableManager.registerColumn(ClientStatsDataSource.class,
        ColumnCS_Name.COLUMN_ID, new TableColumnCreationListener() {
          public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Name(column);
View Full Code Here

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

    });
  }

  protected static void addHeaderMenu() {
    PluginInterface pi = PluginInitializer.getDefaultInterface();
    UIManager uim = pi.getUIManager();
    MenuManager menuManager = uim.getMenuManager();
    MenuItem menuItem;

    menuItem = menuManager.addMenuItem("sidebar."
        + MultipleDocumentInterface.SIDEBAR_HEADER_TRANSFERS,
        "MyTorrentsView.menu.setCategory.add");
View Full Code Here

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

    return infoLibraryUn;
  }

  private static void addMenuUnwatched(String id) {
    PluginInterface pi = PluginInitializer.getDefaultInterface();
    UIManager uim = pi.getUIManager();
    MenuManager menuManager = uim.getMenuManager();

    MenuItem menuItem = menuManager.addMenuItem("sidebar." + id,
        "v3.activity.button.watchall");
    menuItem.addListener(new MenuItemListener() {
      public void selected(MenuItem menu, Object target) {
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.