felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r391291 - in /incubator/felix/trunk: ./ org.apache.felix.shell.gui/ org.apache.felix.shell.gui/src/ org.apache.felix.shell.gui/src/main/ org.apache.felix.shell.gui/src/main/java/ org.apache.felix.shell.gui/src/main/java/org/ org.apache.feli...
Date Tue, 04 Apr 2006 12:42:48 GMT
Author: rickhall
Date: Tue Apr  4 05:42:45 2006
New Revision: 391291

URL: http://svn.apache.org/viewcvs?rev=391291&view=rev
Log:
Added Shell GUI bundle subproject and modified the main pom.xml file.

Added:
    incubator/felix/trunk/org.apache.felix.shell.gui/   (with props)
    incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml   (with props)
    incubator/felix/trunk/org.apache.felix.shell.gui/src/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java
  (with props)
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java
  (with props)
    incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java
  (with props)
Modified:
    incubator/felix/trunk/pom.xml

Propchange: incubator/felix/trunk/org.apache.felix.shell.gui/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Tue Apr  4 05:42:45 2006
@@ -0,0 +1,17 @@
+classes
+target
+*.log
+*.ipr
+*.iws
+*.iml
+lib
+bundle
+dist
+.project
+.classpath
+bin
+build
+.settings
+.wtpmodules
+.deployables
+

Added: incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml?rev=391291&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml (added)
+++ incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml Tue Apr  4 05:42:45 2006
@@ -0,0 +1,41 @@
+<project>
+  <parent>
+    <groupId>org.apache.felix</groupId>
+    <artifactId>felix</artifactId>
+    <version>0.8.0-SNAPSHOT</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <packaging>osgi-bundle</packaging>
+  <name>Apache Felix Shell GUI</name>
+  <artifactId>org.apache.felix.shell.gui</artifactId>
+  <dependencies>
+    <dependency>
+      <groupId>${pom.groupId}</groupId>
+      <artifactId>org.osgi.core</artifactId>
+      <version>${pom.version}</version>
+      <scope>provided</scope>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.felix.plugins</groupId>
+        <artifactId>maven-osgi-plugin</artifactId>
+        <version>${pom.version}</version>
+        <extensions>true</extensions>
+        <configuration>
+          <osgiManifest>
+            <bundleName>ShellGUI</bundleName>
+            <bundleDescription>A simple plugin-oriented GUI shell.</bundleDescription>
+            <bundleActivator>org.apache.felix.shell.gui.impl.Activator</bundleActivator>
+            <bundleDocUrl>http://oscar-osgi.sf.net/obr2/shellgui/</bundleDocUrl>
+            <bundleSource>http://oscar-osgi.sf.net/obr2/shellgui/org.apache.felix.shell.gui-src.jar</bundleSource>
+            <bundleSymbolicName>org.apache.felix.shell.gui</bundleSymbolicName>
+            <importPackage>org.osgi.framework</importPackage>
+            <exportPackage>org.apache.felix.shell.gui; specification-version="1.0.0"</exportPackage>
+          </osgiManifest>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Propchange: incubator/felix/trunk/org.apache.felix.shell.gui/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java?rev=391291&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java
(added)
+++ incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java
Tue Apr  4 05:42:45 2006
@@ -0,0 +1,57 @@
+/*
+ * Oscar Shell GUI
+ * Copyright (c) 2004, Richard S. Hall
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of the ungoverned.org nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contact: Richard S. Hall (heavy@ungoverned.org)
+ * Contributor(s):
+ *
+**/
+package org.apache.felix.shell.gui;
+
+import java.awt.Component;
+
+/**
+ * A simple plugin interface for the GUI shell bundle.
+**/
+public interface Plugin
+{
+    /**
+     * Returns the name of the plugin.
+     * @return the name of the plugin.
+    **/
+    public String getName();
+    
+    /**
+     * Returns the GUI associated with the plugin; this method should
+     * always return the same GUI instance when it is invoked.
+     * @return the GUI associated with the plugin.
+    **/
+    public Component getGUI();
+}
\ No newline at end of file

Propchange: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/Plugin.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java?rev=391291&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java
(added)
+++ incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java
Tue Apr  4 05:42:45 2006
@@ -0,0 +1,265 @@
+/*
+ * Oscar Shell GUI
+ * Copyright (c) 2004, Richard S. Hall
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of the ungoverned.org nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contact: Richard S. Hall (heavy@ungoverned.org)
+ * Contributor(s):
+ *
+**/
+package org.apache.felix.shell.gui.impl;
+
+import java.awt.BorderLayout;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+import javax.swing.event.EventListenerList;
+
+import org.osgi.framework.*;
+import org.apache.felix.shell.gui.Plugin;
+
+public class Activator implements BundleActivator
+{
+    private BundleContext m_context = null;
+    private List m_pluginList = null;
+    private EventListenerList m_listenerList = null;
+    private JFrame m_frame = null;
+
+    public static final String PLUGIN_LIST_PROPERTY = "pluginList";
+
+    public Activator()
+    {
+        m_pluginList = new ArrayList();
+        m_listenerList = new EventListenerList();
+    }
+
+    public synchronized int getPluginCount()
+    {
+        if (m_pluginList == null)
+        {
+            return 0;
+        }
+        return m_pluginList.size();
+    }
+
+    public synchronized Plugin getPlugin(int i)
+    {
+        if ((i < 0) || (i >= getPluginCount()))
+        {
+            return null;
+        }
+        return (Plugin) m_pluginList.get(i);
+    }
+
+    public synchronized boolean pluginExists(Plugin plugin)
+    {
+        for (int i = 0; i < m_pluginList.size(); i++)
+        {
+            if (m_pluginList.get(i) == plugin)
+            {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    //
+    // Bundle activator methods.
+    //
+
+    public void start(BundleContext context)
+    {
+        m_context = context;
+
+        // Listen for factory service events.
+        ServiceListener sl = new ServiceListener() {
+            public void serviceChanged(ServiceEvent event)
+            {
+                ServiceReference ref = event.getServiceReference();
+                Object svcObj = m_context.getService(ref);
+                if ((event.getType() == ServiceEvent.REGISTERED) &&
+                    (svcObj instanceof Plugin))
+                {
+                    synchronized (Activator.this)
+                    {
+                        // Check for duplicates.
+                        if (!m_pluginList.contains(svcObj))
+                        {
+                            m_pluginList.add(svcObj);
+                            firePropertyChangedEvent(
+                                PLUGIN_LIST_PROPERTY, null, null);
+                        }
+                    }
+                }
+                else if ((event.getType() == ServiceEvent.UNREGISTERING) &&
+                    (svcObj instanceof Plugin))
+                {
+                    synchronized (Activator.this)
+                    {
+                        m_pluginList.remove(svcObj);
+                        firePropertyChangedEvent(
+                            PLUGIN_LIST_PROPERTY, null, null);
+                    }
+                }
+                else
+                {
+                    m_context.ungetService(ref);
+                }
+            }
+        };
+        try
+        {
+            m_context.addServiceListener(sl,
+                "(objectClass="
+                + org.apache.felix.shell.gui.Plugin.class.getName()
+                + ")");
+        }
+        catch (InvalidSyntaxException ex)
+        {
+            System.err.println("ShellGuiActivator: Cannot add service listener.");
+            System.err.println("ShellGuiActivator: " + ex);
+        }
+
+        // Now try to manually initialize the plugin list
+        // since some might already be available.
+        initializePlugins();
+
+        // Create and display the frame.
+        if (m_frame == null)
+        {
+            ShellPanel panel = new ShellPanel(this);
+            m_frame = new JFrame("Oscar GUI Shell");
+            m_frame.getContentPane().setLayout(new BorderLayout());
+            m_frame.getContentPane().add(panel);
+            m_frame.pack();
+            m_frame.setSize(700, 400);
+            m_frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
+            m_frame.addWindowListener(new WindowAdapter() {
+                public void windowClosing(WindowEvent event)
+                {
+                    if (m_context.getBundle().getState() == Bundle.ACTIVE)
+                    {
+                        try
+                        {
+                            m_context.getBundle().stop();
+                        }
+                        catch (Exception ex)
+                        {
+                            System.err.println("ShellGuiActivator: " + ex);
+                        }
+                    }
+                }
+            });
+        }
+
+        m_frame.setVisible(true);
+    }
+
+    private synchronized void initializePlugins()
+    {
+        try
+        {
+            // Get all model services.
+            ServiceReference refs[] = m_context.getServiceReferences(
+                org.apache.felix.shell.gui.Plugin.class.getName(), null);
+            if (refs != null)
+            {
+                // Add model services to list, ignore duplicates.
+                for (int i = 0; i < refs.length; i++)
+                {
+                    Object svcObj = m_context.getService(refs[i]);
+                    if (!m_pluginList.contains(svcObj))
+                    {
+                        m_pluginList.add(svcObj);
+                    }
+                }
+                firePropertyChangedEvent(
+                    PLUGIN_LIST_PROPERTY, null, null);
+            }
+        }
+        catch (Exception ex)
+        {
+            System.err.println("ShellGuiActivator: Error initializing model list.");
+            System.err.println("ShellGuiActivator: " + ex);
+            ex.printStackTrace();
+        }
+    }
+
+    public void stop(BundleContext context)
+    {
+        if (m_frame != null)
+        {
+            m_frame.setVisible(false);
+            m_frame.dispose();
+            m_frame = null;
+        }
+    }
+
+    //
+    // Event methods.
+    //
+
+    public void addPropertyChangeListener(PropertyChangeListener l)
+    {
+        m_listenerList.add(PropertyChangeListener.class, l);
+    }
+
+    public void removeFooListener(PropertyChangeListener l)
+    {
+        m_listenerList.remove(PropertyChangeListener.class, l);
+    }
+
+    protected void firePropertyChangedEvent(String name, Object oldValue, Object newValue)
+    {
+        PropertyChangeEvent event = null;
+
+        // Guaranteed to return a non-null array
+        Object[] listeners = m_listenerList.getListenerList();
+
+        // Process the listeners last to first, notifying
+        // those that are interested in this event
+        for (int i = listeners.length - 2; i >= 0; i -= 2)
+        {
+            if (listeners[i] == PropertyChangeListener.class)
+            {
+                // Lazily create the event:
+                if (event == null)
+                {
+                    event = new PropertyChangeEvent(this, name, oldValue, newValue);
+                }
+                ((PropertyChangeListener) listeners[i + 1]).propertyChange(event);
+            }
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java?rev=391291&view=auto
==============================================================================
--- incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java
(added)
+++ incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java
Tue Apr  4 05:42:45 2006
@@ -0,0 +1,190 @@
+/*
+ * Oscar Shell GUI
+ * Copyright (c) 2004, Richard S. Hall
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ *   * Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *   * Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in
+ *     the documentation and/or other materials provided with the
+ *     distribution.
+ *   * Neither the name of the ungoverned.org nor the names of its
+ *     contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * Contact: Richard S. Hall (heavy@ungoverned.org)
+ * Contributor(s):
+ *
+**/
+package org.apache.felix.shell.gui.impl;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+
+import javax.swing.*;
+import javax.swing.event.*;
+
+import org.apache.felix.shell.gui.Plugin;
+
+public class ShellPanel extends JPanel implements PropertyChangeListener
+{
+    private Activator m_activator = null;
+    private JPanel m_emptyPanel = null;
+    private JList m_pluginList = null;
+    private Plugin m_selectedPlugin = null;
+    private Runnable m_runnable = null;
+
+    public ShellPanel(Activator activator)
+    {
+        m_activator = activator;
+        m_activator.addPropertyChangeListener(this);
+
+        setLayout(new BorderLayout());
+        JScrollPane scroll = null;
+        add(scroll = new JScrollPane(m_pluginList = new JList(new SimpleListModel())), BorderLayout.WEST);
+        scroll.setPreferredSize(new Dimension(150, scroll.getPreferredSize().height));
+        add(m_emptyPanel = new JPanel(), BorderLayout.CENTER);
+
+        createEventListeners();
+    }
+
+    public void propertyChange(PropertyChangeEvent event)
+    {
+        if (event.getPropertyName().equals(Activator.PLUGIN_LIST_PROPERTY))
+        {
+            if (m_runnable == null)
+            {
+                m_runnable = new PropertyChangeRunnable();
+            }
+            SwingUtilities.invokeLater(m_runnable);
+        }
+    }
+
+    private void createEventListeners()
+    {
+        m_pluginList.addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent event)
+            {
+                if (!event.getValueIsAdjusting())
+                {
+                    if (m_pluginList.getSelectedIndex() >= 0)
+                    {
+                        // Remove the current GUI.
+                        if (m_selectedPlugin != null)
+                        {
+                            remove(m_selectedPlugin.getGUI());
+                        }
+                        else
+                        {
+                            remove(m_emptyPanel);
+                        }
+
+                        // Get the selected plugin GUI.
+                        m_selectedPlugin =
+                            m_activator.getPlugin(m_pluginList.getSelectedIndex());
+                        if (m_selectedPlugin != null)
+                        {
+                            // Display the selected plugin GUI.
+                            add(m_selectedPlugin.getGUI(), BorderLayout.CENTER);
+                        }
+                        else
+                        {
+                            // Display the empty panel.
+                            add(m_emptyPanel, BorderLayout.CENTER);
+                        }
+
+                        revalidate();
+                        repaint();
+                    }
+                }
+            }
+        });
+    }
+
+    private class SimpleListModel extends AbstractListModel
+        implements ListDataListener
+    {
+        private SimpleListModel()
+        {
+        }
+
+        public int getSize()
+        {
+            return m_activator.getPluginCount();
+        }
+
+        public Object getElementAt(int index)
+        {
+            return m_activator.getPlugin(index).getName();
+        }
+
+        public void intervalAdded(ListDataEvent event)
+        {
+            fireIntervalAdded(this, event.getIndex0(), event.getIndex1());
+        }
+
+        public void intervalRemoved(ListDataEvent event)
+        {
+            fireIntervalRemoved(this, event.getIndex0(), event.getIndex1());
+        }
+
+        public void contentsChanged(ListDataEvent event)
+        {
+            fireContentsChanged(this, event.getIndex0(), event.getIndex1());
+        }
+
+        public void update()
+        {
+            fireContentsChanged(this, 0, -1);
+        }
+    }
+
+    private class PropertyChangeRunnable implements Runnable
+    {
+        public void run()
+        {
+            ((SimpleListModel) m_pluginList.getModel()).update();
+
+            // Check to see if the selected component has been
+            // removed, if so, then reset the selected component
+            // to be an empty panel.
+            if ((m_selectedPlugin != null) &&
+                !m_activator.pluginExists(m_selectedPlugin))
+            {
+                m_pluginList.clearSelection();
+                remove(m_selectedPlugin.getGUI());
+                m_selectedPlugin = null;
+                add(m_emptyPanel, BorderLayout.CENTER);
+                revalidate();
+                repaint();
+            }
+
+            if ((m_selectedPlugin == null) && (m_activator.getPluginCount() >
0))
+            {
+                m_pluginList.setSelectedIndex(0);
+            }
+        }
+    }
+}
\ No newline at end of file

Propchange: incubator/felix/trunk/org.apache.felix.shell.gui/src/main/java/org/apache/felix/shell/gui/impl/ShellPanel.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/felix/trunk/pom.xml
URL: http://svn.apache.org/viewcvs/incubator/felix/trunk/pom.xml?rev=391291&r1=391290&r2=391291&view=diff
==============================================================================
--- incubator/felix/trunk/pom.xml (original)
+++ incubator/felix/trunk/pom.xml Tue Apr  4 05:42:45 2006
@@ -14,6 +14,7 @@
     <module>org.apache.felix.framework</module>
     <module>org.apache.felix.shell</module>
     <module>org.apache.felix.shell.tui</module>
+    <module>org.apache.felix.shell.gui</module>
     <module>org.apache.felix.daemon</module>
     <module>org.apache.felix.dependencymanager</module>
     <module>org.apache.felix.main</module>



Mime
View raw message