From b2aca66ce757797caa0d4fcdafb15aca75916dd7 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Wed, 10 Dec 2014 20:13:14 -0500 Subject: [PATCH] Add a short description in the profiler GUI Reviewed-by: vanaltj Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2014-December/012214.html --- .../client/swing/internal/LocaleResources.java | 1 + .../swing/internal/SwingVmProfileView.java | 16 +++++++++++++++- .../client/swing/internal/strings.properties | 3 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/LocaleResources.java b/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/LocaleResources.java index da587c9f2..0ecd649b0 100644 --- a/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/LocaleResources.java +++ b/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/LocaleResources.java @@ -43,6 +43,7 @@ public enum LocaleResources { PROFILER_TAB_NAME, PROFILER_HEADING, + PROFILER_DESCRIPTION, PROFILER_CURRENT_STATUS_ACTIVE, PROFILER_CURRENT_STATUS_INACTIVE, diff --git a/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/SwingVmProfileView.java b/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/SwingVmProfileView.java index 7563cc6fb..bfe04d31d 100644 --- a/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/SwingVmProfileView.java +++ b/vm-profiler/client-swing/src/main/java/com/redhat/thermostat/vm/profiler/client/swing/internal/SwingVmProfileView.java @@ -71,6 +71,7 @@ import com.redhat.thermostat.client.swing.experimental.ComponentVisibilityNotifier; import com.redhat.thermostat.common.ActionEvent; import com.redhat.thermostat.common.ActionListener; +import com.redhat.thermostat.shared.locale.LocalizedString; import com.redhat.thermostat.shared.locale.Translate; import com.redhat.thermostat.vm.profiler.client.core.ProfilingResult; import com.redhat.thermostat.vm.profiler.client.core.ProfilingResult.MethodInfo; @@ -133,12 +134,25 @@ private JPanel createActionsPanel() { GridBagConstraints constraints = new GridBagConstraints(); constraints.fill = GridBagConstraints.HORIZONTAL; + constraints.anchor = GridBagConstraints.PAGE_START; constraints.weightx = 1.0; - + constraints.gridy = 0; + constraints.gridx = 0; + constraints.gridwidth = 3; + constraints.ipady = 5; + + String wrappedText = "" + translator.localize(LocaleResources.PROFILER_DESCRIPTION).getContents() + ""; + JLabel descriptionLabel = new JLabel(wrappedText); + actionsPanel.add(descriptionLabel, constraints); + + constraints.gridy = 1; + constraints.gridx = 0; + constraints.gridwidth = 1; currentStatusLabel = new JLabel("Current Status: {0}"); actionsPanel.add(currentStatusLabel, constraints); constraints.fill = GridBagConstraints.NONE; + constraints.gridx = GridBagConstraints.RELATIVE; constraints.weightx = 0.0; startButton = new JToggleButton(translator.localize(LocaleResources.START_PROFILING).getContents()); startButton.addActionListener(new java.awt.event.ActionListener() { diff --git a/vm-profiler/client-swing/src/main/resources/com/redhat/thermostat/vm/profiler/client/swing/internal/strings.properties b/vm-profiler/client-swing/src/main/resources/com/redhat/thermostat/vm/profiler/client/swing/internal/strings.properties index a5261edd0..c27fa603a 100644 --- a/vm-profiler/client-swing/src/main/resources/com/redhat/thermostat/vm/profiler/client/swing/internal/strings.properties +++ b/vm-profiler/client-swing/src/main/resources/com/redhat/thermostat/vm/profiler/client/swing/internal/strings.properties @@ -1,6 +1,9 @@ PROFILER_TAB_NAME = Profiler PROFILER_HEADING = JVM Profiler +PROFILER_DESCRIPTION = Instrument and profile a JVM. \ + Profiling results will be displayed when the profiling session is stopped or when the profiled JVM exits. \ + JRE/JDK packages are not included in the timing measurements. PROFILER_CURRENT_STATUS_ACTIVE = Currently profiling: yes PROFILER_CURRENT_STATUS_INACTIVE = Currently profiling: no