New Xdebug configuration manual. contributed by Ian MacLennan .
[phpeclipse.git] / net.sourceforge.phpeclipse.phphelp / src / net / sourceforge / phpdt / httpquery / config / ConfigurationWorkingCopy.java
1 /**********************************************************************
2  * Copyright (c) 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  �*
8  * Contributors:
9  *    IBM - Initial API and implementation
10  **********************************************************************/
11 package net.sourceforge.phpdt.httpquery.config;
12
13 /**
14  * 
15  */
16 public class ConfigurationWorkingCopy extends Configuration implements
17                 IConfigurationWorkingCopy {
18         protected Configuration configuration;
19
20         // creation
21         public ConfigurationWorkingCopy() {
22         }
23
24         // working copy
25         public ConfigurationWorkingCopy(Configuration configuration) {
26                 this.configuration = configuration;
27                 setInternal(configuration);
28         }
29
30         public void setId(String newId) {
31                 fId = newId;
32         }
33
34         public void setName(String name) {
35                 fName = name;
36         }
37
38         public void setURL(String url) {
39                 fUrl = url;
40         }
41
42         public void setPassword(String password) {
43                 fPassword = password;
44         }
45
46         public void setUser(String user) {
47                 fUser = user;
48         }
49
50         public void setType(String t) {
51                 fType = t;
52         }
53
54         public boolean isWorkingCopy() {
55                 return true;
56         }
57
58         public IConfigurationWorkingCopy getWorkingCopy() {
59                 return this;
60         }
61
62         public IConfiguration save() {
63                 ConfigurationManager mm = ConfigurationManager.getInstance();
64                 if (configuration != null) {
65                         configuration.setInternal(this);
66                         mm.configurationChanged(configuration);
67                 } else {
68                         configuration = new Configuration();
69                         configuration.setInternal(this);
70                         mm.addConfiguration(configuration);
71                 }
72                 return configuration;
73         }
74 }