Java Code Examples for org.eclipse.swt.SWT#getPlatform()
The following examples show how to use
org.eclipse.swt.SWT#getPlatform() .
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: SwtUtils.java From http4e with Apache License 2.0 | 6 votes |
public static boolean isMac(){ String platform = SWT.getPlatform(); if ("carbon".equals(platform) || "cocoa".equals(platform)) { return true; } // if ("win32".equals(platform) || "wpf".equals(platform)) { // // className = "org.eclipse.swt.browser.IE"; // } else if ("motif".equals(platform)) { // // className = "org.eclipse.swt.browser.Mozilla"; // } else if ("gtk".equals(platform)) { // // className = "org.eclipse.swt.browser.Mozilla"; // } else if ("carbon".equals(platform) || "cocoa".equals(platform)) { // // className = "org.eclipse.swt.browser.Safari"; // return true; // } else if ("photon".equals(platform)) { // // className = "org.eclipse.swt.browser.Voyager"; // } else { // // dispose (); // // SWT.error (SWT.ERROR_NO_HANDLES); // } return false; }
Example 2
Source File: SwtUtils.java From http4e with Apache License 2.0 | 5 votes |
public static boolean isWindows(){ String platform = SWT.getPlatform(); if ("win32".equals(platform) || "wpf".equals(platform)) { return true; } return false; }
Example 3
Source File: XtextDirectEditManager.java From statecharts with Eclipse Public License 1.0 | 5 votes |
/** * Performs show and sets the edit string to be the initial character or * string * * @param initialChar */ public void show(char initialChar) { initialString = initialString.append(initialChar); show(); if (SWT.getPlatform() != "carbon") { //$NON-NLS-1$ // Set the cell editor text to the initial character setEditText(initialString.toString()); } }
Example 4
Source File: ChartUIUtil.java From birt with Eclipse Public License 1.0 | 5 votes |
private static boolean isWindows( ) { String platform = SWT.getPlatform( ); if ( "win32".equals( platform ) ) //$NON-NLS-1$ { return true; } return false; }
Example 5
Source File: ImageLabel.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * Check the style bits to ensure that no invalid styles are applied. */ private static int checkStyle( int style ) { if ( ( style & SWT.BORDER ) != 0 ) style |= SWT.SHADOW_IN; int mask = SWT.SHADOW_IN | SWT.SHADOW_OUT | SWT.SHADOW_NONE | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; style = style & mask; style |= SWT.NO_FOCUS; if ( ( style & ( SWT.CENTER | SWT.RIGHT ) ) == 0 ) style |= SWT.LEFT; // TEMPORARY CODE /* * The default background on carbon and some GTK themes is not a solid * color but a texture. To show the correct default background, we must * allow the operating system to draw it and therefore, we can not use * the NO_BACKGROUND style. The NO_BACKGROUND style is not required on * platforms that use double buffering which is true in both of these * cases. */ String platform = SWT.getPlatform( ); if ( "carbon".equals( platform ) || "gtk".equals( platform ) )return style; //$NON-NLS-1$ //$NON-NLS-2$ return style | SWT.NO_BACKGROUND; }
Example 6
Source File: ClientOS.java From swt-bling with MIT License | 5 votes |
public static boolean isWindows7() { boolean windows7 = false; String swtPlatform = SWT.getPlatform(); if(swtPlatform.equals("win32")) { double version; try { version = Float.parseFloat(System.getProperty("os.version")); //Windows 7 is internally identified as 6.1 windows7 = version <= 6.1; } catch (NumberFormatException ex) { windows7 = true; } } return windows7; }
Example 7
Source File: ClientOS.java From swt-bling with MIT License | 5 votes |
public static boolean isWindows() { boolean windows = false; String swtPlatform = SWT.getPlatform(); if(swtPlatform.equals("win32")) { windows = true; } return windows; }
Example 8
Source File: OsHelper.java From hop with Apache License 2.0 | 4 votes |
public static final boolean isWindows() { final String ws = SWT.getPlatform(); return WS_WIN32.equals( ws ) || WS_WPF.equals( ws ); }
Example 9
Source File: OsHelper.java From hop with Apache License 2.0 | 4 votes |
public static final boolean isMac() { final String ws = SWT.getPlatform(); return WS_CARBON.equals( ws ) || WS_COCOA.equals( ws ); }
Example 10
Source File: KbaBootstrapper.java From workspacemechanic with Eclipse Public License 1.0 | 4 votes |
public KbaBootstrapper() { this(MechanicLog.getDefault(), (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class), SWT.getPlatform()); }
Example 11
Source File: SwtBotTestingUtilities.java From google-cloud-eclipse with Apache License 2.0 | 4 votes |
/** * Return true if the operating system is Mac. */ public static boolean isMac() { String platform = SWT.getPlatform(); return ("carbon".equals(platform) || "cocoa".equals(platform)); }
Example 12
Source File: SwtBotUtils.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 4 votes |
/** * @return true if the operating system is Mac */ public static boolean isMac() { String platform = SWT.getPlatform(); return ("carbon".equals(platform) || "cocoa".equals(platform)); }
Example 13
Source File: OsHelper.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public static final boolean isWindows() { final String ws = SWT.getPlatform(); return WS_WIN32.equals( ws ) || WS_WPF.equals( ws ); }
Example 14
Source File: OsHelper.java From pentaho-kettle with Apache License 2.0 | 4 votes |
public static final boolean isMac() { final String ws = SWT.getPlatform(); return WS_CARBON.equals( ws ) || WS_COCOA.equals( ws ); }