private String getFwProperty(ConfigData data, String key) { return data.getProperty(key); }
private String getFwProperty(ConfigData data, String key) { return data.getProperty(key); }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); if (propValue != null && propValue.equals(ActionConstants.PARM_AT_ARTIFACT)) { try { propValue = Util.resolveArtifactParam(parameters); } catch (CoreException e) { return e.getStatus(); } } getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, manipulator.getConfigData().getProperty(propName)); manipulator.getConfigData().setProperty(propName, propValue); return Status.OK_STATUS; }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); if (propValue != null && propValue.equals(ActionConstants.PARM_AT_ARTIFACT)) { try { propValue = Util.resolveArtifactParam(parameters); } catch (CoreException e) { return e.getStatus(); } } getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, manipulator.getConfigData().getProperty(propName)); manipulator.getConfigData().setProperty(propName, propValue); return Status.OK_STATUS; }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); if (propValue == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_VALUE, ID)); if (propValue != null && propValue.equals(ActionConstants.PARM_AT_ARTIFACT)) { try { propValue = Util.resolveArtifactParam(parameters); } catch (CoreException e) { return e.getStatus(); } } // if there was no value previously, then just set our key/value pair and return. // otherwise we have to merge. ConfigData data = manipulator.getConfigData(); String previous = data.getProperty(propName); // make a backup - even if it is null getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, previous); // assume the value is a comma-separated list and just add ourselves to the end if (previous != null) propValue = previous + ',' + propValue; data.setProperty(propName, propValue); return Status.OK_STATUS; }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); if (propValue == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_VALUE, ID)); if (propValue != null && propValue.equals(ActionConstants.PARM_AT_ARTIFACT)) { try { propValue = Util.resolveArtifactParam(parameters); } catch (CoreException e) { return e.getStatus(); } } // if there was no value previously, then just set our key/value pair and return. // otherwise we have to merge. ConfigData data = manipulator.getConfigData(); String previous = data.getProperty(propName); // make a backup - even if it is null getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, previous); // assume the value is a comma-separated list and just add ourselves to the end if (previous != null) propValue = previous + ',' + propValue; data.setProperty(propName, propValue); return Status.OK_STATUS; }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); ConfigData data = manipulator.getConfigData(); String previous = data.getProperty(propName); if (previous == null) return Status.OK_STATUS; // make a backup - even if it is null getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, previous); // if the value is null, remove the key/value pair. if (propValue == null) { data.setProperty(propName, null); return Status.OK_STATUS; } // Otherwise treat the current value as a comma-separated list and remove // just the one value that was specified. List<String> list = AddProgramPropertyAction.convertToList(previous); // if the value wasn't in the list, then just return if (!list.remove(propValue)) return Status.OK_STATUS; // otherwise set the property to the new value, or remove it if it is now empty propValue = list.isEmpty() ? null : AddProgramPropertyAction.convertToString(list); data.setProperty(propName, propValue); return Status.OK_STATUS; }
public IStatus execute(Map<String, Object> parameters) { Manipulator manipulator = (Manipulator) parameters.get(EclipseTouchpoint.PARM_MANIPULATOR); String propName = (String) parameters.get(ActionConstants.PARM_PROP_NAME); if (propName == null) return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_PROP_NAME, ID)); String propValue = (String) parameters.get(ActionConstants.PARM_PROP_VALUE); ConfigData data = manipulator.getConfigData(); String previous = data.getProperty(propName); if (previous == null) return Status.OK_STATUS; // make a backup - even if it is null getMemento().put(ActionConstants.PARM_PREVIOUS_VALUE, previous); // if the value is null, remove the key/value pair. if (propValue == null) { data.setProperty(propName, null); return Status.OK_STATUS; } // Otherwise treat the current value as a comma-separated list and remove // just the one value that was specified. List<String> list = AddProgramPropertyAction.convertToList(previous); // if the value wasn't in the list, then just return if (!list.remove(propValue)) return Status.OK_STATUS; // otherwise set the property to the new value, or remove it if it is now empty propValue = list.isEmpty() ? null : AddProgramPropertyAction.convertToString(list); data.setProperty(propName, propValue); return Status.OK_STATUS; }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
private boolean initializeFromConfigFiles() { FrameworkAdmin fwk = LazyManipulator.getFrameworkAdmin(); if (fwk == null) return false; Manipulator manipulator = fwk.getManipulator(); LauncherData launcherData = manipulator.getLauncherData(); launcherData.setFwConfigLocation(configurationFolder != null ? configurationFolder : new File(installFolder, "configuration/config.ini")); //$NON-NLS-1$ launcherData.setHome(installFolder); try { manipulator.load(); } catch (IllegalStateException e) { return false; } catch (FrameworkAdminRuntimeException e) { return false; } catch (IOException e) { return false; } profileId = manipulator.getConfigData().getProperty("eclipse.p2.profile"); //$NON-NLS-1$ p2DataAreaURI = manipulator.getConfigData().getProperty("eclipse.p2.data.area"); //$NON-NLS-1$ return true; }
String value = data.getProperty(ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL); if (value != null) { try {
String value = data.getProperty(ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL); if (value != null) { try {
String value = data.getProperty(ORG_ECLIPSE_EQUINOX_SIMPLECONFIGURATOR_CONFIGURL); if (value != null) { try {