From 79bb78b83c1b797a6091de2d8c82591ab5724283 Mon Sep 17 00:00:00 2001 From: Ingo Bauersachs Date: Sat, 14 Jan 2017 17:25:18 +0100 Subject: Fix layout of call config options in general config --- .../generalconfig/GeneralConfigurationPanel.java | 62 +++++----------------- 1 file changed, 12 insertions(+), 50 deletions(-) diff --git a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java index 04d55a5..03fc308 100644 --- a/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/generalconfig/GeneralConfigurationPanel.java @@ -960,13 +960,11 @@ public class GeneralConfigurationPanel */ private Component createNormalizeNumberCheckBox() { - JPanel checkBoxPanel = new TransparentPanel(new BorderLayout()); - - SIPCommCheckBox formatPhoneNumber = new SIPCommCheckBox("", + SIPCommCheckBox formatPhoneNumber = new SIPCommCheckBox( + GeneralConfigPluginActivator.getResources().getI18NString( + "plugin.generalconfig.REMOVE_SPECIAL_PHONE_SYMBOLS"), ConfigurationUtils.isNormalizePhoneNumber()); - formatPhoneNumber.setAlignmentY(Component.TOP_ALIGNMENT); - formatPhoneNumber.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) @@ -976,22 +974,7 @@ public class GeneralConfigurationPanel } }); - StyledHTMLEditorPane checkBoxTextLabel = new StyledHTMLEditorPane(); - - checkBoxTextLabel.setContentType("text/html"); - checkBoxTextLabel.appendToEnd( - "" + GeneralConfigPluginActivator.getResources().getI18NString( - "plugin.generalconfig.REMOVE_SPECIAL_PHONE_SYMBOLS") + ""); - - checkBoxTextLabel.setBorder( - BorderFactory.createEmptyBorder(3, 0, 0, 0)); - checkBoxTextLabel.setOpaque(false); - checkBoxTextLabel.setEditable(false); - - checkBoxPanel.add(formatPhoneNumber, BorderLayout.WEST); - checkBoxPanel.add(checkBoxTextLabel, BorderLayout.CENTER); - - return checkBoxPanel; + return formatPhoneNumber; } /** @@ -1001,17 +984,17 @@ public class GeneralConfigurationPanel */ private Component createAcceptPhoneNumberWithAlphaCharCheckBox() { - JPanel checkBoxPanel = new TransparentPanel(new BorderLayout()); + JPanel checkBoxPanel = new TransparentPanel(); + checkBoxPanel.setLayout(new BoxLayout(checkBoxPanel, BoxLayout.Y_AXIS)); // Checkbox to accept string with alphabetical characters as potential // phone numbers. - SIPCommCheckBox acceptPhoneNumberWithAlphaChars - = new SIPCommCheckBox("", + SIPCommCheckBox alphaCharNumbers = new SIPCommCheckBox( + GeneralConfigPluginActivator.getResources().getI18NString( + "plugin.generalconfig.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS"), ConfigurationUtils.acceptPhoneNumberWithAlphaChars()); - acceptPhoneNumberWithAlphaChars.setAlignmentY(Component.TOP_ALIGNMENT); - - acceptPhoneNumberWithAlphaChars.addActionListener(new ActionListener() + alphaCharNumbers.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -1020,21 +1003,6 @@ public class GeneralConfigurationPanel } }); - StyledHTMLEditorPane acceptPhoneNumberWithAlphaCharsTextLabel - = new StyledHTMLEditorPane(); - - acceptPhoneNumberWithAlphaCharsTextLabel.setContentType("text/html"); - acceptPhoneNumberWithAlphaCharsTextLabel.appendToEnd( - "" - + GeneralConfigPluginActivator.getResources().getI18NString( - "plugin.generalconfig.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS") - + ""); - - acceptPhoneNumberWithAlphaCharsTextLabel.setBorder( - BorderFactory.createEmptyBorder(3, 0, 0, 0)); - acceptPhoneNumberWithAlphaCharsTextLabel.setOpaque(false); - acceptPhoneNumberWithAlphaCharsTextLabel.setEditable(false); - // The example of changing letters to numbers in a phone number. String label = "* " + Resources.getString( "plugin.generalconfig.ACCEPT_PHONE_NUMBER_WITH_ALPHA_CHARS_EXAMPLE"); @@ -1046,14 +1014,8 @@ public class GeneralConfigurationPanel exampleLabel.setHorizontalAlignment(JLabel.LEFT); // Adds the components to the current panel. - checkBoxPanel.add(acceptPhoneNumberWithAlphaChars, BorderLayout.WEST); - checkBoxPanel.add( - acceptPhoneNumberWithAlphaCharsTextLabel, - BorderLayout.CENTER); - checkBoxPanel.add( - exampleLabel, - BorderLayout.SOUTH); - + checkBoxPanel.add(alphaCharNumbers); + checkBoxPanel.add(exampleLabel); return checkBoxPanel; } -- cgit v1.1