/** * Sets the PDE state. This method is meant to be called when the target platform * location changes. * * @param state the new state */ public void resetState(PDEState state) { if (fState != null && fState.equals(state)) return; // clear all models and add new ones int type = IModelProviderEvent.TARGET_CHANGED; IModel[] removed = fState.getTargetModels(); if (removed.length > 0) type |= IModelProviderEvent.MODELS_REMOVED; IModel[] added = state.getTargetModels(); if (added.length > 0) type |= IModelProviderEvent.MODELS_ADDED; modelsChanged(new ModelProviderEvent( state, type, added, removed, new IModel[0])); fireStateChanged(state); }
public IPluginModelBase findPluginInHost(String id) { if (registryPlugins == null) { URL[] pluginPaths = ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath(); PDEState state = new PDEState(pluginPaths, false, false, new NullProgressMonitor()); registryPlugins = state.getTargetModels(); } for (int i = 0; i < registryPlugins.length; i++) { if (registryPlugins[i].getPluginBase().getId().equals(id)) return registryPlugins[i]; } return null; }
public IPluginModelBase findPluginInHost(String id) { if (registryPlugins == null) { URL[] pluginPaths = ConfiguratorUtils.getCurrentPlatformConfiguration().getPluginPath(); PDEState state = new PDEState(pluginPaths, false, new NullProgressMonitor()); registryPlugins = state.getTargetModels(); } for (int i = 0; i < registryPlugins.length; i++) { if (registryPlugins[i].getPluginBase().getId().equals(id)) return registryPlugins[i]; } return null; }
private IPluginModelBase[] handlePluginSelection(PDEState state, Set optionalPlugins, Preferences pref, IProgressMonitor monitor) { List changed = new ArrayList(); boolean useAll = fTarget.useAllPlugins(); IPluginModelBase[] models = state.getTargetModels(); monitor.beginTask(PDECoreMessages.LoadTargetOperation_enablePluginsTaskName, models.length); boolean anyPluginsEnabled = false; for (int i = 0; i < models.length; i++) { String id = models[i].getBundleDescription().getSymbolicName(); if (models[i].isEnabled() != (useAll || optionalPlugins.contains(id) || fRequiredPlugins.containsKey(id))) { changed.add(models[i]); models[i].setEnabled(!models[i].isEnabled()); } fRequiredPlugins.remove(id); if (!anyPluginsEnabled) anyPluginsEnabled |= models[i].isEnabled(); monitor.worked(1); } if (useAll) pref.setValue(ICoreConstants.CHECKED_PLUGINS, ICoreConstants.VALUE_SAVED_ALL); else if (!anyPluginsEnabled) pref.setValue(ICoreConstants.CHECKED_PLUGINS, ICoreConstants.VALUE_SAVED_NONE); monitor.done(); return (IPluginModelBase[])changed.toArray(new IPluginModelBase[changed.size()]); }
IPluginModelBase[] models = state.getTargetModels(); List<IPluginModelBase> checkedModels = new ArrayList<>(checkedBundles.length); for (Object checkedBundle : checkedBundles) {
models = state.getTargetModels(); List<IPluginModelBase> sourceModels = new ArrayList<>(); List<TargetBundle> sourceBundles = new ArrayList<>();
fExternalManager.setModels(fState.getTargetModels()); addToTable(entries, fExternalManager.getAllModels()); System.out.println(fState.getTargetModels().length + " target models created in " + (System.currentTimeMillis() - startTargetModels) + " ms"); //$NON-NLS-1$ //$NON-NLS-2$
fExternalManager.initializeModels(fState.getTargetModels());
protected IStatus run(IProgressMonitor monitor) { EclipseHomeInitializer.resetEclipseHomeVariable(); PDECore.getDefault().getSourceLocationManager().reset(); PDECore.getDefault().getJavadocLocationManager().reset(); IPluginModelBase[] models = fState.getTargetModels(); removeDisabledBundles(models); PluginModelManager manager = PDECore.getDefault().getModelManager(); manager.getExternalModelManager().setModels(models); manager.resetState(fState); PDECore.getDefault().getFeatureModelManager().targetReloaded(); monitor.done(); return Status.OK_STATUS; }