protected String getProfileProperty(IProfile profile, IInstallableUnit iu, String propertyName) { if (profile == null || iu == null) return null; return profile.getInstallableUnitProperty(iu, propertyName); }
/** * Test if the {@link IInstallableUnit}, in the context of a {@link IProfile} is visible to the user * @param iu the element being tested. * @param profile the context in which the iu is tested * @return <tt>true</tt> if the element is visible to the user. */ public static boolean isUserVisible(IInstallableUnit iu, IProfile profile) { String value = profile.getInstallableUnitProperty(iu, IProfile.PROP_PROFILE_ROOT_IU); return Boolean.parseBoolean(value); } }
protected int getLock(IProfile profile, IInstallableUnit iu) { if (profile == null) return IProfile.LOCK_NONE; try { String value = profile.getInstallableUnitProperty(iu, IProfile.PROP_PROFILE_LOCKED_IU); if (value != null) return Integer.parseInt(value); } catch (NumberFormatException e) { // ignore and assume no lock } return IProfile.LOCK_NONE; }
/** * Test if the {@link IInstallableUnit}, in the context of a {@link IProfile} is visible to the user * @param iu the element being tested. * @param profile the context in which the iu is tested * @return <tt>true</tt> if the element is visible to the user. */ public static boolean isUserVisible(IInstallableUnit iu, IProfile profile) { String value = profile.getInstallableUnitProperty(iu, IProfile.PROP_PROFILE_ROOT_IU); return Boolean.parseBoolean(value); } }
private boolean validToUpdate(IProfile profile, IInstallableUnit iu) { int lock = IProfile.LOCK_NONE; boolean isRoot = false; try { String value = profile.getInstallableUnitProperty(iu, IProfile.PROP_PROFILE_LOCKED_IU); if (value != null) lock = Integer.parseInt(value); value = profile.getInstallableUnitProperty(iu, IProfile.PROP_PROFILE_ROOT_IU); isRoot = value == null ? false : Boolean.valueOf(value).booleanValue(); } catch (NumberFormatException e) { // ignore and assume no lock } return isRoot && (lock & IProfile.LOCK_UPDATE) == 0; }
private boolean isLocked(IProfile profile, IInstallableUnit iuToBeUpdated) { return Boolean.valueOf(profile.getInstallableUnitProperty(iuToBeUpdated, IProfile.PROP_PROFILE_LOCKED_IU)).booleanValue(); }
@Override public void setInstallableUnitProfileProperty(IInstallableUnit iu, String name, String value) { String currentValue = profile.getInstallableUnitProperty(iu, name); if (value == null && currentValue == null) return; operands.add(new InstallableUnitPropertyOperand(iu, name, currentValue, value)); }
@Override public String getInstallableUnitProperty(IInstallableUnit iu, String key) { if (INCLUSION_RULES.equals(key)) return ProfileInclusionRules.createOptionalInclusionRule(iu); return profile.getInstallableUnitProperty(iu, key); }
public void setInstallableUnitProfileProperty(IInstallableUnit iu, String name, String value) { String currentValue = profile.getInstallableUnitProperty(iu, name); if (value == null && currentValue == null) return; operands.add(new InstallableUnitPropertyOperand(iu, name, currentValue, value)); }
IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE); String copied = profile.getInstallableUnitProperty(iu, "copied" + ActionConstants.PIPE + source + ActionConstants.PIPE + target); //$NON-NLS-1$
private void init() { IProfileRegistry profileRegistry = (IProfileRegistry) getProvisioningUI().getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME); IProfile profile = profileRegistry.getProfile(profileID); String property = profile.getInstallableUnitProperty(iuToBeUpdated, IProfile.PROP_PROFILE_LOCKED_IU); try { isLockedForUpdate = property == null ? false : (Integer.parseInt(property) & IProfile.LOCK_UPDATE) > 0; } catch (NumberFormatException e) { isLockedForUpdate = false; } }
if ("STRICT".equals(profile.getInstallableUnitProperty(iu, "org.eclipse.equinox.p2.internal.inclusion.rules"))) { //$NON-NLS-1$//$NON-NLS-2$ request.removeInstallableUnitProfileProperty(iu, PROP_FROM_DROPINS); request.removeInstallableUnitProfileProperty(iu, IProfile.PROP_PROFILE_LOCKED_IU);
profileChangeRequest.getProfile().getInstallableUnitProperty(iu, INCLUSION_RULES));
String value = profile.getInstallableUnitProperty(installedIU, IProfile.PROP_PROFILE_LOCKED_IU); if (value != null) lockedForUpdate = (Integer.parseInt(value) & IProfile.LOCK_UPDATE) == IProfile.LOCK_UPDATE;
String value = profile.getInstallableUnitProperty(installedIU, IProfile.PROP_PROFILE_LOCKED_IU); if (value != null) lockedForUpdate = (Integer.parseInt(value) & IProfile.LOCK_UPDATE) == IProfile.LOCK_UPDATE;