You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/06/05 16:12:52 UTC
svn commit: r180093 - in
/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen:
eclipse/ eclipse/pages/ eclipse/plugin/ eclipse/ui/ resource/ resources/
Author: ajith
Date: Sun Jun 5 07:12:51 2005
New Revision: 180093
URL: http://svn.apache.org/viewcvs?rev=180093&view=rev
Log:
some refactoring to keep the two eclipse plugins consistent
Added:
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/
- copied from r180088, webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/pages/
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resource/
- copied from r180088, webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resources/
Removed:
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodegenWizardPlugin.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/pages/
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/resources/
Modified:
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodeGenWizard.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OptionsPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OutputPage.java
webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodeGenWizard.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodeGenWizard.java?rev=180093&r1=180092&r2=180093&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodeGenWizard.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/CodeGenWizard.java Sun Jun 5 07:12:51 2005
@@ -9,10 +9,12 @@
import javax.wsdl.WSDLException;
-import org.apache.axis.tool.codegen.eclipse.pages.OptionsPage;
-import org.apache.axis.tool.codegen.eclipse.pages.OutputPage;
-import org.apache.axis.tool.codegen.eclipse.pages.WSDLFileSelectionPage;
+import org.apache.axis.tool.codegen.eclipse.ui.OptionsPage;
+import org.apache.axis.tool.codegen.eclipse.ui.OutputPage;
+import org.apache.axis.tool.codegen.eclipse.ui.WSDLFileSelectionPage;
import org.apache.axis.tool.codegen.eclipse.util.UIConstants;
+import org.apache.axis.tool.codegen.eclipse.plugin.*;
+import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
import org.apache.axis.wsdl.builder.WOMBuilderFactory;
import org.apache.axis.wsdl.codegen.CodeGenConfiguration;
import org.apache.axis.wsdl.codegen.CodeGenerationEngine;
@@ -48,7 +50,7 @@
public CodeGenWizard() {
super();
setNeedsProgressMonitor(true);
- this.setWindowTitle(CodegenWizardPlugin
+ this.setWindowTitle(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("general.name"));
}
Added: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java?rev=180093&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java (added)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/plugin/CodegenWizardPlugin.java Sun Jun 5 07:12:51 2005
@@ -0,0 +1,79 @@
+package org.apache.axis.tool.codegen.eclipse.plugin;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.*;
+import org.osgi.framework.BundleContext;
+import java.util.*;
+
+/**
+ * The main plugin class to be used in the desktop.
+ */
+public class CodegenWizardPlugin extends AbstractUIPlugin {
+ //The shared instance.
+ private static CodegenWizardPlugin plugin;
+ //Resource bundle.
+ private ResourceBundle resourceBundle;
+ private static ImageDescriptor wizardImageDescriptor;
+
+ /**
+ * The constructor.
+ */
+ public CodegenWizardPlugin() {
+ super();
+ plugin = this;
+ try {
+ resourceBundle = ResourceBundle.getBundle("org.apache.axis.tool.codegen.resource.Codegen");
+ } catch (MissingResourceException x) {
+ resourceBundle = null;
+ }
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static CodegenWizardPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the string from the plugin's resource bundle,
+ * or 'key' if not found.
+ */
+ public static String getResourceString(String key) {
+ ResourceBundle bundle = CodegenWizardPlugin.getDefault().getResourceBundle();
+ try {
+ return (bundle != null) ? bundle.getString(key) : key;
+ } catch (MissingResourceException e) {
+ return key;
+ }
+ }
+
+ /**
+ * Returns the plugin's resource bundle,
+ */
+ public ResourceBundle getResourceBundle() {
+ return resourceBundle;
+ }
+
+ public static ImageDescriptor getWizardImageDescriptor(){
+ if (wizardImageDescriptor==null){
+ wizardImageDescriptor =CodegenWizardPlugin.imageDescriptorFromPlugin("Axis2_Codegen_Wizard","icons/asf-feather.gif");
+ }
+ return wizardImageDescriptor;
+ }
+
+}
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OptionsPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OptionsPage.java?rev=180093&r1=180088&r2=180093&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OptionsPage.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OptionsPage.java Sun Jun 5 07:12:51 2005
@@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package org.apache.axis.tool.codegen.eclipse.pages;
+package org.apache.axis.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.CodegenWizardPlugin;
+import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
import org.apache.axis.tool.codegen.eclipse.util.UIConstants;
import org.apache.axis.wsdl.util.URLProcessor;
import org.eclipse.jface.wizard.WizardPage;
@@ -53,7 +53,7 @@
*/
public OptionsPage() {
super(CodegenWizardPlugin.getResourceString("page2.name"));
- setTitle(CodegenWizardPlugin.getResourceString("page2.title"));
+ setTitle(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page2.title"));
setDescription(CodegenWizardPlugin.getResourceString("page2.desc"));
setImageDescriptor(CodegenWizardPlugin.getWizardImageDescriptor());
@@ -95,7 +95,7 @@
.getResourceString("page2.sync.caption"));
asyncOnlyRadioButton = new Button(container, SWT.RADIO);
- asyncOnlyRadioButton.setText(CodegenWizardPlugin
+ asyncOnlyRadioButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("page2.async.caption"));
label = new Label(container, SWT.NULL);
@@ -114,7 +114,7 @@
gd.horizontalSpan = 3;
testCaseCheckBoxButton = new Button(container, SWT.CHECK);
testCaseCheckBoxButton.setLayoutData(gd);
- testCaseCheckBoxButton.setText(CodegenWizardPlugin
+ testCaseCheckBoxButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("page2.testcase.caption"));
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OutputPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OutputPage.java?rev=180093&r1=180088&r2=180093&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OutputPage.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/OutputPage.java Sun Jun 5 07:12:51 2005
@@ -13,9 +13,9 @@
* License for the specific language governing permissions and limitations under
* the License.
*/
-package org.apache.axis.tool.codegen.eclipse.pages;
+package org.apache.axis.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.CodegenWizardPlugin;
+import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.wizard.WizardPage;
@@ -44,8 +44,8 @@
public OutputPage() {
super(CodegenWizardPlugin.getResourceString("page3.name"));
setTitle(CodegenWizardPlugin.getResourceString("page3.title"));
- setDescription(CodegenWizardPlugin.getResourceString("page3.desc"));
- setImageDescriptor(CodegenWizardPlugin.getWizardImageDescriptor());
+ setDescription(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page3.desc"));
+ setImageDescriptor(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getWizardImageDescriptor());
//set the page complete status to false at initilaization
setPageComplete(false);
@@ -64,7 +64,7 @@
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
Label label = new Label(container, SWT.NULL);
- label.setText(CodegenWizardPlugin
+ label.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("page3.output.caption"));
outputLocation = new Text(container, SWT.BORDER);
@@ -76,7 +76,7 @@
});
browseButton = new Button(container, SWT.PUSH);
- browseButton.setText(CodegenWizardPlugin
+ browseButton.setText(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("page3.outselection.browse"));
browseButton.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -108,7 +108,7 @@
private void handleModifyEvent() {
String text = this.outputLocation.getText();
if ((text == null) || (text.trim().equals(""))) {
- updateStatus(CodegenWizardPlugin
+ updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin
.getResourceString("page3.error.nolocation"));
return;
}
@@ -142,7 +142,7 @@
getShell(),
ResourcesPlugin.getWorkspace().getRoot(),
false,
- CodegenWizardPlugin.getResourceString("page3.containerbox.title"));
+ org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page3.containerbox.title"));
if (dialog.open() == ContainerSelectionDialog.OK) {
Object[] result = dialog.getResult();
if (result.length == 1) {
Modified: webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java?rev=180093&r1=180088&r2=180093&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java (original)
+++ webservices/axis/trunk/java/modules/tool/src/org/apache/axis/tool/codegen/eclipse/ui/WSDLFileSelectionPage.java Sun Jun 5 07:12:51 2005
@@ -1,6 +1,6 @@
-package org.apache.axis.tool.codegen.eclipse.pages;
+package org.apache.axis.tool.codegen.eclipse.ui;
-import org.apache.axis.tool.codegen.eclipse.CodegenWizardPlugin;
+import org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin;
import org.eclipse.jface.dialogs.IDialogPage;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
@@ -32,11 +32,11 @@
* @param pageName
*/
public WSDLFileSelectionPage(ISelection selection) {
- super(CodegenWizardPlugin.getResourceString("page1.name"));
+ super(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page1.name"));
setTitle(CodegenWizardPlugin.getResourceString("page1.title"));
- setDescription(CodegenWizardPlugin.getResourceString("page1.desc"));
+ setDescription(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page1.desc"));
this.selection = selection;
- setImageDescriptor(CodegenWizardPlugin.getWizardImageDescriptor());
+ setImageDescriptor(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getWizardImageDescriptor());
//set the page complete status to false at initiation
setPageComplete(false);
}
@@ -88,7 +88,7 @@
}
if (!fileName.matches(".*\\.wsdl")){
- updateStatus(CodegenWizardPlugin.getResourceString("page1.error.wrongextension"));
+ updateStatus(org.apache.axis.tool.codegen.eclipse.plugin.CodegenWizardPlugin.getResourceString("page1.error.wrongextension"));
return;
}