/** * Returns <code>true</code> if neither the workspace nor target contains plug-ins; * <code>false</code> otherwise. * * @return <code>true</code> if neither the workspace nor target contains plug-ins; * <code>false</code> otherwise. */ public boolean isEmpty() { return getEntryTable().size() == 0; }
/** * Returns <code>true</code> if neither the workspace nor target contains plug-ins; * <code>false</code> otherwise. * * @return <code>true</code> if neither the workspace nor target contains plug-ins; * <code>false</code> otherwise. */ public boolean isEmpty() { return getEntryTable().size() == 0; }
/** * Returns a model entry containing all workspace and target plug-ins by the given ID * * @param id the plug-in ID * * @return a model entry containing all workspace and target plug-ins by the given ID */ public ModelEntry findEntry(String id) { if ("system.bundle".equals(id)) //$NON-NLS-1$ id = "org.eclipse.osgi"; //$NON-NLS-1$ return id == null ? null : (ModelEntry)getEntryTable().get(id); }
/** * Returns a model entry containing all workspace and target plug-ins by the given ID * * @param id the plug-in ID * * @return a model entry containing all workspace and target plug-ins by the given ID */ public ModelEntry findEntry(String id) { if ("system.bundle".equals(id)) //$NON-NLS-1$ id = getSystemBundleId(); return id == null ? null : (ModelEntry) getEntryTable().get(id); }
/** * Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) * fragments that are checked on the Target Platform preference page. * <p> * If a workspace plug-in/fragment has the same ID as a target plug-in, the target counterpart * is skipped and not included. * </p> * <p> * The returned result includes fragments only if <code>includeFragments</code> * is set to true * </p> * @param includeFragments a boolean indicating if fragments are desired in the returned * result * @return all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and * (possibly) fragments that are checked on the Target Platform preference page. */ public IPluginModelBase[] getActiveModels(boolean includeFragments) { int size = getEntryTable().size(); ArrayList<IPluginModelBase> result = new ArrayList<>(size); Iterator<LocalModelEntry> iter = getEntryTable().values().iterator(); while (iter.hasNext()) { ModelEntry entry = iter.next(); IPluginModelBase[] models = entry.getActiveModels(); for (int i = 0; i < models.length; i++) { if (models[i] instanceof IPluginModel || includeFragments) result.add(models[i]); } } return result.toArray(new IPluginModelBase[result.size()]); }
/** * Returns all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and (possibly) * fragments that are checked on the Target Platform preference page. * <p> * If a workspace plug-in/fragment has the same ID as a target plug-in, the target counterpart * is skipped and not included. * </p> * <p> * The returned result includes fragments only if <code>includeFragments</code> * is set to true * </p> * @param includeFragments a boolean indicating if fragments are desired in the returned * result * @return all plug-ins and (possibly) fragments in the workspace as well as all plug-ins and * (possibly) fragments that are checked on the Target Platform preference page. */ public IPluginModelBase[] getActiveModels(boolean includeFragments) { int size = getEntryTable().size(); ArrayList result = new ArrayList(size); Iterator iter = getEntryTable().values().iterator(); while (iter.hasNext()) { ModelEntry entry = (ModelEntry)iter.next(); IPluginModelBase[] models = entry.getActiveModels(); for (int i = 0; i < models.length; i++) { if (models[i] instanceof IPluginModel || includeFragments) result.add(models[i]); } } return (IPluginModelBase[])result.toArray(new IPluginModelBase[result.size()]); }
int size = getEntryTable().size(); ArrayList<IPluginModelBase> result = new ArrayList<>(size); Iterator<LocalModelEntry> iter = getEntryTable().values().iterator(); while (iter.hasNext()) { ModelEntry entry = iter.next();
int size = getEntryTable().size(); ArrayList result = new ArrayList(size); Iterator iter = getEntryTable().values().iterator(); while (iter.hasNext()) { ModelEntry entry = (ModelEntry)iter.next();
LocalModelEntry entry = (LocalModelEntry)getEntryTable().get(id); getEntryTable().put(id, entry); delta.addEntry(entry, PluginModelDelta.ADDED); } else {
/** * Adds a model to the master table and state * * @param id the key * @param model the model being added */ private void handleAdd(String id, IPluginModelBase model, PluginModelDelta delta) { LocalModelEntry entry = getEntryTable().get(id); // add model to the corresponding ModelEntry. Create a new entry if necessary if (entry == null) { entry = new LocalModelEntry(id); getEntryTable().put(id, entry); delta.addEntry(entry, PluginModelDelta.ADDED); } else { delta.addEntry(entry, PluginModelDelta.CHANGED); } entry.addModel(model); // if the model added is a workspace model, add it to the state and // remove all its external counterparts if (model.getUnderlyingResource() != null) { addWorkspaceBundleToState(model); } else if (model.isEnabled() && !entry.hasWorkspaceModels()) { // if a target model has went from an unchecked state to a checked state // on the target platform preference page, re-add its bundle description // to the state BundleDescription desc = model.getBundleDescription(); if (desc.getContainingState().equals(fState)) fState.addBundleDescription(desc); } }
LocalModelEntry entry = getEntryTable().get(id); if (entry != null) { if (!entry.hasExternalModels() && !entry.hasWorkspaceModels()) { getEntryTable().remove(id); delta.addEntry(entry, PluginModelDelta.REMOVED); return;
LocalModelEntry entry = (LocalModelEntry)getEntryTable().get(id); if (entry != null) { if (!entry.hasExternalModels() && !entry.hasWorkspaceModels()) { getEntryTable().remove(id); delta.addEntry(entry, PluginModelDelta.REMOVED); return;
ModelEntry entry = getEntryTable().get(oldID); IPluginModelBase[] activeModels = entry.getActiveModels(); boolean isActive = false;