Adds isHidden and isPreferredProvider methods to AccountID.

cusax-fix 4714
paweldomas 13 years ago
parent c9e4e00160
commit 279afbcfaa

@ -281,10 +281,7 @@ public void itemStateChanged(ItemEvent e)
{
ProtocolProviderService provider = providers.next();
boolean isHidden = provider.getAccountID().getAccountProperty(
ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
if(isHidden)
if(provider.getAccountID().isHidden())
continue;
OperationSet opSet
@ -295,7 +292,7 @@ public void itemStateChanged(ItemEvent e)
accountCombo.addItem(provider);
if (isPreferredProvider(provider.getAccountID()))
if (provider.getAccountID().isPreferredProvider())
accountCombo.setSelectedItem(provider);
}
@ -621,29 +618,6 @@ public void loadSkin()
imageLabel.setVerticalAlignment(JLabel.TOP);
}
/**
* Returns the first <tt>ProtocolProviderService</tt> implementation
* corresponding to the preferred protocol
*
* @return the <tt>ProtocolProviderService</tt> corresponding to the
* preferred protocol
*/
private boolean isPreferredProvider(AccountID accountID)
{
String preferredProtocolProp
= accountID.getAccountPropertyString(
ProtocolProviderFactory.IS_PREFERRED_PROTOCOL);
if (preferredProtocolProp != null
&& preferredProtocolProp.length() > 0
&& Boolean.parseBoolean(preferredProtocolProp))
{
return true;
}
return false;
}
/**
* Adds a rename listener.
*

@ -708,6 +708,40 @@ public void setTlsClientCertificate(String id)
setOrRemoveIfEmpty(ProtocolProviderFactory.CLIENT_TLS_CERTIFICATE, id);
}
/**
* Checks if the account is hidden.
* @return <tt>true</tt> if this account is hidden or <tt>false</tt>
* otherwise.
*/
public boolean isHidden()
{
return getAccountProperty(
ProtocolProviderFactory.IS_PROTOCOL_HIDDEN) != null;
}
/**
* Returns the first <tt>ProtocolProviderService</tt> implementation
* corresponding to the preferred protocol
*
* @return the <tt>ProtocolProviderService</tt> corresponding to the
* preferred protocol
*/
public boolean isPreferredProvider()
{
String preferredProtocolProp
= getAccountPropertyString(
ProtocolProviderFactory.IS_PREFERRED_PROTOCOL);
if (preferredProtocolProp != null
&& preferredProtocolProp.length() > 0
&& Boolean.parseBoolean(preferredProtocolProp))
{
return true;
}
return false;
}
/**
* Set the account properties.
*

Loading…
Cancel
Save