org.apache.jorphan.gui

## Class GuiUtils

- java.lang.Object
- - org.apache.jorphan.gui.GuiUtils

-     public final class GuiUtils
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `GuiUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `cancelEditing(javax.swing.JTable table)` cancel any editing that is currently being done on the table.
    `static void` | `copyTextToClipboard(java.lang.String text)` Copy text to clipboard
    `static javax.swing.JComponent` | `createLabelCombo(java.lang.String label, javax.swing.JComboBox<?> comboBox)` Create a GUI component JLabel + JComboBox with a left and right margin (5px)
    `static void` | `fixSize(javax.swing.table.TableColumn column, javax.swing.JTable table)` Fix the size of a column according to the header text.
    `static java.lang.String` | `getPastedText()` Get pasted text from clipboard
    `static void` | `makeScrollableMenu(javax.swing.JMenu menu)` Make menu scrollable
    `static javax.swing.JScrollPane` | `makeScrollPane(java.awt.Component comp)` Create a scroll panel that sets its preferred size to its minimum size.
    `static void` | `stopTableEditing(javax.swing.JTable table)` Stop any editing that is currently being done on the table.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### GuiUtils

          public GuiUtils()

  - ### Method Detail

    - #### makeScrollPane

          public static javax.swing.JScrollPane makeScrollPane(java.awt.Component comp)

      Create a scroll panel that sets its preferred size to its minimum size. Explicitly for scroll panes that live inside other scroll panes, or within containers that stretch components to fill the area they exist in. Use this for any component you would put in a scroll pane (such as TextAreas, tables, JLists, etc). It is here for convenience and to avoid duplicate code. JMeter displays best if you follow this custom.
      Parameters:
        `comp` - the component which should be placed inside the scroll pane
      Returns:
        a JScrollPane containing the specified component

    - #### fixSize

          public static void fixSize(javax.swing.table.TableColumn column,
                                     javax.swing.JTable table)

      Fix the size of a column according to the header text.
      Parameters:
        `column` - to be resized
        `table` - containing the column

    - #### createLabelCombo

          public static javax.swing.JComponent createLabelCombo(java.lang.String label,
                                                                javax.swing.JComboBox<?> comboBox)

      Create a GUI component JLabel + JComboBox with a left and right margin (5px)
      Parameters:
        `label` - the label
        `comboBox` - the combo box
      Returns:
        the JComponent (margin+JLabel+margin+JComboBox)

    - #### stopTableEditing

          public static void stopTableEditing(javax.swing.JTable table)

      Stop any editing that is currently being done on the table. This will save any changes that have already been made.
      Parameters:
        `table` - the table to stop on editing

    - #### cancelEditing

          public static void cancelEditing(javax.swing.JTable table)

      cancel any editing that is currently being done on the table.
      Parameters:
        `table` - the table to cancel on editing
      Since:
        3.1

    - #### getPastedText

          public static java.lang.String getPastedText()
                                                throws java.awt.datatransfer.UnsupportedFlavorException,
                                                       java.io.IOException

      Get pasted text from clipboard
      Returns:
        String Pasted text
      Throws:
        `java.awt.datatransfer.UnsupportedFlavorException` - if the clipboard data can not be get as a `String`
        `java.io.IOException` - if the clipboard data is no longer available

    - #### makeScrollableMenu

          public static void makeScrollableMenu(javax.swing.JMenu menu)

      Make menu scrollable
      Parameters:
        `menu` - `JMenu`

    - #### copyTextToClipboard

          public static final void copyTextToClipboard(java.lang.String text)

      Copy text to clipboard
      Parameters:
        `text` - Text to copy

Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.