View | Details | Raw Unified | Return to bug 127016 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jst/ws/internal/axis/consumption/core/plugin/WebServiceAxisConsumptionCorePlugin.java (+12 lines)
Lines 13-18 Link Here
13
13
14
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.Plugin;
15
import org.eclipse.core.runtime.Plugin;
16
import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext;
17
import org.eclipse.jst.ws.internal.axis.consumption.core.context.PersistentAxisEmitterContext;
18
import org.eclipse.wst.command.internal.env.context.PersistentResourceContext;
19
import org.eclipse.wst.command.internal.env.core.context.ResourceContext;
16
import org.eclipse.wst.common.environment.EnvironmentService;
20
import org.eclipse.wst.common.environment.EnvironmentService;
17
import org.eclipse.wst.common.environment.ILog;
21
import org.eclipse.wst.common.environment.ILog;
18
import org.osgi.framework.BundleContext;
22
import org.osgi.framework.BundleContext;
Lines 39-44 Link Here
39
	private static WebServiceAxisConsumptionCorePlugin instance_;
43
	private static WebServiceAxisConsumptionCorePlugin instance_;
40
	private ILog log_;
44
	private ILog log_;
41
45
46
	private PersistentAxisEmitterContext axisEmitterContext_;
42
	/**
47
	/**
43
	* Constructs a runtime plugin object for this plugin.
48
	* Constructs a runtime plugin object for this plugin.
44
	* The "plugin" element in plugin.xml should include the attribute
49
	* The "plugin" element in plugin.xml should include the attribute
Lines 68-73 Link Here
68
	static public WebServiceAxisConsumptionCorePlugin getInstance() {
73
	static public WebServiceAxisConsumptionCorePlugin getInstance() {
69
		return instance_;
74
		return instance_;
70
	}
75
	}
76
	
77
	public AxisEmitterContext getAxisEmitterContext()
78
	{
79
		if (axisEmitterContext_ == null) 
80
	  		axisEmitterContext_ = PersistentAxisEmitterContext.getInstance();
81
		return axisEmitterContext_;
82
	}
71
83
72
	/**
84
	/**
73
	* Called once by the platform when this plugin is first loaded.
85
	* Called once by the platform when this plugin is first loaded.
(-)META-INF/MANIFEST.MF (+1 lines)
Lines 9-14 Link Here
9
Export-Package: org.eclipse.jst.ws.internal.axis.consumption.core;x-internal:=true,
9
Export-Package: org.eclipse.jst.ws.internal.axis.consumption.core;x-internal:=true,
10
 org.eclipse.jst.ws.internal.axis.consumption.core.command;x-internal:=true,
10
 org.eclipse.jst.ws.internal.axis.consumption.core.command;x-internal:=true,
11
 org.eclipse.jst.ws.internal.axis.consumption.core.common;x-internal:=true,
11
 org.eclipse.jst.ws.internal.axis.consumption.core.common;x-internal:=true,
12
 org.eclipse.jst.ws.internal.axis.consumption.core.context,
12
 org.eclipse.jst.ws.internal.axis.consumption.core.plugin;x-internal:=true
13
 org.eclipse.jst.ws.internal.axis.consumption.core.plugin;x-internal:=true
13
Require-Bundle: org.apache.ant,
14
Require-Bundle: org.apache.ant,
14
 org.eclipse.core.resources,
15
 org.eclipse.core.resources,
(-)src/org/eclipse/jst/ws/internal/axis/consumption/core/context/TransientAxisEmitterContext.java (+76 lines)
Added Link Here
1
package org.eclipse.jst.ws.internal.axis.consumption.core.context;
2
3
import org.eclipse.wst.command.internal.env.core.context.ResourceContext;
4
import org.eclipse.wst.command.internal.env.core.context.ResourceDefaults;
5
import org.eclipse.wst.command.internal.env.core.context.TransientResourceContext;
6
7
/**
8
 * This class implements a ResourceContext interface where the state
9
 * of the context data is transient.
10
 *
11
 */
12
public class TransientAxisEmitterContext implements AxisEmitterContext 
13
{
14
  private boolean allElements;
15
  private boolean helperGenerate;
16
  private boolean wrapArrays;
17
18
  public TransientAxisEmitterContext() {
19
    setAllElementsEnabled(AxisEmitterDefaults.getAllElementsDefault());
20
    setHelperGenerateEnabled(AxisEmitterDefaults.getHelperGenerateDefault());
21
    setWrapArraysEnabled(AxisEmitterDefaults.getWrapArraysDefault());
22
  }
23
24
  /**  
25
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#setAllElementsEnabled(boolean)
26
   */
27
  public void setAllElementsEnabled(boolean enable) {
28
    allElements = enable;
29
  }
30
  
31
  /**  
32
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#isAllElementsEnabled()
33
   */
34
  public boolean isAllElementsEnabled() {
35
    return allElements;
36
  }
37
38
  /**  
39
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#setHelperGenerateEnabled(boolean)
40
   */
41
  public void setHelperGenerateEnabled(boolean enable) {
42
    helperGenerate = enable;
43
  }
44
  
45
  /**  
46
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#isHelperGenerateEnabled()
47
   */
48
  public boolean isHelperGenerateEnabled() {
49
    return helperGenerate;
50
  }
51
52
  /**  
53
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#setWrapArraysEnabled(boolean)
54
   */
55
  public void setWrapArraysEnabled(boolean enable) {
56
    wrapArrays = enable;
57
  }
58
  
59
  /**  
60
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#isWrapArraysEnabled()
61
   */
62
  public boolean isWrapArraysEnabled() {
63
    return wrapArrays;
64
  }
65
  
66
  /**  
67
   * @see org.eclipse.wst.command.internal.env.core.context.AxisEmitterContext#copy()
68
   */
69
  public AxisEmitterContext copy() {
70
    AxisEmitterContext aec = new TransientAxisEmitterContext();
71
    aec.setAllElementsEnabled(isAllElementsEnabled());
72
    aec.setHelperGenerateEnabled(isHelperGenerateEnabled());
73
    aec.setWrapArraysEnabled(isWrapArraysEnabled());
74
    return aec;
75
  }
76
}
(-)src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterDefaults.java (+35 lines)
Added Link Here
1
package org.eclipse.jst.ws.internal.axis.consumption.core.context;
2
3
public class AxisEmitterDefaults
4
{
5
 private static final boolean PREFERENCE_ALL_ELEMENTS_DEFAULT = false;
6
 private static final boolean PREFERENCE_HELPER_GENERATE_DEFAULT = true;
7
 private static final boolean PREFERENCE_WRAP_ARRAYS_DEFAULT = false;
8
9
 /**
10
  * 
11
  * @return returns the default setting for overwriting files.
12
  */
13
 public static boolean getAllElementsDefault ()
14
 {
15
 	return PREFERENCE_ALL_ELEMENTS_DEFAULT;
16
 }
17
 
18
 /**
19
  * 
20
  * @return returns the default setting ofr creating folders.
21
  */
22
 public static boolean getHelperGenerateDefault ()
23
 { 
24
	return PREFERENCE_HELPER_GENERATE_DEFAULT;
25
 }
26
27
 /**
28
  * 
29
  * @return returns the default setting for checking out files.
30
  */
31
 public static boolean getWrapArraysDefault()
32
 {
33
	return PREFERENCE_WRAP_ARRAYS_DEFAULT;
34
 }
35
}
(-)src/org/eclipse/jst/ws/internal/axis/consumption/core/context/PersistentAxisEmitterContext.java (+73 lines)
Added Link Here
1
package org.eclipse.jst.ws.internal.axis.consumption.core.context;
2
3
import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin;
4
import org.eclipse.wst.command.internal.env.context.PersistentContext;
5
6
public class PersistentAxisEmitterContext extends PersistentContext implements	AxisEmitterContext
7
{
8
	private static PersistentAxisEmitterContext context_ = null;
9
10
	public static PersistentAxisEmitterContext getInstance() 
11
	{
12
		if (context_ == null) {
13
			context_ = new PersistentAxisEmitterContext();
14
			context_.load();
15
		}
16
17
		return context_;
18
	}
19
20
	private PersistentAxisEmitterContext() 
21
	{
22
		super(WebServiceAxisConsumptionCorePlugin.getInstance());
23
	}
24
25
	public void load() 
26
	{
27
		setDefault(PREFERENCE_ALL_ELEMENTS, AxisEmitterDefaults
28
				.getAllElementsDefault());
29
		setDefault(PREFERENCE_HELPER_GENERATE, AxisEmitterDefaults
30
				.getHelperGenerateDefault());
31
		setDefault(PREFERENCE_WRAP_ARRAYS, AxisEmitterDefaults
32
				.getWrapArraysDefault());
33
	}
34
35
	public void setAllElementsEnabled(boolean enable) 
36
	{
37
		setValue(PREFERENCE_ALL_ELEMENTS, enable);
38
	}
39
40
	public boolean isAllElementsEnabled() 
41
	{
42
		return getValueAsBoolean(PREFERENCE_ALL_ELEMENTS);
43
	}
44
45
	public void setHelperGenerateEnabled(boolean enable) 
46
	{
47
		setValue(PREFERENCE_HELPER_GENERATE, enable);
48
	}
49
50
	public boolean isHelperGenerateEnabled() 
51
	{
52
		return getValueAsBoolean(PREFERENCE_HELPER_GENERATE);
53
	}
54
55
	public void setWrapArraysEnabled(boolean enable) 
56
	{
57
		setValue(PREFERENCE_WRAP_ARRAYS, enable);
58
	}
59
60
	public boolean isWrapArraysEnabled() 
61
	{
62
		return getValueAsBoolean(PREFERENCE_WRAP_ARRAYS);
63
	}
64
65
	public AxisEmitterContext copy() 
66
	{
67
	    AxisEmitterContext aec = new TransientAxisEmitterContext();
68
	    aec.setAllElementsEnabled(isAllElementsEnabled());
69
	    aec.setHelperGenerateEnabled(isHelperGenerateEnabled());
70
	    aec.setWrapArraysEnabled(isWrapArraysEnabled());
71
	    return aec;
72
	}
73
}
(-)src/org/eclipse/jst/ws/internal/axis/consumption/core/context/AxisEmitterContext.java (+65 lines)
Added Link Here
1
package org.eclipse.jst.ws.internal.axis.consumption.core.context;
2
3
4
public interface AxisEmitterContext 
5
{
6
 /**
7
   * This constant string is used to lookup the overwrite files general preference from
8
   * the plugins local preferences store.
9
 **/
10
 public static final String PREFERENCE_ALL_ELEMENTS = "allElements";
11
12
 /**
13
   * This constant string is used to lookup the create folders general preference from
14
   * the plugins local preferences store.
15
 **/
16
 public static final String PREFERENCE_HELPER_GENERATE = "helperGenerate";
17
 
18
 /**
19
   * This constant string is used to lookup the checkout files general preference from
20
   * the plugins local preferences store.
21
 **/
22
 public static final String PREFERENCE_WRAP_ARRAYS = "wrapArrays";
23
24
 /**
25
  * 
26
  * @param enable set whether overwriting of files is enabled.
27
  */
28
 public void setAllElementsEnabled ( boolean enable);
29
 
30
 /**
31
  * 
32
  * @return returns whether overwriting of files is enabled.
33
  */
34
 public boolean isAllElementsEnabled();
35
 
36
 /**
37
  * 
38
  * @param enable set whether creation of folders is enabled.
39
  */
40
 public void setHelperGenerateEnabled( boolean enable);
41
 
42
 /**
43
  * 
44
  * @return returns whether creation of folders is enabled.
45
  */
46
 public boolean isHelperGenerateEnabled(); 
47
 
48
 /**
49
  * 
50
  * @param enable sets whether automatic checkout of files is enabled.
51
  */
52
 public void setWrapArraysEnabled( boolean enable);
53
 
54
 /**
55
  * 
56
  * @return returns whether automatic checkout of files is enabled.
57
  */
58
 public boolean isWrapArraysEnabled();
59
 
60
 /**
61
  * 
62
  * @return returns a copy of this ResourceContext.
63
  */
64
 public AxisEmitterContext copy();
65
}

Return to bug 127016