You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by ni...@apache.org on 2004/03/02 16:22:10 UTC

cvs commit: avalon-sandbox/ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository RepositoryPlugin.java

niclas      2004/03/02 07:22:10

  Modified:    ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository/views
                        RepositoryView.java
               ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository
                        RepositoryPlugin.java
  Log:
  
  
  Revision  Changes    Path
  1.2       +6 -9      avalon-sandbox/ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository/views/RepositoryView.java
  
  Index: RepositoryView.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository/views/RepositoryView.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- RepositoryView.java	1 Dec 2003 14:16:19 -0000	1.1
  +++ RepositoryView.java	2 Mar 2004 15:22:09 -0000	1.2
  @@ -161,8 +161,7 @@
           {
               public void run()
               {
  -                RepositoryPlugin plugin = RepositoryPlugin.getDefault();
  -                ResourceManager resources = plugin.getResourceManager();
  +                ResourceManager resources = RepositoryPlugin.getResourceManager();
                   String message = resources.getStringResource("USE_PREFERENCES_INSTEAD");
                   showMessage(message);
               }
  @@ -177,8 +176,7 @@
           {
               public void run()
               {
  -                RepositoryPlugin plugin = RepositoryPlugin.getDefault();
  -                ResourceManager resources = plugin.getResourceManager();
  +                ResourceManager resources = RepositoryPlugin.getResourceManager();
                   String message = resources.getStringResource("USE_PREFERENCES_INSTEAD");
                   showMessage(message);
               }
  @@ -192,9 +190,9 @@
           {
               public void run()
               {
  -                    // TODO Double click.
  -        // Not sure what this should do!
  -    showMessage("Not implemented yet!");
  +                // TODO Double click.
  +                // Not sure what this should do!
  +                showMessage("Not implemented yet!");
               }
           };
       }
  @@ -222,8 +220,7 @@
       }
       private void showMessage(String message)
       {
  -        RepositoryPlugin plugin = RepositoryPlugin.getDefault();
  -        ResourceManager resources = plugin.getResourceManager();
  +        ResourceManager resources = RepositoryPlugin.getResourceManager();
           MessageDialog.openInformation(
               m_Viewer.getControl().getShell(),
               "Repository View Message",
  
  
  
  1.4       +1 -44     avalon-sandbox/ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository/RepositoryPlugin.java
  
  Index: RepositoryPlugin.java
  ===================================================================
  RCS file: /home/cvs/avalon-sandbox/ide/org.apache.avalon.ide.eclipse.repository/src/java/org/apache/avalon/ide/eclipse/repository/RepositoryPlugin.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- RepositoryPlugin.java	2 Dec 2003 10:15:17 -0000	1.3
  +++ RepositoryPlugin.java	2 Mar 2004 15:22:09 -0000	1.4
  @@ -46,7 +46,6 @@
          
   import java.util.HashMap;
   
  -import org.apache.avalon.ide.eclipse.repository.plugins.*;
   import org.apache.avalon.ide.repository.RepositoryAgentFactory;
   import org.apache.avalon.ide.repository.RepositoryTypeRegistry;
   import org.apache.avalon.ide.repository.tools.common.SimpleRepositoryRegistry;
  @@ -57,8 +56,7 @@
   import org.eclipse.core.runtime.IExtension;
   import org.eclipse.core.runtime.IExtensionPoint;
   import org.eclipse.core.runtime.IPluginDescriptor;
  -import org.eclipse.core.runtime.IPluginEvent;
  -import org.eclipse.core.runtime.IPluginListener;
  +
   import org.eclipse.core.runtime.IPluginRegistry;
   import org.eclipse.core.runtime.Platform;
   import org.eclipse.ui.plugin.AbstractUIPlugin;
  @@ -69,7 +67,6 @@
    * @author Niclas Hedhman, niclas@hedhman.org
    */
   public class RepositoryPlugin extends AbstractUIPlugin
  -    implements IPluginListener
   {
       //The shared instance.
       private static RepositoryPlugin m_Plugin;
  @@ -88,9 +85,6 @@
           m_Plugin = this;
           m_ResourceManager = new ResourceManager();
           m_RepositoryTypeRegistry = new SimpleRepositoryRegistry();
  -        createHandlers();
  -        
  -        Platform.addPluginListener( this );
       }
   
       public RepositoryTypeRegistry getRepositoryTypeRegistry()
  @@ -134,43 +128,6 @@
                   System.out.println("Found an executable extension: " + object);
               }
          }
  -    }
  -    
  -    public void pluginChanged( IPluginEvent[] event )
  -    {
  -        for( int i=0 ; i < event.length ; i++ )
  -        {
  -            Integer type = new Integer( event[i].getType() );
  -            PluginHandler handler = (PluginHandler) m_PluginHandlers.get( type );
  -            IPluginDescriptor descriptor = event[i].getPluginDescriptor();
  -            try
  -            {
  -                handler.handle( descriptor );
  -            } catch( PluginHandlerException e )
  -            {
  -                // SHOULD-DO Error Handling
  -                e.printStackTrace();
  -                
  -            }
  -        }
  -    }
  -    
  -    private void createHandlers()
  -    {
  -        m_PluginHandlers = new HashMap();
  -        createHandler(IPluginEvent.INSTALLED, new PluginHandlerInstalled(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.RESOLVED, new PluginHandlerResolved(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.STARTED, new PluginHandlerStarted(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.STOPPED, new PluginHandlerStopped(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.UNINSTALLED, new PluginHandlerUninstalled(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.UNRESOLVED, new PluginHandlerUnresolved(m_RepositoryTypeRegistry) );
  -        createHandler(IPluginEvent.UPDATED, new PluginHandlerUpdated(m_RepositoryTypeRegistry) );
  -    }
  -    
  -    private void createHandler( int type, PluginHandler handler )
  -    {
  -        Integer t = new Integer( type );
  -        m_PluginHandlers.put( t, handler );
       }
   }
        
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org