| | |
| | | package org.opends.guitools.controlpanel.util; |
| | | |
| | | import static org.opends.messages.AdminToolMessages.*; |
| | | import static com.forgerock.opendj.util.OperatingSystem.isWindows; |
| | | import static com.forgerock.opendj.util.OperatingSystem.isMacOS; |
| | | |
| | | import java.awt.Color; |
| | | import java.awt.Component; |
| | |
| | | INFO_CTRL_PANEL_NOT_IMPLEMENTED.get(); |
| | | |
| | | /** |
| | | * Returns <CODE>true</CODE> if we are running Mac OS and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return <CODE>true</CODE> if we are running Mac OS and <CODE>false</CODE> |
| | | * otherwise. |
| | | */ |
| | | public static boolean isMacOS() |
| | | { |
| | | String os = System.getProperty("os.name").toLowerCase(); |
| | | return os.indexOf("mac") != -1; |
| | | } |
| | | |
| | | /** |
| | | * Creates a combo box. |
| | | * @return a combo box. |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns <CODE>true</CODE> if we are running Windows and <CODE>false</CODE> |
| | | * otherwise. |
| | | * @return <CODE>true</CODE> if we are running Windows and <CODE>false</CODE> |
| | | * otherwise. |
| | | */ |
| | | public static boolean isWindows() |
| | | { |
| | | String os = System.getProperty("os.name").toLowerCase(); |
| | | return os.indexOf("windows") != -1; |
| | | } |
| | | |
| | | /** |
| | | * Derives a color by adding the specified offsets to the base color's |
| | | * hue, saturation, and brightness values. The resulting hue, saturation, |
| | | * and brightness values will be contrained to be between 0 and 1. |
| | |
| | | final JTable table = new JTable(tableModel); |
| | | table.setShowGrid(true); |
| | | table.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS); |
| | | boolean isMacOS = Utilities.isMacOS(); |
| | | table.setGridColor(ColorAndFontConstants.gridColor); |
| | | if (isMacOS) |
| | | if (isMacOS()) |
| | | { |
| | | table.getTableHeader().setBorder( |
| | | BorderFactory.createMatteBorder(1, 1, 0, 0, |
| | | ColorAndFontConstants.gridColor)); |
| | | } |
| | | if (Utilities.isWindows()) |
| | | if (isWindows()) |
| | | { |
| | | table.getTableHeader().setBorder( |
| | | BorderFactory.createMatteBorder(1, 1, 0, 1, |