private void addServiceListeners()
{
final java.beans.PropertyChangeListener thisListener;
- // Do this once to get current state
- BuildWebServiceMenu();
Desktop.instance.addJalviewPropertyChangeListener("services",
- thisListener=new java.beans.PropertyChangeListener()
+ thisListener = new java.beans.PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent evt)
{
javax.swing.event.InternalFrameEvent evt)
{
System.out.println("deregistering discoverer listener");
- Desktop.instance.removeJalviewPropertyChangeListener("services",thisListener);
+ Desktop.instance.removeJalviewPropertyChangeListener("services",
+ thisListener);
closeMenuItem_actionPerformed(true);
};
});
+ // Finally, build the menu once to get current service state
+ BuildWebServiceMenu();
}
public void setGUINucleotide(boolean nucleotide)
{
JMenu jws2men = new JMenu("Jalview 2 Services");
jws2servs.attachWSMenuEntry(jws2men, this);
- wsmenu.add(jws2men);
+ for (int i = 0, iSize = jws2men.getMenuComponentCount(); i < iSize; i++)
+ {
+ wsmenu.add(jws2men.getMenuComponent(i));
+ }
}
}
}