Package org.gudy.azureus2.plugins.ui.config

Examples of org.gudy.azureus2.plugins.ui.config.BooleanParameter


      for (int i=0;i<items.size();i++){
       
        ShareItem  item = (ShareItem)items.get(i);
       
          try{
            Torrent  t = item.getTorrent();
           
            TrackerTorrent  tracker_torrent = tracker.getTorrent( t );
           
            Download  download = dm.getDownload( t );
           
View Full Code Here


 
    PluginInterface pi = PluginInitializer.getDefaultInterface();
     
    org.gudy.azureus2.plugins.download.DownloadManager  dm     = pi.getDownloadManager();
     
    Tracker      tracker = pi.getTracker();
     

      for (int i=0;i<items.size();i++){
       
        ShareItem  item = (ShareItem)items.get(i);
       
          try{
            Torrent  t = item.getTorrent();
           
            TrackerTorrent  tracker_torrent = tracker.getTorrent( t );
           
            Download  download = dm.getDownload( t );
           
            if ( tracker_torrent == null || download == null ){
                             
View Full Code Here

        ShareItem  item = (ShareItem)items.get(i);
       
          try{
            Torrent  t = item.getTorrent();
           
            TrackerTorrent  tracker_torrent = tracker.getTorrent( t );
           
            Download  download = dm.getDownload( t );
           
            if ( tracker_torrent == null || download == null ){
                             
              continue;
            }
           
            int  dl_state = download.getState();
           
            if (   dl_state == Download.ST_ERROR ){
             
            }else if ( dl_state != Download.ST_STOPPED ){
             
              if ( do_stop ){
               
                try{
                  download.stop();
                }catch( Throwable e ){
                }
               
                try{
                  tracker_torrent.stop();
                }catch( Throwable e ){
                }
              }
             
            }else{
             
              if ( !do_stop ){
               
                try{
                  download.restart();
                }catch( Throwable e ){
                }
               
                try{
                  tracker_torrent.start();
                }catch( Throwable e ){
                }
              }
            }
          }catch( Throwable e ){
View Full Code Here

          TrackerWebPageRequestImpl  request = new TrackerWebPageRequestImpl( tracker, TrackerWCHelper.this, external_request );
          TrackerWebPageResponseImpl  reply   = new TrackerWebPageResponseImpl( request );
     
          for (int i=0;i<generators.size();i++){
     
            TrackerWebPageGenerator  generator;
     
            try{
              this_mon.enter();
     
              if ( i >= generators.size()){
     
                break;
              }
     
              generator = (TrackerWebPageGenerator)generators.get(i);
     
            }finally{
     
              this_mon.exit();
            }
     
            if ( generator.generate( request, reply )){
     
              reply.complete();
     
              return( true );
            }
View Full Code Here

              MessageText.getString(up_menu
                  ? "MyTorrentsView.dialog.setNumber.upload"
                  : "MyTorrentsView.dialog.setNumber.download")
            });

        entryWindow.prompt(new UIInputReceiverListener() {
          public void UIInputReceiverClosed(UIInputReceiver entryWindow) {
            if (!entryWindow.hasSubmittedInput()) {
              return;
            }
            String sReturn = entryWindow.getSubmittedInput();
View Full Code Here

    itemPositionManual.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow(
            "MyTorrentsView.dialog.setPosition.title",
            "MyTorrentsView.dialog.setPosition.text");
        entryWindow.prompt(new UIInputReceiverListener() {
          public void UIInputReceiverClosed(UIInputReceiver entryWindow) {
            if (!entryWindow.hasSubmittedInput()) {
              return;
            }
            String sReturn = entryWindow.getSubmittedInput();
View Full Code Here

    SimpleTextEntryWindow text_entry = new SimpleTextEntryWindow();
    text_entry.setTitle(msg_key_prefix + "title");
    text_entry.setMessage(msg_key_prefix + "message");
    text_entry.setPreenteredText(suggested, false);
    text_entry.setMultiLine(true);
    text_entry.prompt(new UIInputReceiverListener() {
      public void UIInputReceiverClosed(UIInputReceiver text_entry) {
        if (text_entry.hasSubmittedInput()) {
          String value = text_entry.getSubmittedInput();
          final String value_to_set = (value.length() == 0) ? null : value;
          DMTask task = new DMTask(dms) {
View Full Code Here

  private static void changePriorityManual(final Object[] datasources) {

    SimpleTextEntryWindow entryWindow = new SimpleTextEntryWindow(
        "FilesView.dialog.priority.title",
        "FilesView.dialog.priority.text");
    entryWindow.prompt(new UIInputReceiverListener() {
      public void UIInputReceiverClosed(UIInputReceiver entryWindow) {
        if (!entryWindow.hasSubmittedInput()) {
          return;
        }
        String sReturn = entryWindow.getSubmittedInput();
View Full Code Here

    BuddyPlugin          _plugin,
    BasicPluginConfigModel    _config )
  {
    plugin    = _plugin;
   
    final BooleanParameter te = _config.addBooleanParameter2("azbuddy.tracker.enabled", "azbuddy.tracker.enabled", true );
   
    tracker_enabled = te.getValue();
   
    te.addListener(
      new ParameterListener()
      {
        public void
        parameterChanged(
          Parameter param )
        {
          tracker_enabled = te.getValue();
         
          checkEnabledState();
        }
      });
   
View Full Code Here

    config.addLabelParameter2( "Plugin.localtracker.networks.info" );
   
    final StringParameter subnets = config.addStringParameter2( "Plugin.localtracker.networks", "Plugin.localtracker.networks", "" );

    final BooleanParameter include_wellknown = config.addBooleanParameter2( "Plugin.localtracker.wellknownlocals", "Plugin.localtracker.wellknownlocals", true );
   
    config.addLabelParameter2( "Plugin.localtracker.autoadd.info" );
   
    final StringParameter autoadd = config.addStringParameter2( "Plugin.localtracker.autoadd", "Plugin.localtracker.autoadd", "" );
   
    /*
     * actually these parameters affect LAN detection as a whole, not just the local tracker,
     * so leave them enabled...
     *
    enabled.addEnabledOnSelection( lp1 );
    enabled.addEnabledOnSelection( subnets );
    enabled.addEnabledOnSelection( lp2 );
    enabled.addEnabledOnSelection( autoadd );
    */
   
    final BasicPluginViewModel  view_model =
      plugin_interface.getUIManager().createBasicPluginViewModel( "Plugin.localtracker.name" );

    view_model.setConfigSectionID(PLUGIN_CONFIGSECTION_ID);
    view_model.getActivity().setVisible( false );
    view_model.getProgress().setVisible( false );
   
    log.addListener(
        new LoggerChannelListener()
        {
          public void
          messageLogged(
            int    type,
            String  content )
          {
            view_model.getLogArea().appendText( content + "\n" );
          }
         
          public void
          messageLogged(
            String    str,
            Throwable  error )
          {
            if ( str.length() > 0 ){
              view_model.getLogArea().appendText( str + "\n" );
            }
           
            StringWriter sw = new StringWriter();
           
            PrintWriter  pw = new PrintWriter( sw );
           
            error.printStackTrace( pw );
           
            pw.flush();
           
            view_model.getLogArea().appendText( sw.toString() + "\n" );
          }
        });
   
    plugin_start_time = plugin_interface.getUtilities().getCurrentSystemTime();

    // Assume we have a core, since this is a plugin
    instance_manager  = AzureusCoreFactory.getSingleton().getInstanceManager();
   
    instance_manager.addListener( this );
   
    plugin_interface.getPluginconfig().addListener(
        new PluginConfigListener()
        {
          public void
          configSaved()
          {
            processSubNets( subnets.getValue(),include_wellknown.getValue() );
            processAutoAdd( autoadd.getValue());
          }
        });
     
    processSubNets(subnets.getValue(), include_wellknown.getValue());
    processAutoAdd(autoadd.getValue());

    final DelayedTask dt = plugin_interface.getUtilities().createDelayedTask(new Runnable()
      {
        public void
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.ui.config.BooleanParameter

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.