@Test public void testAddHelpLinkToPanel() { System.out.println("addHelpLinkToPanel"); VerticalPanel titlePanel = new VerticalPanel(); titlePanel.add(new JLabel("title")); VerticalPanel contentPanel = new VerticalPanel(); contentPanel.setBorder(BorderFactory.createEtchedBorder()); contentPanel.add(new JPanel()); contentPanel.add(new JPanel()); contentPanel.setName("THIS"); titlePanel.add(contentPanel); String helpPage = ""; Component result = JMeterPluginsUtils.addHelpLinkToPanel(titlePanel, helpPage); assertNotNull(result); }
public static Component addHelpLinkToPanel(Container panel, String helpPage) { if (!java.awt.Desktop.isDesktopSupported()) { return panel; } JLabel icon = new JLabel(); icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))); JLabel link = new JLabel("Help on this plugin"); link.setForeground(Color.blue); link.setFont(link.getFont().deriveFont(Font.PLAIN)); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new URIOpener(buildHelpPageUrl(helpPage))); Border border = BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.blue); link.setBorder(border); JLabel version = new JLabel(""); version.setFont(version.getFont().deriveFont(Font.PLAIN).deriveFont(11F)); version.setForeground(Color.GRAY); Container innerPanel = findComponentWithBorder((JComponent) panel, EtchedBorder.class); JPanel panelLink = new JPanel(new GridBagLayout()); GridBagConstraints gridBagConstraints; gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0); panelLink.add(icon, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 2, 3, 0); panelLink.add(link, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4); panelLink.add(version, gridBagConstraints); if (innerPanel != null) { innerPanel.add(panelLink); } else { panel.add(panelLink); } return panel; }
JMeterPluginsUtils { public static Component addHelpLinkToPanel(Container panel, String helpPage) { if (!java.awt.Desktop.isDesktopSupported()) { return panel; } JLabel icon = new JLabel(); icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))); JLabel link = new JLabel("Help on this plugin"); link.setForeground(Color.blue); link.setFont(link.getFont().deriveFont(Font.PLAIN)); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new URIOpener(buildHelpPageUrl(helpPage))); Border border = BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.blue); link.setBorder(border); JLabel version = new JLabel(""); version.setFont(version.getFont().deriveFont(Font.PLAIN).deriveFont(11F)); version.setForeground(Color.GRAY); Container innerPanel = findComponentWithBorder((JComponent) panel, EtchedBorder.class); JPanel panelLink = new JPanel(new GridBagLayout()); GridBagConstraints gridBagConstraints; gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0); panelLink.add(icon, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 2, 3, 0); panelLink.add(link, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4); panelLink.add(version, gridBagConstraints); if (innerPanel != null) { innerPanel.add(panelLink); } else { panel.add(panelLink); } return panel; } }
JMeterPluginsUtils { public static Component addHelpLinkToPanel(Container panel, String helpPage) { if (!java.awt.Desktop.isDesktopSupported()) { return panel; } JLabel icon = new JLabel(); icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))); JLabel link = new JLabel("Help on this plugin"); link.setForeground(Color.blue); link.setFont(link.getFont().deriveFont(Font.PLAIN)); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new URIOpener(buildHelpPageUrl(helpPage))); Border border = BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.blue); link.setBorder(border); JLabel version = new JLabel(""); version.setFont(version.getFont().deriveFont(Font.PLAIN).deriveFont(11F)); version.setForeground(Color.GRAY); Container innerPanel = findComponentWithBorder((JComponent) panel, EtchedBorder.class); JPanel panelLink = new JPanel(new GridBagLayout()); GridBagConstraints gridBagConstraints; gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0); panelLink.add(icon, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 2, 3, 0); panelLink.add(link, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4); panelLink.add(version, gridBagConstraints); if (innerPanel != null) { innerPanel.add(panelLink); } else { panel.add(panelLink); } return panel; }  }
JMeterPluginsUtils { public static Component addHelpLinkToPanel(Container panel, String helpPage) { if (!java.awt.Desktop.isDesktopSupported()) { return panel; } JLabel icon = new JLabel(); icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))); JLabel link = new JLabel("Help on this plugin"); link.setForeground(Color.blue); link.setFont(link.getFont().deriveFont(Font.PLAIN)); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new URIOpener(buildHelpPageUrl(helpPage))); Border border = BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.blue); link.setBorder(border); JLabel version = new JLabel(""); version.setFont(version.getFont().deriveFont(Font.PLAIN).deriveFont(11F)); version.setForeground(Color.GRAY); Container innerPanel = findComponentWithBorder((JComponent) panel, EtchedBorder.class); JPanel panelLink = new JPanel(new GridBagLayout()); GridBagConstraints gridBagConstraints; gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0); panelLink.add(icon, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 2, 3, 0); panelLink.add(link, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4); panelLink.add(version, gridBagConstraints); if (innerPanel != null) { innerPanel.add(panelLink); } else { panel.add(panelLink); } return panel; }  static String prefixLabel(String label); static String getStackTrace(Exception ex); static CollectionProperty tableModelRowsToCollectionProperty(PowerTableModel model, String propname); static CollectionProperty tableModelRowsToCollectionPropertyEval(PowerTableModel model, String propname); static void collectionPropertyToTableModelRows(CollectionProperty prop, PowerTableModel model); static void collectionPropertyToTableModelRows(CollectionProperty prop, PowerTableModel model, Class[] columnClasses); static String replaceRNT(String str); static String getWikiLinkText(String wikiPage); static String buildHelpPageUrl(String helpPage); static Component addHelpLinkToPanel(Container panel, String helpPage); static void doBestCSVSetup(SampleSaveConfiguration conf); static void openInBrowser(String string); static float getFloatFromString(String stringValue, float defaultValue); static int getSecondsForShortString(String string); static String getVersion(); static String getEnvDefault(String propName, String defaultVal); static void prepareJMeterEnv(String homeDir); static String getJMeterHomeFromCP(String classpathSTR); static String getShortHostname(String host); }
JMeterPluginsUtils { public static Component addHelpLinkToPanel(Container panel, String helpPage) { if (!java.awt.Desktop.isDesktopSupported()) { return panel; } JLabel icon = new JLabel(); icon.setIcon(new javax.swing.ImageIcon(JMeterPluginsUtils.class.getResource("vizualizers/information.png"))); JLabel link = new JLabel("Help on this plugin"); link.setForeground(Color.blue); link.setFont(link.getFont().deriveFont(Font.PLAIN)); link.setCursor(new Cursor(Cursor.HAND_CURSOR)); link.addMouseListener(new URIOpener(buildHelpPageUrl(helpPage))); Border border = BorderFactory.createMatteBorder(0, 0, 1, 0, java.awt.Color.blue); link.setBorder(border); JLabel version = new JLabel(""); version.setFont(version.getFont().deriveFont(Font.PLAIN).deriveFont(11F)); version.setForeground(Color.GRAY); Container innerPanel = findComponentWithBorder((JComponent) panel, EtchedBorder.class); JPanel panelLink = new JPanel(new GridBagLayout()); GridBagConstraints gridBagConstraints; gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 0); panelLink.add(icon, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 1; gridBagConstraints.gridy = 0; gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST; gridBagConstraints.weightx = 1.0; gridBagConstraints.insets = new java.awt.Insets(0, 2, 3, 0); panelLink.add(link, gridBagConstraints); gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints.gridx = 2; gridBagConstraints.gridy = 0; gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4); panelLink.add(version, gridBagConstraints); if (innerPanel != null) { innerPanel.add(panelLink); } else { panel.add(panelLink); } return panel; }  static String prefixLabel(String label); static String getStackTrace(Exception ex); static CollectionProperty tableModelRowsToCollectionProperty(PowerTableModel model, String propname); static CollectionProperty tableModelRowsToCollectionPropertyEval(PowerTableModel model, String propname); static void collectionPropertyToTableModelRows(CollectionProperty prop, PowerTableModel model); static void collectionPropertyToTableModelRows(CollectionProperty prop, PowerTableModel model, Class[] columnClasses); static String replaceRNT(String str); static String getWikiLinkText(String wikiPage); static String buildHelpPageUrl(String helpPage); static Component addHelpLinkToPanel(Container panel, String helpPage); static void doBestCSVSetup(SampleSaveConfiguration conf); static void openInBrowser(String string); static float getFloatFromString(String stringValue, float defaultValue); static int getSecondsForShortString(String string); static String getVersion(); static String getEnvDefault(String propName, String defaultVal); static void prepareJMeterEnv(String homeDir); static String getJMeterHomeFromCP(String classpathSTR); static String getShortHostname(String host); static final String WIKI_BASE; static final String ENCODING; static final Charset CHARSET; }