Displays a warning message in the Facebook account registration wizard stating that the protocol support is experimental.

cusax-fix
Lyubomir Marinov 17 years ago
parent c48ee850a1
commit 92565966cc

@ -496,11 +496,12 @@ plugin.callhistoryform.INCOMING=Incoming
plugin.callhistoryform.OUTGOING=Outgoing
# facebookaccregwizz
plugin.facebookaccregwizz.PROTOCOL_NAME=Facebook
plugin.facebookaccregwizz.EXPERIMENTAL_WARNING=<html><body>The support for this protocol is experimental and may not work as expected. Please report bugs to <a href="mailto:dev@sip-communicator.dev.java.net">dev@sip-communicator.dev.java.net</a>.</body></html>
plugin.facebookaccregwizz.INVALID_EMAIL_ADDRESS=Invalid email address
plugin.facebookaccregwizz.PROTOCOL_DESCRIPTION=The Facebook Chat protocol
plugin.facebookaccregwizz.PROTOCOL_NAME=Facebook
plugin.facebookaccregwizz.USERNAME=Email:
plugin.facebookaccregwizz.USERNAME_AND_PASSWORD=Email and Password
plugin.facebookaccregwizz.INVALID_EMAIL_ADDRESS=Invalid email address
# generalconfig
plugin.generalconfig.AUTO_START=Auto - start {0} when computer restarts or reboots.

@ -21,6 +21,7 @@
* and the password of the account.
*
* @author Dai Zhiwei
* @author Lubomir Marinov
*/
public class FirstWizardPage
extends TransparentPanel
@ -115,6 +116,14 @@ private void init()
valuesPanel.add(emailExampleLabel);
valuesPanel.add(passField);
JLabel experimentalWarningLabel
= new JLabel(
Resources.getString(
"plugin.facebookaccregwizz.EXPERIMENTAL_WARNING"));
experimentalWarningLabel.setForeground(Color.RED);
setPreferredWidthInCharCount(experimentalWarningLabel, 50);
userPassPanel.add(experimentalWarningLabel, BorderLayout.NORTH);
userPassPanel.add(labelsPanel, BorderLayout.WEST);
userPassPanel.add(valuesPanel, BorderLayout.CENTER);
userPassPanel.add(rememberPassBox, BorderLayout.SOUTH);
@ -127,6 +136,34 @@ private void init()
this.add(userPassPanel, BorderLayout.NORTH);
}
/**
* Sets the preferred width of a specific <code>JLabel</code> to a value
* which is likely to cause it to display a specific number of characters
* per line. Because setting the preferred width requires also setting the
* preferred height, the preferred height is set to a value which is likely
* to cause the specified <code>JLabel</code> to display its whole text.
*
* @param label
* the <code>JLabel</code> to set the preferred width of
* @param charCount
* the number of characters per line to be displayed after
* setting the preferred width
*/
private void setPreferredWidthInCharCount(JLabel label, int charCount)
{
FontMetrics fontMetrics = label.getFontMetrics(label.getFont());
String text = label.getText();
int textWidth = fontMetrics.stringWidth(text);
int labelWidth = charCount * textWidth / text.length();
label.setPreferredSize(
new Dimension(
labelWidth,
fontMetrics.getHeight()
* (textWidth / labelWidth
+ (textWidth % labelWidth > 0 ? 1 : 0))));
}
/**
* Implements the <code>WizardPage.getIdentifier</code> to return
* this page identifier.
@ -317,7 +354,7 @@ private boolean isExistingAccount(String email)
return false;
}
public Object getSimpleForm()
public Object getSimpleForm()
{
return userPassPanel;
}

Loading…
Cancel
Save