Search in sources :

Example 1 with FeatureDescriptor

use of org.eclipse.epp.internal.mpc.ui.operations.FeatureDescriptor in project epp.mpc by eclipse.

the class FeatureSelectionWizardPage method updateSelectionModel.

private void updateSelectionModel(Set<FeatureDescriptor> featureDescriptors) {
    Map<String, FeatureDescriptor> descriptorById = new HashMap<String, FeatureDescriptor>();
    for (FeatureDescriptor fd : featureDescriptors) {
        descriptorById.put(fd.getId(), fd);
    }
    SelectionModel selectionModel = getWizard().getSelectionModel();
    for (CatalogItemEntry entry : selectionModel.getCatalogItemEntries()) {
        for (FeatureEntry child : entry.getChildren()) {
            FeatureDescriptor descriptor = descriptorById.get(child.getFeatureDescriptor().getId());
            if (descriptor != null) {
                child.setFeatureDescriptor(descriptor);
            }
        }
    }
}
Also used : FeatureEntry(org.eclipse.epp.internal.mpc.ui.wizards.SelectionModel.FeatureEntry) FeatureDescriptor(org.eclipse.epp.internal.mpc.ui.operations.FeatureDescriptor) HashMap(java.util.HashMap) CatalogItemEntry(org.eclipse.epp.internal.mpc.ui.wizards.SelectionModel.CatalogItemEntry) StyledString(org.eclipse.jface.viewers.StyledString)

Aggregations

HashMap (java.util.HashMap)1 FeatureDescriptor (org.eclipse.epp.internal.mpc.ui.operations.FeatureDescriptor)1 CatalogItemEntry (org.eclipse.epp.internal.mpc.ui.wizards.SelectionModel.CatalogItemEntry)1 FeatureEntry (org.eclipse.epp.internal.mpc.ui.wizards.SelectionModel.FeatureEntry)1 StyledString (org.eclipse.jface.viewers.StyledString)1