}
}
if(accountListChangeListener == null)
accountList.addChangeListener(accountListChangeListener = new SpheneListener<SpheneEvent>(){
public void handleEvent(SpheneEvent event_) {
GOIMAbstractListEvent event = (GOIMAbstractListEvent)event_;
if(event.type == GOIMAbstractListEvent.TYPE_ADD)
openRemainingContactLists();
// if(getMyPreferenceStore().getBoolean(PreferenceConstants.P_CONTACTLIST_AUTOOPEN) &&
// !getMyPreferenceStore().getBoolean(PreferenceConstants.P_CONTACTLIST_ALLACCOUNTS))
// openContactList(getMyPreferenceStore().getString(PreferenceConstants.P_CONTACTLIST),(GOIMAccount)event.source);
}});
if(propertyChangeListener == null)
store.addPropertyChangeListener(propertyChangeListener = new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
logger.finest("Property changed: " + event.getProperty());
if(accountList.size() > 0 && getMyPreferenceStore().getBoolean(PreferenceConstants.P_CONTACTLIST_AUTOOPEN)) {
if(event.getProperty().equals(PreferenceConstants.P_CONTACTLIST)) {
int code = -1;
if(getMyPreferenceStore().getString(PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN).equals("")) {
MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Reopen ContactList",
"You have changed the default ContactList. - Do you want to close all contact lists and start the selected ?",
null,
false,
getMyPreferenceStore(),
PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN);
code = dialog.getReturnCode();
} else {
if(getMyPreferenceStore().getString(PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN).equals(MessageDialogWithToggle.ALWAYS))
code = IDialogConstants.YES_ID;
else
code = IDialogConstants.NO_ID;
}
if(code != IDialogConstants.YES_ID) return;
if(getMyPreferenceStore().getBoolean(PreferenceConstants.P_CONTACTLIST_ALLACCOUNTS)) {
registeredContactListOfAllAccounts.closeContactList();
} else {
for(IContactListView view : registeredContactLists.values()) {
view.closeContactList();
}
}
openRemainingContactLists();
} else if(event.getProperty().equals(PreferenceConstants.P_CONTACTLIST_ALLACCOUNTS)) {
int code = -1;
if(getMyPreferenceStore().getString(PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN).equals("")) {
MessageDialogWithToggle dialog = MessageDialogWithToggle.openYesNoQuestion(
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Reopen ContactList",
"You have changed the behaviour of the ContactList. - Do you want to close all contact lists and apply the changes?",
null,
false,
getMyPreferenceStore(),
PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN);
code = dialog.getReturnCode();
} else {
if(getMyPreferenceStore().getString(PreferenceConstants.P_CONTACTLIST_CHANGED_OPEN).equals(MessageDialogWithToggle.ALWAYS))
code = IDialogConstants.YES_ID;
else
code = IDialogConstants.NO_ID;
}
if(code != IDialogConstants.YES_ID) return;
boolean oldval;
if(event.getOldValue() != null)
oldval = (Boolean)event.getOldValue();
else
oldval = !getMyPreferenceStore().getBoolean(PreferenceConstants.P_CONTACTLIST_ALLACCOUNTS);
if(oldval) {
registeredContactListOfAllAccounts.closeContactList();
} else {