diff options
author | Emil Ivov <emcho@jitsi.org> | 2006-03-08 03:59:53 +0000 |
---|---|---|
committer | Emil Ivov <emcho@jitsi.org> | 2006-03-08 03:59:53 +0000 |
commit | 957ed3fa96427d4735f070c8cc4ae6178c865030 (patch) | |
tree | bb5bb7d1579636fe34b57110fe5443e5b397a6fb /src/net/java/sip/communicator/impl/protocol | |
parent | 2d42ba02c20e931e639826347d24b44d4758d1a3 (diff) | |
download | jitsi-957ed3fa96427d4735f070c8cc4ae6178c865030.zip jitsi-957ed3fa96427d4735f070c8cc4ae6178c865030.tar.gz jitsi-957ed3fa96427d4735f070c8cc4ae6178c865030.tar.bz2 |
Refactoring.
Added a reference to the parent provider.
Diffstat (limited to 'src/net/java/sip/communicator/impl/protocol')
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java | 16 | ||||
-rw-r--r-- | src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java | 24 |
2 files changed, 30 insertions, 10 deletions
diff --git a/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java index be754c7..613a010 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/ContactGroupIcqImpl.java @@ -47,6 +47,8 @@ public class ContactGroupIcqImpl */ private String nameCopy = null; + private ServerStoredContactListIcqImpl ssclCallback = null; + /** * Creates an ICQ group using the specified <tt>joustSimGroup</tt> as * a source. The newly created group will always return the name of the @@ -72,6 +74,8 @@ public class ContactGroupIcqImpl { this.joustSimSourceGroup = joustSimGroup; + this.ssclCallback = ssclCallback; + //store a copy of the name now so that we can detect changes in the //name of the underlying joustSimSourceGroup initNameCopy(); @@ -247,7 +251,7 @@ public class ContactGroupIcqImpl * by the root group - <tt>RootContactGroupIcqImpl</tt>. * @return a 0 int. */ - public int countSubGroups() + public int countSubgroups() { return 0; } @@ -301,6 +305,16 @@ public class ContactGroupIcqImpl } /** + * Returns the protocol provider that this group belongs to. + * @return a regerence to the ProtocolProviderService instance that this + * ContactGroup belongs to. + */ + public ProtocolProviderService getProtocolProvider() + { + return this.ssclCallback.getParentProvider(); + } + + /** * Returns a string representation of this group, in the form * IcqGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}. * @return a String representation of the object. diff --git a/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java b/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java index 30f034e..96896fd 100644 --- a/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java +++ b/src/net/java/sip/communicator/impl/protocol/icq/RootContactGroupIcqImpl.java @@ -1,3 +1,9 @@ +/* + * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client. + * + * Distributable under LGPL license. + * See terms of license at gnu.org. + */ package net.java.sip.communicator.impl.protocol.icq; import java.util.*; @@ -20,15 +26,15 @@ public class RootContactGroupIcqImpl */ private List dummyContacts = new LinkedList(); -// private ProtocolProviderServiceIcqImpl ownerProvider = null; + private ProtocolProviderServiceIcqImpl ownerProvider = null; /** * Creates a ContactGroup instance. * @param ownerProvider ProtocolProviderServiceIcqImpl */ - RootContactGroupIcqImpl()//ProtocolProviderServiceIcqImpl ownerProvider) + RootContactGroupIcqImpl(ProtocolProviderServiceIcqImpl ownerProvider) { -// this.ownerProvider = ownerProvider; + this.ownerProvider = ownerProvider; } /** * The ContactListRoot in ICQ is the only group that can contain subgroups. @@ -112,7 +118,7 @@ public class RootContactGroupIcqImpl * @return an int indicating the number of subgroups that this * ContactGroup contains. */ - public int countSubGroups() + public int countSubgroups() { return subGroups.size(); } @@ -215,7 +221,7 @@ public class RootContactGroupIcqImpl public String toString() { StringBuffer buff = new StringBuffer(getGroupName()); - buff.append(".subGroups="+countSubGroups()+":\n"); + buff.append(".subGroups="+countSubgroups()+":\n"); Iterator subGroups = subGroups(); while (subGroups.hasNext()) @@ -233,9 +239,9 @@ public class RootContactGroupIcqImpl * @return a regerence to the ProtocolProviderService instance that this * ContactGroup belongs to. */ -// public ProtocolProviderService getProtocolProvider() -// { -// return this.ownerProvider; -// } + public ProtocolProviderService getProtocolProvider() + { + return this.ownerProvider; + } } |