### Eclipse Workspace Patch 1.0 #P org.eclipse.jst.ws.axis.consumption.ui Index: plugin.xml =================================================================== RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.axis.consumption.ui/plugin.xml,v retrieving revision 1.17 diff -u -r1.17 plugin.xml --- plugin.xml 7 Dec 2005 19:00:25 -0000 1.17 +++ plugin.xml 22 Mar 2006 01:46:12 -0000 @@ -41,4 +41,14 @@ property="JavaWSDLParam" transform="org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParamModifier"/> + + + + + \ No newline at end of file Index: plugin.properties =================================================================== RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.axis.consumption.ui/plugin.properties,v retrieving revision 1.3 diff -u -r1.3 plugin.properties --- plugin.properties 21 Jul 2005 22:37:34 -0000 1.3 +++ plugin.properties 22 Mar 2006 01:46:12 -0000 @@ -18,3 +18,8 @@ WEBSERVICECLIENTTYPE_NAME_JAVA_AXIS=Java proxy LABEL_RUNTIME_AXIS_11=Apache Axis DESC_RUNTIME_AXIS_11=Apache Axis +# +# Web Services Preferance Pages +# +# Categories +PREFERENCE_CATEGORY_AXIS_EMITTER=Axis Emitter Index: src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUI.properties =================================================================== RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUI.properties,v retrieving revision 1.2 diff -u -r1.2 AxisConsumptionUI.properties --- src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUI.properties 22 Feb 2006 01:14:16 -0000 1.2 +++ src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUI.properties 22 Mar 2006 01:46:12 -0000 @@ -80,4 +80,14 @@ # MSG_ERROR_XML_FILE_OVERWRITE_DISABLED=IWAB0532E Do you want to overwrite the Apache Axis deployment descriptor? +# Messages for Axis Emitter Preference Page +TOOLTIP_PPAE_PAGE=Set preferences that control Axis Emitter. +TOOLTIP_PPAE_CHECKBOX_ALL_ELEMENTS=generate code for all elements, even unreferenced ones. +TOOLTIP_PPAE_CHECKBOX_HELPER_GENERATE=emits separate Helper classes for meta data. +TOOLTIP_PPAE_CHECKBOX_WRAP_ARRAYS=Prefers building beans to straight arrays for wrapped XML array types. +BUTTON_ALL_ELEMENTS=Generate code for &all elements, even unreferenced ones. +BUTTON_HELPER_GENERATE=Emits separate &Helper classes for meta data. +BUTTON_WRAP_ARRAYS=Prefers building beans to straight arrays for &wrapped XML array types. + + Index: src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUIMessages.java =================================================================== RCS file: /cvsroot/webtools/jst/components/ws/plugins/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUIMessages.java,v retrieving revision 1.1 diff -u -r1.1 AxisConsumptionUIMessages.java --- src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUIMessages.java 8 Nov 2005 17:56:12 -0000 1.1 +++ src/org/eclipse/jst/ws/internal/axis/consumption/ui/AxisConsumptionUIMessages.java 22 Mar 2006 01:46:12 -0000 @@ -47,7 +47,14 @@ public static String LABEL_EXPLORE_MAPPINGS_XML2BEAN; public static String TOOLTIP_N2P_SHOW_MAPPINGS; public static String MSG_ERROR_XML_FILE_OVERWRITE_DISABLED; - + public static String TOOLTIP_PPAE_PAGE; + public static String TOOLTIP_PPAE_CHECKBOX_ALL_ELEMENTS; + public static String TOOLTIP_PPAE_CHECKBOX_HELPER_GENERATE; + public static String TOOLTIP_PPAE_CHECKBOX_WRAP_ARRAYS; + public static String BUTTON_ALL_ELEMENTS; + public static String BUTTON_HELPER_GENERATE; + public static String BUTTON_WRAP_ARRAYS; + static { NLS.initializeMessages(BUNDLE_NAME, AxisConsumptionUIMessages.class); } Index: src/org/eclipse/jst/ws/internal/axis/consumption/ui/preferences/AxisEmitterPreferencePage.java =================================================================== RCS file: src/org/eclipse/jst/ws/internal/axis/consumption/ui/preferences/AxisEmitterPreferencePage.java diff -N src/org/eclipse/jst/ws/internal/axis/consumption/ui/preferences/AxisEmitterPreferencePage.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/jst/ws/internal/axis/consumption/ui/preferences/AxisEmitterPreferencePage.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,153 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.jst.ws.internal.axis.consumption.ui.preferences; + +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterContext; +import org.eclipse.jst.ws.internal.axis.consumption.core.context.AxisEmitterDefaults; +import org.eclipse.jst.ws.internal.axis.consumption.core.plugin.WebServiceAxisConsumptionCorePlugin; +import org.eclipse.jst.ws.internal.axis.consumption.ui.AxisConsumptionUIMessages; +import org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin; +//import org.eclipse.jst.ws.internal.ui.WSUIPluginMessages; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.help.IWorkbenchHelpSystem; + + + +public class AxisEmitterPreferencePage extends PreferencePage implements IWorkbenchPreferencePage +{ + /*CONTEXT_ID PPAE0001 for the Axis Emitter Preference Page*/ + private String INFOPOP_PPAE_PAGE = WebServiceAxisConsumptionUIPlugin.ID + ".PPAE0001"; + // + private Button allElements; + /*CONTEXT_ID PPAE0002 for the file overwrite check box on the Resource Management Preference Page*/ + private String INFOPOP_PPAE_CHECKBOX_ALL_ELEMENTS = WebServiceAxisConsumptionUIPlugin.ID + ".PPAE0002"; + // + private Button helperGenerate; + /*CONTEXT_ID PPAE0003 for the create folders check box on the Resource Management Preference Page*/ + private String INFOPOP_PPAE_CHECKBOX_HELPER_GENERATE = WebServiceAxisConsumptionUIPlugin.ID + ".PPAE0003"; + // + private Button wrapArrays; + /*CONTEXT_ID PPRM0004 for the checkout files check box on the Resource Management Preference Page*/ + private String INFOPOP_PPAE_CHECKBOX_WRAP_ARRAYS = WebServiceAxisConsumptionUIPlugin.ID + ".PPAE0004"; + + /** + * Creates preference page controls on demand. + * @param parent the parent for the preference page + */ + protected Control createContents(Composite superparent) + { + IWorkbenchHelpSystem helpSystem = PlatformUI.getWorkbench().getHelpSystem(); + + Composite parent = new Composite( superparent, SWT.NONE ); + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + parent.setLayout( layout ); + parent.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_PAGE); + helpSystem.setHelp(parent, INFOPOP_PPAE_PAGE); + + allElements = createCheckBox(parent, AxisConsumptionUIMessages.BUTTON_ALL_ELEMENTS); + allElements.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_ALL_ELEMENTS); + helpSystem.setHelp(allElements, INFOPOP_PPAE_CHECKBOX_ALL_ELEMENTS); + + helperGenerate = createCheckBox(parent, AxisConsumptionUIMessages.BUTTON_HELPER_GENERATE); + helperGenerate.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_HELPER_GENERATE); + helpSystem.setHelp(helperGenerate, INFOPOP_PPAE_CHECKBOX_HELPER_GENERATE); + + wrapArrays = createCheckBox(parent, AxisConsumptionUIMessages.BUTTON_WRAP_ARRAYS); + wrapArrays.setToolTipText(AxisConsumptionUIMessages.TOOLTIP_PPAE_CHECKBOX_WRAP_ARRAYS); + helpSystem.setHelp(wrapArrays, INFOPOP_PPAE_CHECKBOX_WRAP_ARRAYS); + + initializeValues(); + org.eclipse.jface.dialogs.Dialog.applyDialogFont(superparent); + + return parent; + } + + private Button createCheckBox( Composite parent, String text ) + { + Button button = new Button( parent, SWT.CHECK ); + button.setText( text ); + return button; + } + + /** + * Does anything necessary because the default button has been pressed. + */ + protected void performDefaults() + { + super.performDefaults(); + initializeDefaults(); + } + + /** + * Do anything necessary because the OK button has been pressed. + * @return whether it is okay to close the preference page + */ + public boolean performOk() + { + storeValues(); + return true; + } + + protected void performApply() + { + performOk(); + } + + /** + * @see IWorkbenchPreferencePage + */ + public void init(IWorkbench workbench) { } + + /** + * Initializes states of the controls using default values + * in the preference store. + */ + private void initializeDefaults() + { + allElements.setSelection( AxisEmitterDefaults.getAllElementsDefault()); + helperGenerate.setSelection( AxisEmitterDefaults.getHelperGenerateDefault()); + wrapArrays.setSelection( AxisEmitterDefaults.getWrapArraysDefault()); + } + + /** + * Initializes states of the controls from the preference store. + */ + private void initializeValues() + { + // get the persistent context from the plugin + AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext(); + allElements.setSelection( context.isAllElementsEnabled()); + helperGenerate.setSelection( context.isHelperGenerateEnabled()); + wrapArrays.setSelection( context.isWrapArraysEnabled()); + } + + /** + * Stores the values of the controls back to the preference store. + */ + private void storeValues() + { + // get the persistent context from the plugin + AxisEmitterContext context = WebServiceAxisConsumptionCorePlugin.getInstance().getAxisEmitterContext(); + context.setAllElementsEnabled( allElements.getSelection() ); + context.setHelperGenerateEnabled( helperGenerate.getSelection() ); + context.setWrapArraysEnabled( wrapArrays.getSelection() ); + } +} +