Search in sources :

Example 1 with IUElementListRoot

use of org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot in project translationstudio8 by heartsome.

the class UpdateWizard method initializeResolutionModelElements.

protected void initializeResolutionModelElements(Object[] selectedElements) {
    root = new IUElementListRoot();
    ArrayList<AvailableUpdateElement> list = new ArrayList<AvailableUpdateElement>(selectedElements.length);
    for (int i = 0; i < selectedElements.length; i++) {
        if (selectedElements[i] instanceof AvailableUpdateElement) {
            AvailableUpdateElement element = (AvailableUpdateElement) selectedElements[i];
            AvailableUpdateElement newElement = new AvailableUpdateElement(root, element.getIU(), element.getIUToBeUpdated(), getProfileId(), shouldShowProvisioningPlanChildren());
            list.add(newElement);
        } else if (selectedElements[i] instanceof Update) {
            Update update = (Update) selectedElements[i];
            AvailableUpdateElement newElement = new AvailableUpdateElement(root, update.replacement, update.toUpdate, getProfileId(), shouldShowProvisioningPlanChildren());
            list.add(newElement);
        }
    }
    root.setChildren(list.toArray());
}
Also used : IUElementListRoot(org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot) ArrayList(java.util.ArrayList) AvailableUpdateElement(org.eclipse.equinox.internal.p2.ui.model.AvailableUpdateElement) Update(org.eclipse.equinox.p2.operations.Update)

Aggregations

ArrayList (java.util.ArrayList)1 AvailableUpdateElement (org.eclipse.equinox.internal.p2.ui.model.AvailableUpdateElement)1 IUElementListRoot (org.eclipse.equinox.internal.p2.ui.model.IUElementListRoot)1 Update (org.eclipse.equinox.p2.operations.Update)1