((IContactListView)part).initWithAccount(account);
}});
}
void openRemainingContactLists() {
IPreferenceStore store = getMyPreferenceStore();
final GOIMAccountList accountList = getPreferenceObject(GOIMAccountList.class);
if(store.getBoolean(PreferenceConstants.P_CONTACTLIST_AUTOOPEN)) {
String viewid = store.getString(PreferenceConstants.P_CONTACTLIST);
if(!store.getBoolean(PreferenceConstants.P_CONTACTLIST_ALLACCOUNTS)) {
for(GOIMAccount account : accountList) {
if(!registeredContactLists.containsKey(account))
openContactList(viewid,account);
}
} else {
if(registeredContactListOfAllAccounts == null && accountList.size() > 0) {
IViewPart part = openContactList(viewid);
if(part instanceof IContactListView)
((IContactListView)part).initWithAccountList(accountList);
}
}
}
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(),