Java Code Examples for org.apache.commons.lang.SystemUtils#IS_OS_MAC

The following examples show how to use org.apache.commons.lang.SystemUtils#IS_OS_MAC . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NetUtils.java    From cosmic with Apache License 2.0 6 votes vote down vote up
public static String getDefaultEthDevice() {
    if (SystemUtils.IS_OS_MAC) {
        final String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'");
        return defDev;
    }
    final String defaultRoute = Script.runSimpleBashScript("/sbin/route | grep default");

    if (defaultRoute == null) {
        return null;
    }

    final String[] defaultRouteList = defaultRoute.split("\\s+");

    if (defaultRouteList.length != 8) {
        return null;
    }

    return defaultRouteList[7];
}
 
Example 2
Source File: LanguageServerLauncher.java    From solidity-ide with Eclipse Public License 1.0 5 votes vote down vote up
private static CharSequence getOS() {
	if (SystemUtils.IS_OS_LINUX) {
		return "linux";
	} else if (SystemUtils.IS_OS_WINDOWS) {
		return "win32";
	} else if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_MAC_OSX) {
		return "macosx";
	} else {
		throw new IllegalArgumentException("Unsupported OS");
	}
}
 
Example 3
Source File: Utils.java    From netbeans-mmd-plugin with Apache License 2.0 5 votes vote down vote up
/**
 * Get default render quality for host OS.
 *
 * @return the render quality for host OS, must not be null
 * @since 1.4.5
 */
@Nonnull
public static RenderQuality getDefaultRenderQialityForOs() {
  RenderQuality result = RenderQuality.DEFAULT;
  if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) {
    result = RenderQuality.QUALITY;
  }
  return result;
}
 
Example 4
Source File: MountableFile.java    From testcontainers-java with MIT License 5 votes vote down vote up
private File createTempDirectory() {
    try {
        if (SystemUtils.IS_OS_MAC) {
            return Files.createTempDirectory(Paths.get(OS_MAC_TMP_DIR), TESTCONTAINERS_TMP_DIR_PREFIX).toFile();
        }
        return Files.createTempDirectory(TESTCONTAINERS_TMP_DIR_PREFIX).toFile();
    } catch  (IOException e) {
        return new File(TESTCONTAINERS_TMP_DIR_PREFIX + Base58.randomString(5));
    }
}
 
Example 5
Source File: NetUtils.java    From cloudstack with Apache License 2.0 5 votes vote down vote up
public static String getDefaultEthDevice() {
    if (SystemUtils.IS_OS_MAC) {
        final String defDev = Script.runSimpleBashScript("/sbin/route -n get default 2> /dev/null | grep interface | awk '{print $2}'");
        return defDev;
    }
    return Script.runSimpleBashScript("ip route show default 0.0.0.0/0 | head -1 | awk '{print $5}'");
}
 
Example 6
Source File: MindMapPanelConfig.java    From netbeans-mmd-plugin with Apache License 2.0 4 votes vote down vote up
public MindMapPanelConfig() {
  if (SystemUtils.IS_OS_MAC) {
    // key map for MAC
    this.mapShortCut.put(KEY_ADD_CHILD_AND_START_EDIT, new KeyShortcut(KEY_ADD_CHILD_AND_START_EDIT, KeyEvent.VK_TAB, 0));
    this.mapShortCut.put(KEY_ADD_SIBLING_AND_START_EDIT, new KeyShortcut(KEY_ADD_SIBLING_AND_START_EDIT, KeyEvent.VK_ENTER, 0));
    this.mapShortCut.put(KEY_CANCEL_EDIT, new KeyShortcut(KEY_CANCEL_EDIT, KeyEvent.VK_ESCAPE, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD, new KeyShortcut(KEY_TOPIC_FOLD, KeyEvent.VK_MINUS, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD_ALL, new KeyShortcut(KEY_TOPIC_FOLD_ALL, KeyEvent.VK_MINUS, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD, new KeyShortcut(KEY_TOPIC_UNFOLD, KeyEvent.VK_EQUALS, 0));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD_ALL, new KeyShortcut(KEY_TOPIC_UNFOLD_ALL, KeyEvent.VK_EQUALS, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_FOCUS_ROOT_OR_START_EDIT, new KeyShortcut(KEY_FOCUS_ROOT_OR_START_EDIT, KeyEvent.VK_SPACE, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN, new KeyShortcut(KEY_FOCUS_MOVE_DOWN, KeyEvent.VK_DOWN, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP, new KeyShortcut(KEY_FOCUS_MOVE_UP, KeyEvent.VK_UP, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT, new KeyShortcut(KEY_FOCUS_MOVE_LEFT, KeyEvent.VK_LEFT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT, KeyEvent.VK_RIGHT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, KeyEvent.VK_UP, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_DELETE_TOPIC, new KeyShortcut(KEY_DELETE_TOPIC, KeyEvent.VK_DELETE, 0));
    this.mapShortCut.put(KEY_TOPIC_TEXT_NEXT_LINE, new KeyShortcut(KEY_TOPIC_TEXT_NEXT_LINE, KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_ZOOM_IN, new KeyShortcut(KEY_ZOOM_IN, KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_OUT, new KeyShortcut(KEY_ZOOM_OUT, KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_RESET, new KeyShortcut(KEY_ZOOM_RESET, KeyEvent.VK_0, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_SHOW_POPUP, new KeyShortcut(KEY_SHOW_POPUP, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK));
  } else {
    // key map for Linux and Windows
    this.mapShortCut.put(KEY_ADD_CHILD_AND_START_EDIT, new KeyShortcut(KEY_ADD_CHILD_AND_START_EDIT, KeyEvent.VK_TAB, 0));
    this.mapShortCut.put(KEY_ADD_SIBLING_AND_START_EDIT, new KeyShortcut(KEY_ADD_SIBLING_AND_START_EDIT, KeyEvent.VK_ENTER, 0));
    this.mapShortCut.put(KEY_CANCEL_EDIT, new KeyShortcut(KEY_CANCEL_EDIT, KeyEvent.VK_ESCAPE, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD, new KeyShortcut(KEY_TOPIC_FOLD, KeyEvent.VK_MINUS, 0));
    this.mapShortCut.put(KEY_TOPIC_FOLD_ALL, new KeyShortcut(KEY_TOPIC_FOLD_ALL, KeyEvent.VK_MINUS, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD, new KeyShortcut(KEY_TOPIC_UNFOLD, KeyEvent.VK_EQUALS, 0));
    this.mapShortCut.put(KEY_TOPIC_UNFOLD_ALL, new KeyShortcut(KEY_TOPIC_UNFOLD_ALL, KeyEvent.VK_EQUALS, KeyEvent.ALT_MASK));
    this.mapShortCut.put(KEY_FOCUS_ROOT_OR_START_EDIT, new KeyShortcut(KEY_FOCUS_ROOT_OR_START_EDIT, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN, new KeyShortcut(KEY_FOCUS_MOVE_DOWN, KeyEvent.VK_DOWN, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP, new KeyShortcut(KEY_FOCUS_MOVE_UP, KeyEvent.VK_UP, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT, new KeyShortcut(KEY_FOCUS_MOVE_LEFT, KeyEvent.VK_LEFT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT, KeyEvent.VK_RIGHT, 0));
    this.mapShortCut.put(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_DOWN_ADD_FOCUSED, KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_UP_ADD_FOCUSED, KeyEvent.VK_UP, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_LEFT_ADD_FOCUSED, KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, new KeyShortcut(KEY_FOCUS_MOVE_RIGHT_ADD_FOCUSED, KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_DELETE_TOPIC, new KeyShortcut(KEY_DELETE_TOPIC, KeyEvent.VK_DELETE, 0));
    this.mapShortCut.put(KEY_TOPIC_TEXT_NEXT_LINE, new KeyShortcut(KEY_TOPIC_TEXT_NEXT_LINE, KeyEvent.VK_ENTER, KeyEvent.SHIFT_MASK));
    this.mapShortCut.put(KEY_ZOOM_IN, new KeyShortcut(KEY_ZOOM_IN, KeyEvent.VK_PLUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_OUT, new KeyShortcut(KEY_ZOOM_OUT, KeyEvent.VK_MINUS, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_ZOOM_RESET, new KeyShortcut(KEY_ZOOM_RESET, KeyEvent.VK_0, KeyEvent.CTRL_MASK));
    this.mapShortCut.put(KEY_SHOW_POPUP, new KeyShortcut(KEY_SHOW_POPUP, KeyEvent.VK_SPACE, KeyEvent.CTRL_MASK | KeyEvent.ALT_MASK));
  }
}
 
Example 7
Source File: IngestRunnerTest.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}
 
Example 8
Source File: RasterIngestRunnerTest.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}
 
Example 9
Source File: IngestRunnerTest.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}
 
Example 10
Source File: RasterIngestRunnerTest.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}
 
Example 11
Source File: LandsatIT.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}
 
Example 12
Source File: CustomCRSLandsatIT.java    From geowave with Apache License 2.0 4 votes vote down vote up
private static boolean isNotMac() {
  return !SystemUtils.IS_OS_MAC;
}