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 176908 Details for
Bug 313176
Upgrade XML Document Version action should apply for multi-select
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]
proposed patch for 2.3 maintenance
313176.txt (text/plain), 3.66 KB, created by
Karen Butzke
on 2010-08-18 11:31:56 EDT
(
hide
)
Description:
proposed patch for 2.3 maintenance
Filename:
MIME Type:
Creator:
Karen Butzke
Created:
2010-08-18 11:31:56 EDT
Size:
3.66 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jpt.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/plugin.xml,v >retrieving revision 1.50 >diff -u -r1.50 plugin.xml >--- plugin.xml 26 Mar 2010 18:53:59 -0000 1.50 >+++ plugin.xml 18 Aug 2010 15:19:17 -0000 >@@ -217,25 +217,22 @@ > commandId="org.eclipse.jpt.ui.xmlFileUpgradeToLatestVersion" > class="org.eclipse.jpt.ui.internal.commands.UpgradeXmlFileVersionHandler"> > <enabledWhen> >- <and> >- <count value="1"/> >- <iterate> >- <or> >- <adapt >- type="org.eclipse.jpt.core.context.XmlFile"> >- <test >- property="org.eclipse.jpt.core.isLatestSupportedVersion" >- value="false"/> >- </adapt> >- <adapt >- type="org.eclipse.jpt.core.resource.xml.JpaXmlResource"> >- <test >- property="org.eclipse.jpt.core.isLatestSupportedVersion" >- value="false"/> >- </adapt> >- </or> >- </iterate> >- </and> >+ <iterate> >+ <or> >+ <adapt >+ type="org.eclipse.jpt.core.context.XmlFile"> >+ <test >+ property="org.eclipse.jpt.core.isLatestSupportedVersion" >+ value="false"/> >+ </adapt> >+ <adapt >+ type="org.eclipse.jpt.core.resource.xml.JpaXmlResource"> >+ <test >+ property="org.eclipse.jpt.core.isLatestSupportedVersion" >+ value="false"/> >+ </adapt> >+ </or> >+ </iterate> > </enabledWhen> > </handler> > >Index: src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java >=================================================================== >RCS file: /cvsroot/webtools/org.eclipse.jpa/components/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java,v >retrieving revision 1.2 >diff -u -r1.2 UpgradeXmlFileVersionHandler.java >--- src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java 21 Apr 2010 13:25:57 -0000 1.2 >+++ src/org/eclipse/jpt/ui/internal/commands/UpgradeXmlFileVersionHandler.java 18 Aug 2010 15:19:17 -0000 >@@ -27,11 +27,16 @@ > public Object execute(ExecutionEvent event) throws ExecutionException { > IStructuredSelection selection > = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event); >- >- // only applies for a singly selected objects that adapt to JpaXmlResource or XmlFile >- Object selectedObject = selection.getFirstElement(); >+ >+ for (Object selectedObject : selection.toArray()) { >+ upgradeXmlFileVersion(selectedObject); >+ } >+ return null; >+ } >+ >+ protected void upgradeXmlFileVersion(Object selectedObject) { > JpaXmlResource xmlResource = >- (JpaXmlResource) Platform.getAdapterManager().getAdapter(selectedObject, JpaXmlResource.class); >+ (JpaXmlResource) Platform.getAdapterManager().getAdapter(selectedObject, JpaXmlResource.class); > if (xmlResource == null) { > XmlFile xmlFile = > (XmlFile) Platform.getAdapterManager().getAdapter(selectedObject, XmlFile.class); >@@ -40,21 +45,19 @@ > } > } > if (xmlResource == null) { >- return null; >+ return; > } >- >+ > final JpaRootEObject root = xmlResource.getRootObject(); > IContentType contentType = xmlResource.getContentType(); > JpaProject jpaProject = JptCorePlugin.getJpaProject(xmlResource.getProject()); > final String newVersion = jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(contentType).getVersion(); >- >+ > xmlResource.modify( > new Runnable() { > public void run() { > root.setVersion(newVersion); > } > }); >- >- return null; > } > }
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 313176
: 176908