You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tim Moloney (JIRA)" <ji...@apache.org> on 2007/03/08 10:06:24 UTC

[jira] Created: (FELIX-249) Add a shutdown button to the shellGUI

Add a shutdown button to the shellGUI
-------------------------------------

                 Key: FELIX-249
                 URL: https://issues.apache.org/jira/browse/FELIX-249
             Project: Felix
          Issue Type: Improvement
            Reporter: Tim Moloney
            Priority: Trivial


Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (FELIX-249) Add a shutdown button to the shellGUI

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479315 ] 

Richard S. Hall commented on FELIX-249:
---------------------------------------

If I modify your second proposal to look like this:

public class ShutdownPlugin implements Plugin
{
    private BundleContext m_context = null;
    private boolean m_shuttingdown = false;

    // Plugin interface methods.

    public String getName()
    {
        return "Shutdown";    
    }
    
    public Component getGUI()
    {
        shutdown();
        return new JPanel();
    }
    
    // Implementation.
    
    public ShutdownPlugin(BundleContext context)
    {
        m_context = context;
    }

    private void shutdown()
    {
        if (!m_shuttingdown)
        {
            Bundle systembundle = m_context.getBundle(0);
            m_shuttingdown = true;
            try
            {
                systembundle.stop();
            }
            catch (Exception ex)
            {
                System.out.println(ex.toString());
                ex.printStackTrace(System.out);
            }
        }
    }
}

Then it works fine for me. However, I am not sure this is a good approach, since it would surely surprise people to be automatically kicked out by touching the plugin. I will look at your other approach.

> Add a shutdown button to the shellGUI
> -------------------------------------
>
>                 Key: FELIX-249
>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Tim Moloney
>            Priority: Trivial
>         Attachments: shell.gui.plugin-shutdown-choice-1.patch, shell.gui.plugin-shutdown-choice-2.patch
>
>
> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-249) Add a shutdown button to the shellGUI

Posted by "Tim Moloney (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Moloney updated FELIX-249:
------------------------------

    Attachment: shell.gui.plugin-shutdown-choice-2.patch

Another possible solution that allows shutting down with just one mouse click.  Unfortunately, it always causes the following stack track.

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at org.apache.felix.shell.gui.impl.ShellPanel$SimpleListModel.getElementAt(ShellPanel.java:120)
        at javax.swing.plaf.basic.BasicListUI.paintCell(BasicListUI.java:191)
        at javax.swing.plaf.basic.BasicListUI.paintImpl(BasicListUI.java:304)
        at javax.swing.plaf.basic.BasicListUI.paint(BasicListUI.java:227)
        at javax.swing.plaf.ComponentUI.update(ComponentUI.java:143)
        at javax.swing.JComponent.paintComponent(JComponent.java:758)
        at javax.swing.JComponent.paint(JComponent.java:1022)
        at javax.swing.JComponent.paintChildren(JComponent.java:859)
        at javax.swing.JComponent.paint(JComponent.java:1031)
        at javax.swing.JViewport.paint(JViewport.java:747)
        at javax.swing.JComponent.paintChildren(JComponent.java:859)
        at javax.swing.JComponent.paint(JComponent.java:1031)
        at javax.swing.JComponent.paintChildren(JComponent.java:859)
        at javax.swing.JComponent.paint(JComponent.java:1031)
        at javax.swing.JComponent.paintToOffscreen(JComponent.java:5104)
        at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:285)
        at javax.swing.RepaintManager.paint(RepaintManager.java:1132)
        at javax.swing.JComponent._paintImmediately(JComponent.java:5052)
        at javax.swing.JComponent.paintImmediately(JComponent.java:4862)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:727)
        at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:683)
        at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:663)
        at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:128)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Invalid BundleContext.
        at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:458)
        at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.shutdown(ShutdownPlugin.java:57)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.getGUI(ShutdownPlugin.java:44)
        at org.apache.felix.shell.gui.impl.ShellPanel$PropertyChangeRunnable.run(ShellPanel.java:157)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Invalid BundleContext.
        at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:458)
        at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.shutdown(ShutdownPlugin.java:57)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.getGUI(ShutdownPlugin.java:44)
        at org.apache.felix.shell.gui.impl.ShellPanel$PropertyChangeRunnable.run(ShellPanel.java:157)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Invalid BundleContext.
        at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:458)
        at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.shutdown(ShutdownPlugin.java:57)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.getGUI(ShutdownPlugin.java:44)
        at org.apache.felix.shell.gui.impl.ShellPanel$PropertyChangeRunnable.run(ShellPanel.java:157)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Invalid BundleContext.
        at org.apache.felix.framework.BundleContextImpl.checkValidity(BundleContextImpl.java:458)
        at org.apache.felix.framework.BundleContextImpl.getServiceReference(BundleContextImpl.java:257)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.shutdown(ShutdownPlugin.java:57)
        at org.apache.felix.shell.gui.plugin.ShutdownPlugin.getGUI(ShutdownPlugin.java:44)
        at org.apache.felix.shell.gui.impl.ShellPanel$PropertyChangeRunnable.run(ShellPanel.java:157)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)


> Add a shutdown button to the shellGUI
> -------------------------------------
>
>                 Key: FELIX-249
>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Tim Moloney
>            Priority: Trivial
>         Attachments: shell.gui.plugin-shutdown-choice-1.patch, shell.gui.plugin-shutdown-choice-2.patch
>
>
> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (FELIX-249) Add a shutdown button to the shellGUI

Posted by Tim Moloney <t....@verizon.net>.
It works well.  Thanks.


Richard S. Hall (JIRA) wrote:
>     [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479317 ] 
>
> Richard S. Hall commented on FELIX-249:
> ---------------------------------------
>
> For your first approach, I modified it like this:
>
>         m_shutdownButton.addActionListener(new ActionListener() {
>             public void actionPerformed(ActionEvent event)
>             {
>                 Bundle systembundle = m_context.getBundle(0);
>                 try
>                 {
>                     systembundle.stop();
>                 }
>                 catch (Exception ex)
>                 {
>                     System.out.println(ex.toString());
>                     ex.printStackTrace(System.out);
>                 }
>             }
>         });
>
> This seems to work fine for me under Linux too. I will commit this change, let me know how it works for you.
>
>   
>> Add a shutdown button to the shellGUI
>> -------------------------------------
>>
>>                 Key: FELIX-249
>>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>>             Project: Felix
>>          Issue Type: Improvement
>>            Reporter: Tim Moloney
>>            Priority: Trivial
>>         Attachments: shell.gui.plugin-shutdown-choice-1.patch, shell.gui.plugin-shutdown-choice-2.patch
>>
>>
>> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.
>>     
>
>   


[jira] Commented: (FELIX-249) Add a shutdown button to the shellGUI

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12479317 ] 

Richard S. Hall commented on FELIX-249:
---------------------------------------

For your first approach, I modified it like this:

        m_shutdownButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event)
            {
                Bundle systembundle = m_context.getBundle(0);
                try
                {
                    systembundle.stop();
                }
                catch (Exception ex)
                {
                    System.out.println(ex.toString());
                    ex.printStackTrace(System.out);
                }
            }
        });

This seems to work fine for me under Linux too. I will commit this change, let me know how it works for you.

> Add a shutdown button to the shellGUI
> -------------------------------------
>
>                 Key: FELIX-249
>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Tim Moloney
>            Priority: Trivial
>         Attachments: shell.gui.plugin-shutdown-choice-1.patch, shell.gui.plugin-shutdown-choice-2.patch
>
>
> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (FELIX-249) Add a shutdown button to the shellGUI

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard S. Hall closed FELIX-249.
---------------------------------

    Resolution: Fixed
      Assignee: Richard S. Hall

I followed the first approach and committed a fix.

> Add a shutdown button to the shellGUI
> -------------------------------------
>
>                 Key: FELIX-249
>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Tim Moloney
>         Assigned To: Richard S. Hall
>            Priority: Trivial
>         Attachments: shell.gui.plugin-shutdown-choice-1.patch, shell.gui.plugin-shutdown-choice-2.patch
>
>
> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-249) Add a shutdown button to the shellGUI

Posted by "Tim Moloney (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-249?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tim Moloney updated FELIX-249:
------------------------------

    Attachment: shell.gui.plugin-shutdown-choice-1.patch

One possible solution which adds a button to the Bundle List panel.  Shutting down takes at most two mouse clicks.

There don't appear to be any issues with this patch.  The stack trace mentioned in FELIX-248 sometimes occurs but it will occur even without this patch so I don't think this patch causes the problem.


> Add a shutdown button to the shellGUI
> -------------------------------------
>
>                 Key: FELIX-249
>                 URL: https://issues.apache.org/jira/browse/FELIX-249
>             Project: Felix
>          Issue Type: Improvement
>            Reporter: Tim Moloney
>            Priority: Trivial
>         Attachments: shell.gui.plugin-shutdown-choice-1.patch
>
>
> Add a shutdown button to the shellGUI to make shutting down a bit more convenient.  Presently, you have to click on the Shell panel selector, then click on the shell command entry box, then type shutdown.  Adding a button would reduce this to just a mouse click or two.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.