Open app page at Google Play

@param context       Application context
@param openInBrowser Should we try to open application page in web browser
if Play Store app not found on device
963730
public static Intent openPlayStore(Context context, boolean openInBrowser) {
        String appPackageName = context.getPackageName();
        Intent marketIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName));
        if (isIntentAvailable(context, marketIntent)) {
            return marketIntent;
        }
        if (openInBrowser) {
            return openLink("https://play.google.com/store/apps/details?id=" + appPackageName);
        }
        return marketIntent;
    }
1061769
void openExplorerForParent(String rootPath, String uuid) {

        String parentPath = CmsResource.getParentFolder(rootPath);

        CmsAppWorkplaceUi.get().getNavigator().navigateTo(
            CmsFileExplorerConfiguration.APP_ID
                + "/"
                + A_CmsUI.getCmsObject().getRequestContext().getCurrentProject().getUuid()
                + "!!"
                + A_CmsUI.getCmsObject().getRequestContext().getSiteRoot()
                + "!!"
                + parentPath.substring(A_CmsUI.getCmsObject().getRequestContext().getSiteRoot().length())
                + "!!"
                + uuid
                + "!!");
    }
593124
function(options)
	{
		options = conbo.clone(options || {});
		options.app = this;
		
		this.context = new this.contextClass(options);
	}
1179872
void openExplorerForParent(String rootPath, String uuid) {

        String parentPath = CmsResource.getParentFolder(rootPath);

        if (!rootPath.startsWith(m_cms.getRequestContext().getSiteRoot())) {
            m_cms.getRequestContext().setSiteRoot("");
        }

        CmsAppWorkplaceUi.get().getNavigator().navigateTo(
            CmsFileExplorerConfiguration.APP_ID
                + "/"
                + m_cms.getRequestContext().getCurrentProject().getUuid()
                + "!!"
                + m_cms.getRequestContext().getSiteRoot()
                + "!!"
                + parentPath.substring(m_cms.getRequestContext().getSiteRoot().length())
                + "!!"
                + uuid
                + "!!");
    }
799956
function softwareUpdate_openDialog(browserController) {
    // XXX: After Firefox 4 has been released and we do not have to test any
    // beta release anymore uncomment out the following code

    // With version >= 4.0b7pre the update dialog is reachable from within the
    // about window now.
    var appVersion = utils.appInfo.version;

    if (this._vc.compare(appVersion, "4.0b7pre") >= 0) {
      // XXX: We can't open the about window, otherwise a parallel download of
      // the update will let us fallback to a complete one all the time

      // Open the about window and check the update button
      //var aboutItem = new elementslib.Elem(browserController.menus.helpMenu.aboutName);
      //browserController.click(aboutItem);
      //
      //utils.handleWindow("type", "Browser:About", function(controller) {
      //  // XXX: Bug 599290 - Check for updates has been completely relocated
      //  // into the about window. We can't check the in-about ui yet.
      //  var updateButton = new elementslib.ID(controller.window.document,
      //                                        "checkForUpdatesButton");
      //  //controller.click(updateButton);
      //  controller.waitForElement(updateButton, gTimeout);
      //});

      // For now just call the old ui until we have support for the about window.
      var updatePrompt = Cc["@mozilla.org/updates/update-prompt;1"].
                         createInstance(Ci.nsIUpdatePrompt);
      updatePrompt.checkForUpdates();
    } else {
      // For builds <4.0b7pre
      updateItem = new elementslib.Elem(browserController.menus.helpMenu.checkForUpdates);
      browserController.click(updateItem);
    }

    this.waitForDialogOpen(browserController);
  }
668423
private static boolean openBrowserJava6(String url) throws Exception {
        final Class<?> desktopClass;
        try {
            desktopClass = Class.forName("java.awt.Desktop");
        } catch (ClassNotFoundException e) {
            return false;
        }
        Boolean supported = (Boolean) desktopClass.getMethod("isDesktopSupported", new Class[0]).invoke(null);
        if (supported) {
            Object desktop = desktopClass.getMethod("getDesktop", new Class[0]).invoke(null);
            desktopClass.getMethod("browse", new Class[]{URI.class}).invoke(desktop, new URI(url));
            return true;
        }
        return false;
    }
825796
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;

		if (servletContext == null)
			if (applicationContext instanceof WebApplicationContext) {
				servletContext = ((WebApplicationContext) applicationContext).getServletContext();
				if (servletContext == null) {
					System.err.print("this class only fit for Spring Web Application");
					return;
				}

			}

		// start up jdon
		AppContextWrapper acw = new ServletContextWrapper(servletContext);
		ContainerFinder containerFinder = new ContainerFinderImp();
		containerWrapper = containerFinder.findContainer(acw);

	}
1124668
public static ApplicationContext findApplicationContext(ServletContext servletContext) {
        if(servletContext == null) {
            return ContextLoader.getCurrentWebApplicationContext();
        }
        return WebApplicationContextUtils.getWebApplicationContext(servletContext);
    }
32797
public static XmlWebApplicationContext getAppContext(Page page) {
        return page == null ? null : (XmlWebApplicationContext) page.getAttribute(APP_CONTEXT_ATTRIB);
    }
1057320
public void addBrowser(DesiredCapabilities cap, int instances) {
    String s = cap.getBrowserName();
    if (s == null || "".equals(s)) {
      throw new InvalidParameterException(cap + " does seems to be a valid browser.");
    }
    if (cap.getPlatform() == null) {
      cap.setPlatform(Platform.getCurrent());
    }
    cap.setCapability(RegistrationRequest.MAX_INSTANCES, instances);
    registrationRequest.getConfiguration().capabilities.add(cap);
    registrationRequest.getConfiguration().fixUpCapabilities();
  }
468021
public static boolean isGoogleMapsV2Supported(final Context aContext) {
		try {
			// first check if Google Play Services is available
			int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(aContext);
			if (resultCode == ConnectionResult.SUCCESS) {
				// then check if OpenGL ES 2.0 is available
				final ActivityManager activityManager =
						(ActivityManager) aContext.getSystemService(Context.ACTIVITY_SERVICE);
				final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
				return configurationInfo.reqGlEsVersion >= 0x20000;
			}
		} catch (Throwable e) {
		}
		return false;
	}
1170722
func OpenBrowser(ctx context.Context, url string) error {
	var args []string
	switch runtime.GOOS {
	case "darwin":
		args = []string{"open"}
	case "windows":
		args = []string{"cmd", "/c", "start"}
	default:
		args = []string{"xdg-open"}
	}
	cmd := exec.CommandContext(ctx, args[0], append(args[1:], url)...)
	if b, err := cmd.CombinedOutput(); err != nil {
		return errors.Wrapf(err, "astiexec: opening browser failed with body %s", b)
	}
	return nil
}
714125
static void openURL(URL url) {
    if (Desktop.isDesktopSupported() 
        && Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) {
      try {
        Desktop.getDesktop().browse(url.toURI());
      } catch (Exception ex) {
        Tools.showError(ex);
      }
    } else if(SystemUtils.IS_OS_LINUX) {
      //handle the case where Desktop.browse() is not supported, e.g. kubuntu
      //without libgnome
      try {
        Runtime.getRuntime().exec(new String[] { "xdg-open", url.toString() });
      } catch (Exception ex) {
        Tools.showError(ex);
      }
    }
  }
929087
function openBrowser(url) {
  const { action, value } = getBrowserEnv();
  switch (action) {
    case Actions.NONE:
      // Special case: BROWSER="none" will prevent opening completely.
      return false;
    case Actions.SCRIPT:
      return executeNodeScript(value, url);
    case Actions.BROWSER:
      return startBrowserProcess(value, url);
    default:
      throw new Error('Not implemented.');
  }
}
1187090
protected void createWebAppContext() {
    webapp = new WebAppContext();
    webapp.setThrowUnavailableOnStartupException(true);
    webapp.setServerClasses(getServerClasses());
    webapp.setContextPath(getContextPath());
    webapp.setTempDirectory(createTempDir("jetty-app-"));
    setSecureCookies();
  }
488374
public static ImageLoader getLoader(Context context) {
        ImageLoader loader = (ImageLoader) context.getApplicationContext().getSystemService(IMAGE_LOADER_SERVICE);
        if (loader == null) {
            throw new IllegalStateException("ImageLoaderApplication not set as application class in" +
                    "AndroidManifest.xml");
        } else {
            return loader;
        }
    }
128474
protected boolean doesAppHasInternetPermission(Context context) {
        int result = context.checkCallingOrSelfPermission(Manifest.permission.INTERNET);
        boolean permissionGranted = (result == PackageManager.PERMISSION_GRANTED);

        if (!permissionGranted) {
            PrefHelper.Debug("Trouble executing your request. Please add 'android.permission.INTERNET' in your applications manifest file");
        }

        return result == PackageManager.PERMISSION_GRANTED;
    }