/** * This sets the Workspace * * @param workspace */ public void updateWorkspace(String[] workspace) { this.updateStringArrayProperty(workspace, WORKSPACE_PROPERTY_NAME, false); }
/** * This sets the Workspace * * @param workspace */ public void updateWorkspace(String[] workspace) { this.updateStringArrayProperty(workspace, WORKSPACE_PROPERTY_NAME, false); }
/** * This removes a workspace * * @param workspace */ public void removeWorkspace(String workspace) { String[] existingWorkspaces = getStringPropertyArray(WORKSPACE_PROPERTY_NAME); if (existingWorkspaces.length == 0) { return; } List<String> existingWorkspaceList = new ArrayList<String>(existingWorkspaces.length); Collections.addAll(existingWorkspaceList, existingWorkspaces); existingWorkspaceList.remove(workspace); if (existingWorkspaceList.size() != existingWorkspaces.length) { this.updateStringArrayProperty(existingWorkspaceList.toArray(new String[existingWorkspaceList.size()]), WORKSPACE_PROPERTY_NAME, false); } }
/** * This removes a workspace * * @param workspace */ public void removeWorkspace(String workspace) { String[] existingWorkspaces = getStringPropertyArray(WORKSPACE_PROPERTY_NAME); if (existingWorkspaces.length == 0) { return; } List<String> existingWorkspaceList = new ArrayList<String>(existingWorkspaces.length); Collections.addAll(existingWorkspaceList, existingWorkspaces); existingWorkspaceList.remove(workspace); if (existingWorkspaceList.size() != existingWorkspaces.length) { this.updateStringArrayProperty(existingWorkspaceList.toArray(new String[existingWorkspaceList.size()]), WORKSPACE_PROPERTY_NAME, false); } }
/** * This adds a workspace * * @param workspace */ public void addWorkspace(String workspace) { String[] existingWorkspaces = getStringPropertyArray(WORKSPACE_PROPERTY_NAME); boolean found = false; for (String existingWorkspace : existingWorkspaces) { if (existingWorkspace.equals(workspace)) { found = true; break; } } if (!found) { String[] newWorkspaces = new String[existingWorkspaces.length + 1]; System.arraycopy(existingWorkspaces, 0, newWorkspaces, 0, existingWorkspaces.length); newWorkspaces[existingWorkspaces.length] = workspace; this.updateStringArrayProperty(newWorkspaces, WORKSPACE_PROPERTY_NAME, false); } }
/** * This adds a workspace * * @param workspace */ public void addWorkspace(String workspace) { String[] existingWorkspaces = getStringPropertyArray(WORKSPACE_PROPERTY_NAME); boolean found = false; for (String existingWorkspace : existingWorkspaces) { if (existingWorkspace.equals(workspace)) { found = true; break; } } if (!found) { String[] newWorkspaces = new String[existingWorkspaces.length + 1]; System.arraycopy(existingWorkspaces, 0, newWorkspaces, 0, existingWorkspaces.length); newWorkspaces[existingWorkspaces.length] = workspace; this.updateStringArrayProperty(newWorkspaces, WORKSPACE_PROPERTY_NAME, false); } }
public void updateDependency(String dependencyPath) { String[] existingDependencies = getStringPropertyArray(DEPENDENCIES_PROPERTY_NAME); boolean found = false; for (int i = 0; i < existingDependencies.length; i++) { if (decodeDependencyPath(existingDependencies[i])[0] .equals(decodeDependencyPath(dependencyPath)[0])) { found = true; existingDependencies[i] = dependencyPath; this.updateStringArrayProperty(existingDependencies, DEPENDENCIES_PROPERTY_NAME, false); break; } } if (!found) { String[] newDependencies = new String[existingDependencies.length + 1]; System.arraycopy(existingDependencies, 0, newDependencies, 0, existingDependencies.length); newDependencies[existingDependencies.length] = dependencyPath; this.updateStringArrayProperty(newDependencies, DEPENDENCIES_PROPERTY_NAME, false); } }
public void updateDependency(String dependencyPath) { String[] existingDependencies = getStringPropertyArray(DEPENDENCIES_PROPERTY_NAME); boolean found = false; for (int i = 0; i < existingDependencies.length; i++) { if (decodeDependencyPath(existingDependencies[i])[0] .equals(decodeDependencyPath(dependencyPath)[0])) { found = true; existingDependencies[i] = dependencyPath; this.updateStringArrayProperty(existingDependencies, DEPENDENCIES_PROPERTY_NAME, false); break; } } if (!found) { String[] newDependencies = new String[existingDependencies.length + 1]; System.arraycopy(existingDependencies, 0, newDependencies, 0, existingDependencies.length); newDependencies[existingDependencies.length] = dependencyPath; this.updateStringArrayProperty(newDependencies, DEPENDENCIES_PROPERTY_NAME, false); } }