Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 127970 Details for
Bug 242440
Add service definition extension point to locate workspace artifacts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
patch
wtppatch.txt (text/plain), 23.71 KB, created by
Yen Lu
on 2009-03-08 17:47:29 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yen Lu
Created:
2009-03-08 17:47:29 EDT
Size:
23.71 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.ws.consumption >Index: .classpath >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption/.classpath,v >retrieving revision 1.4 >diff -u -r1.4 .classpath >--- .classpath 31 May 2007 17:34:56 -0000 1.4 >+++ .classpath 8 Mar 2009 21:43:57 -0000 >@@ -2,7 +2,7 @@ > <classpath> > <classpathentry kind="src" path="src"/> > <classpathentry kind="src" path="webserviceutils"/> >- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> > <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> >+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/> > <classpathentry kind="output" path="bin"/> > </classpath> >#P org.eclipse.wst.ws.explorer >Index: src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws.explorer/src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java,v >retrieving revision 1.9.2.1 >diff -u -r1.9.2.1 PopupTestWSDL.java >--- src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java 27 Jan 2009 18:27:32 -0000 1.9.2.1 >+++ src/org/eclipse/wst/ws/internal/explorer/popup/PopupTestWSDL.java 8 Mar 2009 21:43:57 -0000 >@@ -23,6 +23,7 @@ > import java.util.List; > import java.util.Vector; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.action.Action; >@@ -30,12 +31,14 @@ > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; > import org.eclipse.ui.IActionDelegate; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.explorer.LaunchOption; > import org.eclipse.wst.ws.internal.explorer.LaunchOptions; > import org.eclipse.wst.ws.internal.explorer.WSExplorerLauncherCommand; > import org.eclipse.wst.ws.internal.explorer.plugin.ExplorerPlugin; > import org.eclipse.wst.ws.internal.monitor.GetMonitorCommand; > import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils; > import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper; > import org.eclipse.wst.wsdl.Definition; >@@ -65,15 +68,27 @@ > String wsdlURL = null; > Object object = it.next(); > if (object instanceof IResource) >- { >- File wsdlFile = ((IResource)object).getLocation().toFile(); >- try >+ { >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) > { >- wsdlURL = wsdlFile.toURL().toString(); >+ if (object instanceof IFile) >+ wsdlURL = converter.convert((IFile)object); >+ if (wsdlURL == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); > } >- catch (MalformedURLException murle) >+ if (wsdlURL == null && allowBaseConversionOnFailure) > { >+ File wsdlFile = ((IResource)object).getLocation().toFile(); >+ try >+ { >+ wsdlURL = wsdlFile.toURL().toString(); >+ } >+ catch (MalformedURLException murle) >+ { > wsdlURL = wsdlFile.toString(); >+ } > } > } > else if (Platform.getAdapterManager().hasAdapter(object, WSDLURLStringWrapper.class.getName())) { >@@ -100,8 +115,8 @@ > // If not found, wsdlURL would still be null. > wsdlURL = AdapterUtils.getAdaptedWSDL(object); > } >- >- addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation); >+ if (wsdlURL != null) >+ addLaunchOptions(launchOptions, wsdlURL, stateLocation, defaultFavoritesLocation); > } > } > command.setLaunchOptions((LaunchOption[])launchOptions.toArray(new LaunchOption[0])); >#P org.eclipse.jst.ws.consumption.ui >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java,v >retrieving revision 1.38 >diff -u -r1.38 WSDLSelectionWidget.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java 29 Mar 2007 02:23:42 -0000 1.38 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/object/WSDLSelectionWidget.java 8 Mar 2009 21:43:58 -0000 >@@ -74,6 +74,7 @@ > import org.eclipse.wst.command.internal.env.core.common.StatusUtils; > import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents; > import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.parser.wsil.WebServiceEntity; > import org.eclipse.wst.ws.internal.parser.wsil.WebServicesParser; > import org.eclipse.wst.ws.internal.plugin.WSPlugin; >@@ -510,15 +511,28 @@ > > private String iFile2URI(IFile file) > { >- File f = file.getLocation().toFile(); >- try >- { >- return f.toURL().toString(); >- } >- catch (MalformedURLException murle) >- { >- } >- return f.toString(); >+ String uri = null; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ uri = converter.convert(file); >+ if (uri == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ if (uri == null && allowBaseConversionOnFailure) >+ { >+ File f = file.getLocation().toFile(); >+ try >+ { >+ uri = f.toURL().toString(); >+ } >+ catch (MalformedURLException murle) >+ { >+ uri = f.toString(); >+ } >+ } >+ return uri; > } > > public void setInitialSelection(IStructuredSelection initialSelection) >Index: src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java,v >retrieving revision 1.15.2.2 >diff -u -r1.15.2.2 WSDLSelectionWidgetDefaultingCommand.java >--- src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java 7 Jan 2009 15:33:11 -0000 1.15.2.2 >+++ src/org/eclipse/jst/ws/internal/consumption/ui/widgets/WSDLSelectionWidgetDefaultingCommand.java 8 Mar 2009 21:43:58 -0000 >@@ -36,6 +36,8 @@ > import org.eclipse.jst.ws.internal.common.ResourceUtils; > import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; > import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.ui.utils.AdapterUtils; > import org.eclipse.wst.ws.internal.util.UniversalPathTransformer; > import org.eclipse.wst.ws.internal.wsfinder.WSDLURLStringWrapper; >@@ -62,8 +64,18 @@ > IFile ifile = (IFile)firstSel; > String ext = ifile.getFileExtension(); > if (ext != null && (ext.equalsIgnoreCase("wsdl") || ext.equalsIgnoreCase("wsil") || ext.equalsIgnoreCase("html"))) >- { >- uri_ = ifile.getFullPath().toString(); >+ { >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ uri_ = converter.convert(ifile); >+ if (uri_ == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ >+ } >+ if ((uri_ == null || uri_.length() == 0) && allowBaseConversionOnFailure) >+ uri_ = ifile.getFullPath().toString(); > } > } > else if (Platform.getAdapterManager().hasAdapter(firstSel, WSDLURLStringWrapper.class.getName())) { >#P org.eclipse.wst.ws >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/plugin.properties,v >retrieving revision 1.10.2.1 >diff -u -r1.10.2.1 plugin.properties >--- plugin.properties 16 Jul 2008 22:08:50 -0000 1.10.2.1 >+++ plugin.properties 8 Mar 2009 21:43:58 -0000 >@@ -27,6 +27,7 @@ > X_WEB_SERVICE_LOCATOR_CATEGORY_WORKSPACE=Workspace WSDL documents > X_WSIL_CONTENT_TYPE=Web Services Inspection Language Document > XP_EXTENSIBILITY_ELEMENT_TRANSFORMER=Extensibility Element Transformer >+XP_IFILE_2_URI_CONVERTER=IFile to URI Converter > > MSG_ERROR_UNABLE_TO_START_MONITOR=IWAB0001E Unable to monitor port {0} of {1}. > >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/plugin.xml,v >retrieving revision 1.20.2.1 >diff -u -r1.20.2.1 plugin.xml >--- plugin.xml 16 Jul 2008 22:08:50 -0000 1.20.2.1 >+++ plugin.xml 8 Mar 2009 21:43:58 -0000 >@@ -7,6 +7,7 @@ > <extension-point id="locator" name="%XP_WEB_SERVICE_LOCATOR" schema="schema/webServiceLocator.exsd"/> > > <extension-point id="ExtensibilityElementTransformer" name="%XP_EXTENSIBILITY_ELEMENT_TRANSFORMER" schema="schema/ExtensibilityElementTransformer.exsd"/> >+ <extension-point id="ifile2uriconverter" name="%XP_IFILE_2_URI_CONVERTER" schema="schema/ifile2uriconverter.exsd"/> > > <!-- Extension providing workspace WSDL discovery --> > <extension >Index: src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java,v >retrieving revision 1.8 >diff -u -r1.8 WSPlugin.java >--- src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java 24 Apr 2006 18:05:05 -0000 1.8 >+++ src/org/eclipse/wst/ws/internal/plugin/WSPlugin.java 8 Mar 2009 21:43:58 -0000 >@@ -15,7 +15,12 @@ > > package org.eclipse.wst.ws.internal.plugin; > >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IExtension; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.core.runtime.Plugin; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; > import org.eclipse.wst.ws.internal.preferences.PersistentMergeContext; > import org.eclipse.wst.ws.internal.preferences.PersistentWSDLValidationContext; > import org.eclipse.wst.ws.internal.preferences.PersistentWSIAPContext; >@@ -37,6 +42,8 @@ > private PersistentWSDLValidationContext wsdlValidationContext_; > private PersistentWaitForWSDLValidationContext waitForWsdlValidationContext_; > private PersistentMergeContext mergeContext_; >+ private IIFile2UriConverter iFile2UriConverter_; >+ private boolean isIFile2UriConverterInitialized_ = false; > > public static final String ID = "org.eclipse.wst.ws"; > >@@ -157,4 +164,38 @@ > } > return mergeContext_; > } >-} >+ >+ /** >+ * <p> >+ * Get the product's registered IFile to URI converter. If there is no converter registered then this method will return null. >+ * @return The IFile to URI converter registered with the <code>org.eclipse.wst.ws/IFile2UriConverterId</code> preference in plugin_customization.ini >+ */ >+ public IIFile2UriConverter getIFile2UriConverter() >+ { >+ if (!isIFile2UriConverterInitialized_) >+ { >+ String productConverterId = getPluginPreferences().getDefaultString("IFile2UriConverterId"); >+ if (productConverterId.length() > 0) >+ { >+ IExtension extension = Platform.getExtensionRegistry().getExtension(productConverterId); >+ if (extension != null) >+ { >+ IConfigurationElement[] configElements = extension.getConfigurationElements(); >+ if (configElements.length > 0) >+ { >+ try >+ { >+ iFile2UriConverter_ = (IIFile2UriConverter)configElements[0].createExecutableExtension("class"); >+ } >+ catch (CoreException e) >+ { >+ getLog().log(e.getStatus()); >+ } >+ } >+ } >+ } >+ isIFile2UriConverterInitialized_ = true; >+ } >+ return iFile2UriConverter_; >+ } >+} >\ No newline at end of file >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/META-INF/MANIFEST.MF,v >retrieving revision 1.39.2.3 >diff -u -r1.39.2.3 MANIFEST.MF >--- META-INF/MANIFEST.MF 7 Jan 2009 21:24:04 -0000 1.39.2.3 >+++ META-INF/MANIFEST.MF 8 Mar 2009 21:43:58 -0000 >@@ -8,6 +8,7 @@ > Bundle-Localization: plugin > Export-Package: org.eclipse.wst.ws.internal;x-internal:=true, > org.eclipse.wst.ws.internal.common;x-internal:=true, >+ org.eclipse.wst.ws.internal.converter, > org.eclipse.wst.ws.internal.data;x-internal:=true, > org.eclipse.wst.ws.internal.datamodel;x-internal:=true, > org.eclipse.wst.ws.internal.ext;x-internal:=true, >Index: src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java >=================================================================== >RCS file: /cvsroot/webtools/webservices/plugins/org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java,v >retrieving revision 1.7 >diff -u -r1.7 WorkspaceWSDLLocator.java >--- src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java 11 Jul 2006 20:04:56 -0000 1.7 >+++ src/org/eclipse/wst/ws/internal/wsfinder/WorkspaceWSDLLocator.java 8 Mar 2009 21:43:58 -0000 >@@ -18,6 +18,7 @@ > import java.util.List; > import java.util.Vector; > >+import org.eclipse.core.resources.IFile; > import org.eclipse.core.resources.IProject; > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IResourceVisitor; >@@ -25,6 +26,8 @@ > import org.eclipse.core.resources.ResourcesPlugin; > import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.wst.ws.internal.converter.IIFile2UriConverter; >+import org.eclipse.wst.ws.internal.plugin.WSPlugin; > import org.eclipse.wst.ws.internal.wsrt.WebServiceInfo; > > /** >@@ -124,14 +127,27 @@ > public boolean visit(IResource resource) > { > if (resource.getType() == IResource.FILE) >- { >- String ext = resource.getFileExtension(); >- if (ext != null && ext.equalsIgnoreCase(WSDL_EXT)) >+ { >+ String wsdlURL = null; >+ IIFile2UriConverter converter = WSPlugin.getInstance().getIFile2UriConverter(); >+ boolean allowBaseConversionOnFailure = true; >+ if (converter != null) >+ { >+ wsdlURL = converter.convert((IFile)resource); >+ if (wsdlURL == null) >+ allowBaseConversionOnFailure = converter.allowBaseConversionOnFailure(); >+ } >+ if (wsdlURL == null && allowBaseConversionOnFailure) >+ { >+ String ext = resource.getFileExtension(); >+ if (ext != null && ext.equalsIgnoreCase(WSDL_EXT)) >+ wsdlURL = PLATFORM_RES + resource.getFullPath().toString(); >+ } >+ if (wsdlURL != null) > { >- String urlString = PLATFORM_RES + resource.getFullPath().toString(); >- WebServiceInfo wsInfo = new WebServiceInfo(); >- wsInfo.setWsdlURL(urlString); >- wsdl.add(wsInfo); >+ WebServiceInfo wsInfo = new WebServiceInfo(); >+ wsInfo.setWsdlURL(wsdlURL); >+ wsdl.add(wsInfo); > } > } > return true; >Index: schema/ifile2uriconverter.exsd >=================================================================== >RCS file: schema/ifile2uriconverter.exsd >diff -N schema/ifile2uriconverter.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/ifile2uriconverter.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,106 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.wst.ws" xmlns="http://www.w3.org/2001/XMLSchema"> >+<annotation> >+ <appinfo> >+ <meta.schema plugin="org.eclipse.wst.ws" id="ifile2uriconverter" name="IFile to URI Converter"/> >+ </appinfo> >+ <documentation> >+ This extension point is provided to register IFile to URI converters which can override the default implementation of either file: or platform: URIs provided by the Web Services tools. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appinfo> >+ <meta.element /> >+ </appinfo> >+ </annotation> >+ <complexType> >+ <sequence> >+ <element ref="converter"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ This is the ID of the IFile to URI Converter extension. If the extension will serve the product then this is the ID that must be added to the product's plugin_customization.ini via the setting: >+ >+<code>org.eclipse.wst.ws/IFile2UriConverter = [value of id]</code> >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appinfo> >+ <meta.attribute translatable="true"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="converter"> >+ <complexType> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The fully qualified class name of the IFile to URI converter provided for this product. >+ </documentation> >+ <appinfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.wst.internal.converter.AbstractIFile2UriConverter:"/> >+ </appinfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="since"/> >+ </appinfo> >+ <documentation> >+ [Enter the first release in which this extension point appears.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="examples"/> >+ </appinfo> >+ <documentation> >+ <extension point="org.eclipse.wst.ws.ifile2uriconverter" id="com.example.converterplugin.converterextension"> >+ <converter class="com.example.converterplugin.impl.MyIFile2UriConverter"/> >+</extension> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="apiinfo"/> >+ </appinfo> >+ <documentation> >+ Extenders should subclass <code>org.eclipse.wst.ws/src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter</code> >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appinfo> >+ <meta.section type="implementation"/> >+ </appinfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ >+</schema> >Index: src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >=================================================================== >RCS file: src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >diff -N src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/ws/internal/converter/IIFile2UriConverter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 2006 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.wst.ws.internal.converter; >+ >+import org.eclipse.core.resources.IFile; >+ >+/** >+ * <p> >+ * The interface for an Eclipse IFile to URI converter. Adopters should >+ * subclass AbstractIFile2UriConverter instead. >+ * >+ * @see AbstractIFile2UriConverter >+ */ >+public interface IIFile2UriConverter { >+ /** >+ * <p> >+ * Produce a String URI from a given IFile. The IFile is from the workbench. If this method returns null, >+ * the result is considered a failure and the >+ * {@link #allowBaseConversionOnFailure allowBaseConversionOnFailure} method will be consulted to determine >+ * whether or not base conversion should be used as a backup. >+ * @param file An IFile reference. >+ * @return The String URI corresponding to the IFile reference. >+ * <p> >+ * @since 3.1 >+ */ >+ public String convert(IFile file); >+ >+ /** >+ * <p> >+ * Determines whether or not a converter will allow base conversion routines to be performed >+ * when a failure occurs. >+ * @return <code>true</code> if base conversion should be performed when a failure occurs. >+ * <p> >+ * @since 3.1 >+ */ >+ public boolean allowBaseConversionOnFailure(); >+} >Index: src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >=================================================================== >RCS file: src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >diff -N src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/ws/internal/converter/AbstractIFile2UriConverter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,33 @@ >+/******************************************************************************* >+ * Copyright (c) 2005, 2006 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.wst.ws.internal.converter; >+ >+import org.eclipse.core.resources.IFile; >+ >+/** >+ * <p> >+ * The abstract implementation of an IFile to URI converter. Adopters who wish to >+ * provide their own converter should subclass this abstract class rather than implementing IIFile2UriConverter. >+ * >+ * @see IIFile2UriConverter >+ */ >+public abstract class AbstractIFile2UriConverter implements IIFile2UriConverter { >+ >+ public String convert(IFile file) { >+ return null; >+ } >+ >+ public boolean allowBaseConversionOnFailure() >+ { >+ return true; >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 242440
:
127970
|
128241
|
128285