Spark project doesn’t have full-time qualified developers working on it. Only a few volunteers without java skills and occasionally someone providing patches. So the answer might be as soon as someone provides a patch (could be never in the worse scenario).
A way around it is to implement a plugin. You store an instance of the “Add Contacts Menu” object when the plugin initializes. You also add a mouse listener on the Contacts menu that checks if the “Add Contacts Menu” is there, and if it’s not you add the reference to it.
This is just a band ait solution since I haven’t been able to determine where exactly the menu gets removed.
Code below (add missing imports as necessary for your own plugin):
public class Changes implements Plugin {
private JMenuItem addContactGroupMenu = null;
/**
* Called after Spark is loaded to initialize the new plugin.
*/
public void initialize() {
storeAddContactMenuReference();
//Add a mouse listener to contact list to determine what happens to the menu
addContactLIstMouseListener();
}
private void addContactLIstMouseListener() {
// TODO Auto-generated method stub
final JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName(Res.getString("menuitem.contacts"));
contactsMenu.addMouseListener(new MouseListener() {
@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
}
@Override
public void mouseEntered(MouseEvent e) {
System.out.println("Mouse was pressed");
boolean contactGroupExists = false;
for(int i=0; i<contactsMenu.getItemCount(); i++)
{
JMenuItem currentItem = contactsMenu.getItem(i);
if(currentItem.getText().equalsIgnoreCase(Res.getString("menuitem.add.contact.group"))) {
contactGroupExists = true;
}
}
if(!contactGroupExists) {
if(addContactGroupMenu != null) {
if(!Default.getBoolean("ADD_CONTACT_GROUP_DISABLED")){
contactsMenu.add(addContactGroupMenu, 1);
}
}
}
}
@Override
public void mouseClicked(MouseEvent e) {
}
});
}
private void storeAddContactMenuReference() {
JMenu contactsMenu = SparkManager.getMainWindow().getMenuByName(Res.getString("menuitem.contacts"));
for(int i=0; i<contactsMenu.getItemCount(); i++)
{
JMenuItem currentItem = contactsMenu.getItem(i);
if(currentItem.getText().equalsIgnoreCase(Res.getString("menuitem.add.contact.group")))
{
addContactGroupMenu = new JMenuItem();
addContactGroupMenu = currentItem;
}
}
}