Author: sebb Date: Mon Nov 10 11:24:12 2008 New Revision: 712724 URL: http://svn.apache.org/viewvc?rev=712724&view=rev Log: Fix up some GUI elements so dynamic language changes work
Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java jakarta/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/control/gui/ThroughputControllerGui.java Mon Nov 10 11:24:12 2008 @@ -46,15 +46,14 @@ private boolean isPerThread = true; - private String BYNUMBER_LABEL = JMeterUtils.getResString("throughput_control_bynumber_label"); // $NON-NLS-1$ + // These must not be static, otherwise Language change does not work + private final String BYNUMBER_LABEL = JMeterUtils.getResString("throughput_control_bynumber_label"); // $NON-NLS-1$ - private String BYPERCENT_LABEL = JMeterUtils.getResString("throughput_control_bypercent_label"); // $NON-NLS-1$ + private final String BYPERCENT_LABEL = JMeterUtils.getResString("throughput_control_bypercent_label"); // $NON-NLS-1$ - private String THROUGHPUT_LABEL = JMeterUtils.getResString("throughput_control_tplabel"); // $NON-NLS-1$ + private final String THROUGHPUT_LABEL = JMeterUtils.getResString("throughput_control_tplabel"); // $NON-NLS-1$ - private String THROUGHPUT = "Througput Field"; // $NON-NLS-1$ - - private String PERTHREAD_LABEL = JMeterUtils.getResString("throughput_control_perthread_label"); // $NON-NLS-1$ + private final String PERTHREAD_LABEL = JMeterUtils.getResString("throughput_control_perthread_label"); // $NON-NLS-1$ public ThroughputControllerGui() { init(); @@ -144,7 +143,6 @@ // TEXT FIELD throughput = new JTextField(5); tpPanel.add(throughput); - throughput.setName(THROUGHPUT); throughput.setText("1"); // $NON-NLS-1$ // throughput.addActionListener(this); tpPanel.add(throughput); Modified: jakarta/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java (original) +++ jakarta/jmeter/trunk/src/components/org/apache/jmeter/sampler/gui/TestActionGui.java Mon Nov 10 11:24:12 2008 @@ -58,19 +58,20 @@ private String durationString; // String in the panel - private static final String targetLabel = JMeterUtils.getResString("test_action_target"); // $NON-NLS-1$ + // Do not make these static, otherwise language changes don't work + private final String targetLabel = JMeterUtils.getResString("test_action_target"); // $NON-NLS-1$ - private static final String threadTarget = JMeterUtils.getResString("test_action_target_thread"); // $NON-NLS-1$ + private final String threadTarget = JMeterUtils.getResString("test_action_target_thread"); // $NON-NLS-1$ - private static final String testTarget = JMeterUtils.getResString("test_action_target_test"); // $NON-NLS-1$ + private final String testTarget = JMeterUtils.getResString("test_action_target_test"); // $NON-NLS-1$ - private static final String actionLabel = JMeterUtils.getResString("test_action_action"); // $NON-NLS-1$ + private final String actionLabel = JMeterUtils.getResString("test_action_action"); // $NON-NLS-1$ - private static final String pauseAction = JMeterUtils.getResString("test_action_pause"); // $NON-NLS-1$ + private final String pauseAction = JMeterUtils.getResString("test_action_pause"); // $NON-NLS-1$ - private static final String stopAction = JMeterUtils.getResString("test_action_stop"); // $NON-NLS-1$ + private final String stopAction = JMeterUtils.getResString("test_action_stop"); // $NON-NLS-1$ - private static final String durationLabel = JMeterUtils.getResString("test_action_duration"); // $NON-NLS-1$ + private final String durationLabel = JMeterUtils.getResString("test_action_duration"); // $NON-NLS-1$ public TestActionGui() { super(); Modified: jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java (original) +++ jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorHealthPanel.java Mon Nov 10 11:24:12 2008 @@ -45,15 +45,16 @@ private JScrollPane SCROLL = null; // NOTUSED Font plainText = new Font("plain", Font.PLAIN, 9); - public static final String INFO_H = JMeterUtils.getResString("monitor_equation_healthy"); //$NON-NLS-1$ + // These must not be static, otherwise Language change does not work + public final String INFO_H = JMeterUtils.getResString("monitor_equation_healthy"); //$NON-NLS-1$ - public static final String INFO_A = JMeterUtils.getResString("monitor_equation_active"); //$NON-NLS-1$ + public final String INFO_A = JMeterUtils.getResString("monitor_equation_active"); //$NON-NLS-1$ - public static final String INFO_W = JMeterUtils.getResString("monitor_equation_warning"); //$NON-NLS-1$ + public final String INFO_W = JMeterUtils.getResString("monitor_equation_warning"); //$NON-NLS-1$ - public static final String INFO_D = JMeterUtils.getResString("monitor_equation_dead"); //$NON-NLS-1$ + public final String INFO_D = JMeterUtils.getResString("monitor_equation_dead"); //$NON-NLS-1$ - public static final String INFO_LOAD = JMeterUtils.getResString("monitor_equation_load"); //$NON-NLS-1$ + public final String INFO_LOAD = JMeterUtils.getResString("monitor_equation_load"); //$NON-NLS-1$ /** * @@ -78,7 +79,7 @@ */ private void init() {// called from ctor, so must not be overridable this.setLayout(new BorderLayout()); - ImageIcon legend = JMeterUtils.getImage("monitor-legend.gif"); //$NON-NLS-1$ + ImageIcon legend = JMeterUtils.getImage("monitor-legend.gif"); // I18N: Contains fixed English text ... JLabel label = new JLabel(legend); label.setPreferredSize(new Dimension(550, 25)); this.add(label, BorderLayout.NORTH); Modified: jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java (original) +++ jakarta/jmeter/trunk/src/monitor/components/org/apache/jmeter/visualizers/MonitorPerformancePanel.java Mon Nov 10 11:24:12 2008 @@ -59,39 +59,40 @@ private SampleResult ROOTSAMPLE; - public static final String LEGEND_HEALTH = JMeterUtils.getResString("monitor_legend_health"); //$NON-NLS-1$ + // Don't make these static, otherwise language change does not work + public final String LEGEND_HEALTH = JMeterUtils.getResString("monitor_legend_health"); //$NON-NLS-1$ - public static final String LEGEND_LOAD = JMeterUtils.getResString("monitor_legend_load"); //$NON-NLS-1$ + public final String LEGEND_LOAD = JMeterUtils.getResString("monitor_legend_load"); //$NON-NLS-1$ - public static final String LEGEND_MEM = JMeterUtils.getResString("monitor_legend_memory_per"); //$NON-NLS-1$ + public final String LEGEND_MEM = JMeterUtils.getResString("monitor_legend_memory_per"); //$NON-NLS-1$ public static final String LEGEND_THREAD = JMeterUtils.getResString("monitor_legend_thread_per"); //$NON-NLS-1$ - public static final ImageIcon LEGEND_HEALTH_ICON = JMeterUtils.getImage("monitor-green-legend.gif"); //$NON-NLS-1$ + public final ImageIcon LEGEND_HEALTH_ICON = JMeterUtils.getImage("monitor-green-legend.gif"); //$NON-NLS-1$ - public static final ImageIcon LEGEND_LOAD_ICON = JMeterUtils.getImage("monitor-blue-legend.gif"); //$NON-NLS-1$ + public final ImageIcon LEGEND_LOAD_ICON = JMeterUtils.getImage("monitor-blue-legend.gif"); //$NON-NLS-1$ - public static final ImageIcon LEGEND_MEM_ICON = JMeterUtils.getImage("monitor-orange-legend.gif"); //$NON-NLS-1$ + public final ImageIcon LEGEND_MEM_ICON = JMeterUtils.getImage("monitor-orange-legend.gif"); //$NON-NLS-1$ - public static final ImageIcon LEGEND_THREAD_ICON = JMeterUtils.getImage("monitor-red-legend.gif"); //$NON-NLS-1$ + public final ImageIcon LEGEND_THREAD_ICON = JMeterUtils.getImage("monitor-red-legend.gif"); //$NON-NLS-1$ - public static final String GRID_LABEL_TOP = JMeterUtils.getResString("monitor_label_left_top"); //$NON-NLS-1$ + public final String GRID_LABEL_TOP = JMeterUtils.getResString("monitor_label_left_top"); //$NON-NLS-1$ - public static final String GRID_LABEL_MIDDLE = JMeterUtils.getResString("monitor_label_left_middle"); //$NON-NLS-1$ + public final String GRID_LABEL_MIDDLE = JMeterUtils.getResString("monitor_label_left_middle"); //$NON-NLS-1$ - public static final String GRID_LABEL_BOTTOM = JMeterUtils.getResString("monitor_label_left_bottom"); //$NON-NLS-1$ + public final String GRID_LABEL_BOTTOM = JMeterUtils.getResString("monitor_label_left_bottom"); //$NON-NLS-1$ - public static final String GRID_LABEL_HEALTHY = JMeterUtils.getResString("monitor_label_right_healthy"); //$NON-NLS-1$ + public final String GRID_LABEL_HEALTHY = JMeterUtils.getResString("monitor_label_right_healthy"); //$NON-NLS-1$ - public static final String GRID_LABEL_ACTIVE = JMeterUtils.getResString("monitor_label_right_active"); //$NON-NLS-1$ + public final String GRID_LABEL_ACTIVE = JMeterUtils.getResString("monitor_label_right_active"); //$NON-NLS-1$ - public static final String GRID_LABEL_WARNING = JMeterUtils.getResString("monitor_label_right_warning"); //$NON-NLS-1$ + public final String GRID_LABEL_WARNING = JMeterUtils.getResString("monitor_label_right_warning"); //$NON-NLS-1$ - public static final String GRID_LABEL_DEAD = JMeterUtils.getResString("monitor_label_right_dead"); //$NON-NLS-1$ + public final String GRID_LABEL_DEAD = JMeterUtils.getResString("monitor_label_right_dead"); //$NON-NLS-1$ - public static final String PERF_TITLE = JMeterUtils.getResString("monitor_performance_title"); //$NON-NLS-1$ + public final String PERF_TITLE = JMeterUtils.getResString("monitor_performance_title"); //$NON-NLS-1$ - public static final String SERVER_TITLE = JMeterUtils.getResString("monitor_performance_servers"); //$NON-NLS-1$ + public final String SERVER_TITLE = JMeterUtils.getResString("monitor_performance_servers"); //$NON-NLS-1$ protected Font plaintext = new Font("plain", Font.TRUETYPE_FONT, 10); //$NON-NLS-1$ Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java (original) +++ jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/gui/HTTPFileArgsPanel.java Mon Nov 10 11:24:12 2008 @@ -84,13 +84,14 @@ /** Command for removing a row from the table. */ private static final String DELETE = "delete"; // $NON-NLS-1$ - private static final String FILEPATH = JMeterUtils.getResString("send_file_filename_label"); // $NON-NLS-1$ + // Properties should not be static, otherwise language change does not work + private final String FILEPATH = JMeterUtils.getResString("send_file_filename_label"); // $NON-NLS-1$ /** The parameter name column title of file table. */ - private static final String PARAMNAME = JMeterUtils.getResString("send_file_param_name_label"); //$NON-NLS-1$ + private final String PARAMNAME = JMeterUtils.getResString("send_file_param_name_label"); //$NON-NLS-1$ /** The mime type column title of file table. */ - private static final String MIMETYPE = JMeterUtils.getResString("send_file_mime_label"); //$NON-NLS-1$ + private final String MIMETYPE = JMeterUtils.getResString("send_file_mime_label"); //$NON-NLS-1$ public HTTPFileArgsPanel() { this(""); // required for unit tests Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java (original) +++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java Mon Nov 10 11:24:12 2008 @@ -51,11 +51,12 @@ private static final String ALL_FILES = "*.*"; //$NON-NLS-1$ - public static final String use_file = JMeterUtils.getResString("jms_use_file"); //$NON-NLS-1$ + // These must not be static, otherwise Language change does not work + public final String use_file = JMeterUtils.getResString("jms_use_file"); //$NON-NLS-1$ - public static final String use_random = JMeterUtils.getResString("jms_use_random_file"); //$NON-NLS-1$ + public final String use_random = JMeterUtils.getResString("jms_use_random_file"); //$NON-NLS-1$ - public static final String use_text = JMeterUtils.getResString("jms_use_text"); //$NON-NLS-1$ + public final String use_text = JMeterUtils.getResString("jms_use_text"); //$NON-NLS-1$ private String[] items = { use_file, use_random, use_text }; Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java (original) +++ jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java Mon Nov 10 11:24:12 2008 @@ -74,11 +74,12 @@ private JCheckBox readResponse = new JCheckBox(JMeterUtils.getResString("jms_read_response"), true); // $NON-NLS-1$ - public static final String receive_str = JMeterUtils.getResString("jms_subscriber_receive"); // $NON-NLS-1$ + // These must not be static, otherwise Language change does not work + public final String receive_str = JMeterUtils.getResString("jms_subscriber_receive"); // $NON-NLS-1$ - public static final String onmessage_str = JMeterUtils.getResString("jms_subscriber_on_message"); // $NON-NLS-1$ + public final String onmessage_str = JMeterUtils.getResString("jms_subscriber_on_message"); // $NON-NLS-1$ - private static final String[] client_items = { receive_str, onmessage_str }; + private final String[] client_items = { receive_str, onmessage_str }; private JLabeledRadio clientChoice = new JLabeledRadio(JMeterUtils.getResString("jms_client_type"), client_items, // $NON-NLS-1$ Modified: jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java URL: http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java?rev=712724&r1=712723&r2=712724&view=diff ============================================================================== --- jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java (original) +++ jakarta/jmeter/trunk/src/protocol/mail/org/apache/jmeter/protocol/mail/sampler/gui/MailReaderSamplerGui.java Mon Nov 10 11:24:12 2008 @@ -63,32 +63,32 @@ private JCheckBox storeMimeMessageBox; - // Labels - private final static String POP3Label = JMeterUtils.getResString("mail_reader_pop3");// $NON-NLS-1$ + // Labels - don't make these static, else language change will not work + private final String POP3Label = JMeterUtils.getResString("mail_reader_pop3");// $NON-NLS-1$ - private final static String IMAPLabel = JMeterUtils.getResString("mail_reader_imap");// $NON-NLS-1$ + private final String IMAPLabel = JMeterUtils.getResString("mail_reader_imap");// $NON-NLS-1$ - private final static String POP3SLabel = JMeterUtils.getResString("mail_reader_pop3s");// $NON-NLS-1$ + private final String POP3SLabel = JMeterUtils.getResString("mail_reader_pop3s");// $NON-NLS-1$ - private final static String IMAPSLabel = JMeterUtils.getResString("mail_reader_imaps");// $NON-NLS-1$ + private final String IMAPSLabel = JMeterUtils.getResString("mail_reader_imaps");// $NON-NLS-1$ - private final static String ServerTypeLabel = JMeterUtils.getResString("mail_reader_server_type");// $NON-NLS-1$ + private final String ServerTypeLabel = JMeterUtils.getResString("mail_reader_server_type");// $NON-NLS-1$ - private final static String ServerLabel = JMeterUtils.getResString("mail_reader_server");// $NON-NLS-1$ + private final String ServerLabel = JMeterUtils.getResString("mail_reader_server");// $NON-NLS-1$ - private final static String AccountLabel = JMeterUtils.getResString("mail_reader_account");// $NON-NLS-1$ + private final String AccountLabel = JMeterUtils.getResString("mail_reader_account");// $NON-NLS-1$ - private final static String PasswordLabel = JMeterUtils.getResString("mail_reader_password");// $NON-NLS-1$ + private final String PasswordLabel = JMeterUtils.getResString("mail_reader_password");// $NON-NLS-1$ - private final static String NumMessagesLabel = JMeterUtils.getResString("mail_reader_num_messages");// $NON-NLS-1$ + private final String NumMessagesLabel = JMeterUtils.getResString("mail_reader_num_messages");// $NON-NLS-1$ - private final static String AllMessagesLabel = JMeterUtils.getResString("mail_reader_all_messages");// $NON-NLS-1$ + private final String AllMessagesLabel = JMeterUtils.getResString("mail_reader_all_messages");// $NON-NLS-1$ - private final static String DeleteLabel = JMeterUtils.getResString("mail_reader_delete");// $NON-NLS-1$ + private final String DeleteLabel = JMeterUtils.getResString("mail_reader_delete");// $NON-NLS-1$ - private final static String FolderLabel = JMeterUtils.getResString("mail_reader_folder");// $NON-NLS-1$ + private final String FolderLabel = JMeterUtils.getResString("mail_reader_folder");// $NON-NLS-1$ - private final static String STOREMIME = JMeterUtils.getResString("mail_reader_storemime");// $NON-NLS-1$ + private final String STOREMIME = JMeterUtils.getResString("mail_reader_storemime");// $NON-NLS-1$ private static final String INBOX = "INBOX"; // $NON-NLS-1$ --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]