public static IVMInstall getVMInstall(ILaunchConfiguration configuration) throws CoreException { String jre = configuration.getAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null); IVMInstall vm = null; if (jre == null) { String name = configuration.getAttribute(IPDELauncherConstants.VMINSTALL, (String) null); if (name == null) { name = getDefaultVMInstallName(configuration); } vm = getVMInstall(name); if (vm == null) { throw new CoreException( LauncherUtils.createErrorStatus( NLS.bind(MDEMessages.WorkbenchLauncherConfigurationDelegate_noJRE, name))); } } else { IPath jrePath = Path.fromPortableString(jre); vm = JavaRuntime.getVMInstall(jrePath); if (vm == null) { String id = JavaRuntime.getExecutionEnvironmentId(jrePath); if (id == null) { String name = JavaRuntime.getVMInstallName(jrePath); throw new CoreException( LauncherUtils.createErrorStatus( NLS.bind(MDEMessages.WorkbenchLauncherConfigurationDelegate_noJRE, name))); } throw new CoreException( LauncherUtils.createErrorStatus(NLS.bind(MDEMessages.VMHelper_cannotFindExecEnv, id))); } } return vm; }
/** SIM has changed */ public void handleSimHasChanged() { if (logger.isActivated()) { logger.debug("Handle SIM has changed"); } // Restart the RCS service LauncherUtils.stopRcsService(getApplicationContext()); LauncherUtils.launchRcsService(getApplicationContext(), true, false); }
public void setUrl(String url) { int id = R.drawable.history_browser_item_indicator; if (LauncherUtils.isMapsURL(url)) { id = R.drawable.history_maps_item_indicator; } else if (LauncherUtils.isYouTubeURL(url)) { id = R.drawable.history_yt_item_indicator; } Drawable icon = mContext.getResources().getDrawable(id); mImageView.setImageDrawable(icon); mUrlText.setText(ellipsis(url)); }
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { LauncherUtils.logError(e); } SwingUtilities.invokeLater( new Runnable() { @Override public void run() { try { JFrame frame = new JFrame(); frame.setResizable(false); frame.setTitle(AllSettings.lname); frame.setSize(AllSettings.w, AllSettings.h); frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setUndecorated(true); frame.setIconImage(ImageIO.read(GUI.class.getResourceAsStream(AllSettings.icon))); GUI gui = new GUI(frame); gui.setVisible(true); frame.add(gui); frame.setVisible(true); } catch (Exception e) { LauncherUtils.logError(e); } } }); }
public static IVMInstall createLauncher(ILaunchConfiguration configuration) throws CoreException { IVMInstall launcher = getVMInstall(configuration); if (!launcher.getInstallLocation().exists()) throw new CoreException( LauncherUtils.createErrorStatus( MDEMessages.WorkbenchLauncherConfigurationDelegate_jrePathNotFound)); return launcher; }
/** change the network settings to enable use of our proxy */ public void changeNetworkSettings() { if (networkService == null) { getCurrentNetworkSettings(); } customProxyPACDir = LauncherUtils.createCustomProfileDir(sessionId); if (customProxyPACDir.exists()) { FileHandler.delete(customProxyPACDir); } customProxyPACDir.mkdir(); log.info("Modifying OS X global network settings..."); // TODO Disable proxy PAC URL (or, even better, use one!) SRC-364 runNetworkSetup("-setwebproxy", networkService, "localhost", "" + port); runNetworkSetup("-setproxybypassdomains", networkService, "Empty"); }
@Override protected void launch(String url) { final String fileUrl; String query; query = LauncherUtils.getQueryString(url); query += "&driverUrl=http://localhost:" + getPort() + "/selenium-server/driver/"; try { if (SeleniumServer.isEnsureCleanSession()) { ensureCleanSession(); } fileUrl = createExtractedFiles().toURL() + "?" + query; launchSafari(fileUrl); } catch (IOException e) { throw new RuntimeException(e); } }
/* * (non-Javadoc) * @see org.eclipse.pde.ui.launcher.AbstractPDELaunchConfiguration#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, org.eclipse.debug.core.ILaunch, org.eclipse.core.runtime.IProgressMonitor) */ protected void preLaunchCheck( ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor) throws CoreException { fModels = BundleLauncherHelper.getMergedBundleMap(configuration, true); fAllBundles = new HashMap(fModels.size()); Iterator iter = fModels.keySet().iterator(); while (iter.hasNext()) { IMonitorModelBase model = (IMonitorModelBase) iter.next(); fAllBundles.put(model.getMonitorBase().getId(), model); } if (!fAllBundles.containsKey(IPDEBuildConstants.BUNDLE_OSGI)) { // implicitly add it IMonitorModelBase model = MonitorRegistry.findModel(IPDEBuildConstants.BUNDLE_OSGI); if (model != null) { fModels.put(model, "default:default"); // $NON-NLS-1$ fAllBundles.put(IPDEBuildConstants.BUNDLE_OSGI, model); } else { String message = MDEMessages.EquinoxLaunchConfiguration_oldTarget; throw new CoreException(LauncherUtils.createErrorStatus(message)); } } super.preLaunchCheck(configuration, launch, monitor); }
public void tearDown() { LauncherUtils.recursivelyDeleteDir(parentDir); }
public void setUp() { parentDir = LauncherUtils.createCustomProfileDir("LauncherUtilsUnitTest"); pacFile = new File(parentDir, "proxy.pac"); }