Package org.gudy.azureus2.pluginsimpl.local.ui.menus

Examples of org.gudy.azureus2.pluginsimpl.local.ui.menus.MenuItemImpl


   *
   * @since 3.0.0.7
   */
  private boolean nextUpdate() {
    if (iterDownloaders.hasNext()) {
      ResourceDownloader downloader = (ResourceDownloader) iterDownloaders.next();
      downloader.addListener(this);
      downloader.asyncDownload();
      return true;
    }
    return false;
  }
View Full Code Here


              }
             
              setProgress( 0 );
             
              downloader.addListener(
                new ResourceDownloaderAdapter()
                {
                  public void
                  reportPercentComplete(
                    ResourceDownloader  downloader,
                    int          percentage )
View Full Code Here

    props         = new propertyWrapper(_props );
    pluginDir       = _pluginDir;
    config         = new PluginConfigImpl(this,pluginConfigKey);
    given_plugin_id      = _plugin_id;
    plugin_version    = _plugin_version;
    ipc_interface      = new IPCInterfaceImpl( initialiser, plugin );
    state                 = new PluginStateImpl(this, initialiser);
   
    boolean verified   = false;
    boolean bad    = false;
   
View Full Code Here

  }
 
  public IPFilter
  getIPFilter()
  {
    return( new IPFilterImpl());
  }
View Full Code Here

 
  public Logger getLogger()
  {
    if ( logger == null ){
     
      logger = new LoggerImpl( this );
    }
   
    return( logger );
  }
View Full Code Here

    else {
      plug_msg = new MessageAdapter( message )//core created
    }
   
    RawMessage raw_plug = plug_encoder.encodeMessage( plug_msg );
    return new com.aelitis.azureus.core.networkmanager.RawMessage[]{ new RawMessageAdapter( raw_plug )};
  }
View Full Code Here

    return config;
  }


  public PluginConfigUIFactory getPluginConfigUIFactory() {
    return new PluginConfigUIFactoryImpl(config,pluginConfigKey);
  }
View Full Code Here

  public static void addPluginMenuItems(Composite composite,
      MenuItem[] items, Menu parent,  boolean prev_was_separator,
      boolean enable_items, PluginMenuController controller) {
   
    for (int i = 0; i < items.length; i++) {
      final MenuItemImpl az_menuitem = (MenuItemImpl) items[i];
     
      controller.notifyFillListeners(az_menuitem);
      if (!az_menuitem.isVisible()) {continue;}
     
      final int style = az_menuitem.getStyle();
      final int swt_style;

      boolean this_is_separator = false;

      // Do we have any children? If so, we override any manually defined
      // style.
      boolean is_container = false;
     

      if (style == TableContextMenuItem.STYLE_MENU) {
        swt_style = SWT.CASCADE;
        is_container = true;
      } else if (style == TableContextMenuItem.STYLE_PUSH) {
        swt_style = SWT.PUSH;
      } else if (style == TableContextMenuItem.STYLE_CHECK) {
        swt_style = SWT.CHECK;
      } else if (style == TableContextMenuItem.STYLE_RADIO) {
        swt_style = SWT.RADIO;
      } else if (style == TableContextMenuItem.STYLE_SEPARATOR) {
        this_is_separator = true;
        swt_style = SWT.SEPARATOR;
      } else {
        swt_style = SWT.PUSH;
      }

      final org.eclipse.swt.widgets.MenuItem menuItem = new org.eclipse.swt.widgets.MenuItem(
          parent, swt_style);

      if (swt_style == SWT.SEPARATOR) {continue;}
     
      if (prev_was_separator && this_is_separator) {continue;} // Skip contiguous separators
      if (this_is_separator && i == items.length - 1) {continue;} // Skip trailing separator

      prev_was_separator = this_is_separator;

      if (enable_items) {

        if (style == TableContextMenuItem.STYLE_CHECK
            || style == TableContextMenuItem.STYLE_RADIO) {

          Boolean selection_value = (Boolean) az_menuitem.getData();
          if (selection_value == null) {
            throw new RuntimeException(
                "MenuItem with resource name \""
                    + az_menuitem.getResourceKey()
                    + "\" needs to have a boolean value entered via setData before being used!");
          }
          menuItem.setSelection(selection_value.booleanValue());
        }
      }
     
      final Listener main_listener = controller.makeSelectionListener(az_menuitem);
      menuItem.addListener(SWT.Selection, new Listener() {
        public void handleEvent(Event e) {
          if (az_menuitem.getStyle() == MenuItem.STYLE_CHECK
              || az_menuitem.getStyle() == MenuItem.STYLE_RADIO) {
            if (!menuItem.isDisposed()) {
              az_menuitem.setData(new Boolean(menuItem.getSelection()));
            }
          }
          main_listener.handleEvent(e);
        }
      });
     
      if (is_container) {
        Menu this_menu = new Menu(composite.getShell(), SWT.DROP_DOWN);
        menuItem.setMenu(this_menu);
        addPluginMenuItems(composite, az_menuitem.getItems(), this_menu, false,
            enable_items, controller);
      }
     
      String custom_title = az_menuitem.getText();
      menuItem.setText(custom_title);

      Graphic g = az_menuitem.getGraphic();
      if (g instanceof UISWTGraphic) {
        Utils.setMenuItemImage(menuItem, ((UISWTGraphic) g).getImage());
      }

      menuItem.setEnabled(enable_items && az_menuitem.isEnabled());

    }
  }
View Full Code Here

    public MenuItemPluginMenuControllerImpl(Object[] o) {
      this.objects = o;
    }

    public Listener makeSelectionListener(MenuItem menu_item) {
      final MenuItemImpl mii = (MenuItemImpl) menu_item;
      return new Listener() {
        public void handleEvent(Event e) {
          mii.invokeListenersMulti(objects);
        }
      };
    }
View Full Code Here

  {
    boolean  handled = false;
   
    for (int i=0;i<listeners.size();i++){
     
      PooledByteBuffer  buffer = new PooledByteBufferImpl(message.getPayload());
     
      try{
        ((GenericMessageConnectionListener)listeners.get(i)).receive( this, buffer );
       
        handled = true;
       
      }catch( Throwable f ){
       
        buffer.returnToPool();
       
        if ( !( f instanceof MessageException )){
       
          Debug.printStackTrace(f);
        }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.pluginsimpl.local.ui.menus.MenuItemImpl

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.