repo-reorg-2020: moved sts4-relevant spring-ide bundles from https://github.com/spring-projects/spring-ide/releases/tag/REPO-REORG-2020 into sts4 repo

This commit is contained in:
Martin Lippert
2020-09-29 14:00:01 +02:00
parent 8edfab1a16
commit de16884b60
2210 changed files with 160282 additions and 43 deletions

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.springframework.ide.eclipse.boot.refactoring</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
<filteredResources>
<filter>
<id>1422403535988</id>
<name></name>
<type>10</type>
<matcher>
<id>org.eclipse.ui.ide.multiFilter</id>
<arguments>1.0-projectRelativePath-matches-false-false-target</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View File

@@ -0,0 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

View File

@@ -0,0 +1,60 @@
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=false
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=false
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=false
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_type_arguments=true
sp_cleanup.remove_trailing_whitespaces=true
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=false
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
sp_cleanup.use_type_arguments=false

View File

@@ -0,0 +1,29 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-Localization: plugin
Bundle-SymbolicName: org.springframework.ide.eclipse.boot.refactoring;singleton:=true
Bundle-Version: 4.8.1.qualifier
Bundle-Activator: org.springframework.ide.eclipse.boot.refactoring.SpringBootRefactoringPlugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.jdt.ui,
org.eclipse.ui.editors,
org.eclipse.text,
org.eclipse.core.resources,
org.eclipse.jface.text,
org.eclipse.jdt.core,
org.eclipse.ui.workbench.texteditor,
org.eclipse.ui.ide,
org.yaml.snakeyaml,
org.eclipse.ltk.core.refactoring,
org.eclipse.ltk.ui.refactoring,
org.springsource.ide.eclipse.commons.livexp,
com.google.guava,
org.springsource.ide.eclipse.commons.frameworks.core,
org.springframework.ide.eclipse.editor.support,
org.eclipse.jdt.core.manipulation
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: .
Bundle-Vendor: %providerName

View File

@@ -0,0 +1,248 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<title>About Spring IDE</title>
<meta name="author" content="Spring IDE Developers">
</head>
<body>
<h2>About Spring IDE</h2>
<p>March 26, 2007</p>
<h3>Abstract</h3>
<p>Spring IDE is a set of plugins which provide a user interface for
<a href="https://www.springframework.org">The Spring Framework</a>'s bean
factory XML configuration files including support for Spring 2.0
namespaces, AOP configuration and Spring Web Flow.</p>
<h3>License</h3>
<p>The Spring IDE Project makes available all content in this
plug-in (&quot;Content&quot;). Unless otherwise indicated below, the
Content is provided to you under the terms and conditions of the Eclipse
Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="https://www.eclipse.org/legal/epl-v10.html">https://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from the Spring IDE
Project, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may apply
to your use of any object code in the Content. Check the Redistributor's
license that was provided with the Content. If no such license exists,
contact the Redistributor. Unless otherwise indicated below, the terms
and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="https://www.eclipse.org">https://www.eclipse.org</a>.</p>
<h3>Third Party Content</h3>
<p>The Content includes items that have been sourced from third
parties as set out below. If you did not receive this Content directly
from the Spring IDE Project, the following is provided for informational
purposes only, and you should look to the Redistributor's license for
terms and conditions of use.</p>
<p><em> <strong>The Spring Framework v3.0.5</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Web Flow v2.0.7.A</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Web Services v1.5.8</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Security v3.0.2</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Dynamic Modules for OSGi(TM) Runtimes v2.0.0.M2</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Spring Batch v2.1.0</strong>
<p>This product includes software developed by the Spring Framework
Project (<a href="https://www.springframework.org">https://www.springframework.org</a>).</p>
<p><em> <strong>Commons Codec v1.3.0</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Commons Collections v3.2.0</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Commons Logging v1.1.1</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>Apache MyFaces v1.2.2</strong>
<p>This product includes software developed by The Apache Software
Foundation (<a href="https://www.apache.org/">https://www.apache.org/</a>).</p>
<p><em> <strong>AspectJ Weaver v1.6.10</strong>
<p>This product includes software developed by The Eclipse Software
Foundation (<a href="https://www.eclipse.org/">https://www.eclipse.org/</a>).</p>
<p><em> <strong>Antlr v3.0.1</strong>
<p>Spring IDE includes a binary version of Antlr v3.0.1 (<a
href="https://www.antlr.org">https://www.antlr.org/</a>).
The source code for Antlr is available from the Antlr download site at
<a href="https://www.antlr.org/download.html">https://www.antlr.org/download.html</a>.
<p>The Antlr license is available at <a
href="https://www.antlr.org/license.html">https://www.antlr.org/license.html</a>.
The license is also reproduced here:</p>
<pre>Copyright (c) 2003-2007, Terence Parr
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions
and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions
and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the author nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</pre></p>
<p><em> <strong>ASM v2.2.3</strong>
<p>Spring IDE includes a binary version of ASM v2.2.3 (<a
href="https://asm.objectweb.org/index.html">https://asm.objectweb.org/</a>).
The source code for ASM is available from the ObjectWeb download site at
<a href="https://asm.objectweb.org/download/">https://asm.objectweb.org/download/</a>.
<p>The ASM license is available at <a
href="https://asm.objectweb.org/license.html">https://asm.objectweb.org/license.html</a>.
The license is also reproduced here:</p>
<pre>Copyright (c) 2000-2005 INRIA, France Telecom
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
</pre></p>
<p><em> <strong>backport-util-concurrent 3.1.0</strong>
<p>Spring IDE includes a binary version of backport-util-concurrent v3.1.0 (<a
href="https://dcl.mathcs.emory.edu/util/backport-util-concurrent/">https://dcl.mathcs.emory.edu/util/backport-util-concurrent/</a>).
The source code for backport-util-concurrent is available from the download site at
<a href="https://dcl.mathcs.emory.edu/util/backport-util-concurrent/dist/">https://dcl.mathcs.emory.edu/util/backport-util-concurrent/dist/</a>.
<p>The backport-util-concurrent license is available at <a
href="https://creativecommons.org/licenses/publicdomain">https://creativecommons.org/licenses/publicdomain</a>.
The license is also reproduced here:</p>
<pre><em>Copyright-Only Dedication (based on United States law) or Public Domain Certification</em>
The person or persons who have associated work with this document (the
"Dedicator" or "Certifier") hereby either (a) certifies that, to the
best of his knowledge, the work of authorship identified is in the public
domain of the country from which the work is published, or (b) hereby
dedicates whatever copyright the dedicators holds in the work of authorship
identified below (the "Work") to the public domain. A certifier, moreover,
dedicates any copyright interest he may have in the associated work, and
for these purposes, is described as a "dedicator" below.
A certifier has taken reasonable steps to verify the copyright status of
this work. Certifier recognizes that his good faith efforts may not shield
him from liability if in fact the work certified is not in the public domain.
Dedicator makes this dedication for the benefit of the public at large and
to the detriment of the Dedicator's heirs and successors. Dedicator intends
this dedication to be an overt act of relinquishment in perpetuity of all
present and future rights under copyright law, whether vested or contingent,
in the Work. Dedicator understands that such relinquishment of all rights
includes the relinquishment of all rights to enforce (by lawsuit or otherwise)
those copyrights in the Work.
Dedicator recognizes that, once placed in the public domain, the Work may be
freely reproduced, distributed, transmitted, used, modified, built upon, or
otherwise exploited by anyone for any purpose, commercial or non-commercial,
and in any way, including by methods that have not yet been invented or
conceived.
</pre></p>
<p><em> <strong>AOP Alliance</strong>
<p>LICENCE: all the source code provided by AOP Alliance is Public Domain.
</p>
<p><em> <strong>javax.el v1.0.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.jms v1.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet v2.5.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet.jsp v2.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.servlet.jsp.jstl v1.2.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.activation v1.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.annotation v1.0.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.mail v1.4.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.xml.stream v1.0.1</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
<p><em> <strong>javax.xml.ws v2.1.0</strong>
<p>This product includes software distributed by Sun (meanwhile Oracle) under CDDL license
(<a href="https://www.sun.com/cddl/cddl.html">https://www.sun.com/cddl/cddl.html</a>).</p>
</em></p>
<address>Copyright (c) 2005, 2011 Spring IDE Developers</address>
</body>
</html>

View File

@@ -0,0 +1,9 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html,\
plugin.properties,\
icons/

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

View File

@@ -0,0 +1,2 @@
pluginName=Spring Boot Refactoring
providerName=Pivotal Software, Inc.

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<command
categoryId="org.springframework.ide.eclipse.boot.commands.category"
defaultHandler="org.springframework.ide.eclipse.boot.refactoring.ConvertPropertiesToYamlHandler"
id="org.springframework.ide.eclipse.boot.properties.editor.convertPropertiesToYaml"
name="Convert .properties to .yaml">
</command>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="popup:org.eclipse.ui.popup.any?after=additions">
<command
icon="icons/boot-icon.png"
commandId="org.springframework.ide.eclipse.boot.properties.editor.convertPropertiesToYaml">
<visibleWhen
checkEnabled="false">
<and>
<count
value="1">
</count>
<or>
<with variable="activeEditorId">
<equals value="SpringBootPropertyEditor"/>
</with>
<with variable="activeMenuSelection">
<iterate
ifEmpty="false">
<adapt type="org.eclipse.core.resources.IResource">
<test property="org.eclipse.core.resources.extension" value="properties" />
</adapt>
</iterate>
</with>
</or>
</and>
</visibleWhen>
</command>
</menuContribution>
</extension>
<extension point="org.eclipse.ltk.core.refactoring.renameParticipants">
<renameParticipant class="org.springframework.ide.eclipse.boot.refactoring.typerename.TypeRenameParticipant" id="org.springframework.ide.eclipse.boot.refactoring.TypeRenameParticipant" name="Rename Companion Type Rename Participant">
<enablement>
<with variable="affectedNatures">
<iterate operator="or">
<equals value="org.eclipse.jdt.core.javanature"/>
</iterate>
</with>
<with variable="element">
<instanceof value="org.eclipse.jdt.core.IType"/>
</with>
</enablement>
</renameParticipant>
</extension>
</plugin>

View File

@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot.ide</groupId>
<artifactId>org.springframework.boot.ide</artifactId>
<version>4.8.1-SNAPSHOT</version>
<relativePath>../../eclipse-distribution/pom.xml</relativePath>
</parent>
<groupId>org.springframework.ide.eclipse</groupId>
<artifactId>org.springframework.ide.eclipse.boot.refactoring</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<version>${tycho-version}</version>
<configuration>
<resolver>p2</resolver>
<pomDependencies>ignore</pomDependencies>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho-version}</version>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>plugin-source</id>
<phase>generate-sources</phase>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>second-generate-p2-metadata</id>
<goals>
<goal>p2-metadata</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@@ -0,0 +1,94 @@
/*******************************************************************************
* Copyright (c) 2017 Spring IDE Developers
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Spring IDE Developers - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.refactoring;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.filebuffers.FileBuffers;
import org.eclipse.core.filebuffers.ITextFileBuffer;
import org.eclipse.core.filebuffers.LocationKind;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
import org.eclipse.ui.handlers.HandlerUtil;
import org.springsource.ide.eclipse.commons.livexp.util.Log;
import org.eclipse.ltk.core.refactoring.RefactoringContext;
public class ConvertPropertiesToYamlHandler extends AbstractHandler {
private static ITextFileBuffer getDirtyFileBuffer(IFile file) {
ITextFileBuffer buffer = FileBuffers.getTextFileBufferManager().getTextFileBuffer(file.getFullPath(), LocationKind.IFILE);
if (buffer!=null && buffer.isDirty()) {
return buffer;
}
return null;
}
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
IFile file = getTarget(event);
try {
if (file!=null) {
ITextFileBuffer dirtyBuffer = getDirtyFileBuffer(file);
if (dirtyBuffer!=null) {
dirtyBuffer.commit(null, true);
}
ConvertPropertiesToYamlRefactoring refactoring = new ConvertPropertiesToYamlRefactoring(file);
RefactoringWizard wizard = new RefactoringWizard(refactoring,
RefactoringWizard.DIALOG_BASED_USER_INTERFACE |
RefactoringWizard.CHECK_INITIAL_CONDITIONS_ON_OPEN |
RefactoringWizard.NO_BACK_BUTTON_ON_STATUS_DIALOG
) {
@Override
protected void addUserInputPages() {
//no inputs required
}
};
new RefactoringWizardOpenOperation(wizard).run(HandlerUtil.getActiveShell(event), "Convert '"+file.getName()+"' to .yaml");
}
} catch (Exception e) {
Log.log(e);
}
return null;
}
private IFile getTarget(ExecutionEvent event) {
ISelection selection = HandlerUtil.getActiveMenuSelection(event);
IStructuredSelection ss = null;
if (selection instanceof IStructuredSelection) {
ss = (IStructuredSelection) selection;
} else {
selection = HandlerUtil.getActiveMenuEditorInput(event);
if (selection instanceof IStructuredSelection) {
ss = (IStructuredSelection) selection;
}
}
if (ss!=null && !ss.isEmpty()) {
return asFile(ss.getFirstElement());
}
return null;
}
private IFile asFile(Object selectedElement) {
if (selectedElement instanceof IFile) {
return (IFile) selectedElement;
}
if (selectedElement instanceof IAdaptable) {
return ((IAdaptable) selectedElement).getAdapter(IFile.class);
}
return null;
}
}

View File

@@ -0,0 +1,145 @@
/*******************************************************************************
* Copyright (c) 2017 Spring IDE Developers
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Spring IDE Developers - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.refactoring;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;
import java.util.LinkedHashSet;
import java.util.Properties;
import java.util.TreeMap;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Path;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.CompositeChange;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.TextFileChange;
import org.eclipse.ltk.core.refactoring.resource.RenameResourceChange;
import org.eclipse.text.edits.ReplaceEdit;
import org.springsource.ide.eclipse.commons.frameworks.core.util.IOUtil;
import org.springsource.ide.eclipse.commons.livexp.util.ExceptionUtil;
import com.google.common.collect.Multimap;
import com.google.common.collect.Multimaps;
public class ConvertPropertiesToYamlRefactoring extends Refactoring {
private static final String YAML_EXT = ".yml";
private static final String PROPERTIES_EXT = ".properties";
private static final Pattern COMMENT = Pattern.compile("(?m)^\\s*(\\#|\\!)");
private final IFile propsFile;
private IFile yamlFile;
private String yamlContent;
private int inputTextLen;
public ConvertPropertiesToYamlRefactoring(IFile propertiesFile) {
this.propsFile = propertiesFile;
}
@Override
public String getName() {
return "Convert .properties to .yaml";
}
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
if (!propsFile.isAccessible()) {
return RefactoringStatus.createFatalErrorStatus("The resource '"+propsFile.getFullPath()+"' is not accessible");
}
this.yamlFile = yamlFileFor(propsFile);
if (yamlFile.exists()) {
return RefactoringStatus.createFatalErrorStatus("File '"+yamlFile.getFullPath()+"' already exists!");
}
return new RefactoringStatus();
}
private IFile yamlFileFor(IFile propsFile) {
IContainer container = propsFile.getParent();
String name = propsFile.getName();
if (name.endsWith(PROPERTIES_EXT)) {
name = name.substring(0, name.length()-PROPERTIES_EXT.length())+YAML_EXT;
} else {
name = name + YAML_EXT;
}
return container.getFile(Path.EMPTY.append(name));
}
@Override
public RefactoringStatus checkFinalConditions(IProgressMonitor pm) throws CoreException, OperationCanceledException {
RefactoringStatus status = new RefactoringStatus();
try {
if (hasComments(propsFile)) {
status.merge(RefactoringStatus.createWarningStatus("The properties file has comments, which will be lost in the refactoring!"));
}
} catch (Exception e) {
status.merge(RefactoringStatus.create(ExceptionUtil.status(e, "Problems reading file: "+propsFile.getFullPath())));
return status;
}
Multimap<String, String> properties = null;
try (InputStream content = propsFile.getContents()) {
properties = load(content);
} catch (Exception e) {
status.merge(RefactoringStatus.create(ExceptionUtil.status(e, "Problems parsing as a .properties file: "+propsFile.getFullPath())));
}
if (properties!=null) {
PropertiesToYamlConverter converter = new PropertiesToYamlConverter(properties);
this.yamlContent = converter.getYaml();
status.merge(converter.getStatus());
}
return status;
}
protected Multimap<String, String> load(InputStream content) throws IOException {
Multimap<String, String> map = Multimaps.newMultimap(
new TreeMap<String, Collection<String>>(),
LinkedHashSet::new
);
Properties loader = new Properties() {
private static final long serialVersionUID = 1L;
public synchronized Object put(Object key, Object value) {
map.put((String)key, (String)value);
return super.put(key, value);
}
};
loader.load(content);
return map;
}
private boolean hasComments(IFile propsFile) throws Exception {
String inputText = IOUtil.toString(propsFile.getContents());
inputTextLen = inputText.length();
return hasComments(inputText);
}
private boolean hasComments(String propsFileContent) {
return COMMENT.matcher(propsFileContent).find();
}
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
CompositeChange changes = new CompositeChange(getName());
TextFileChange textChange = new TextFileChange(getName(), propsFile);
textChange.setEdit(new ReplaceEdit(0, inputTextLen, yamlContent));
changes.add(textChange);
changes.add(new RenameResourceChange(propsFile.getFullPath(), yamlFile.getName()));
changes.initializeValidationData(pm);
return changes;
}
}

View File

@@ -0,0 +1,174 @@
/*******************************************************************************
* Copyright (c) 2017 Spring IDE Developers
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Spring IDE Developers - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.refactoring;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.stream.Collectors;
import org.eclipse.core.runtime.Assert;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPath;
import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPathSegment;
import org.springframework.ide.eclipse.editor.support.yaml.path.YamlPathSegment.AtIndex;
import org.yaml.snakeyaml.DumperOptions;
import org.yaml.snakeyaml.Yaml;
import com.google.common.collect.Multimap;
/**
* Helper class to convert (Spring Boot) .properties file content into equivalent
* .yml file content.
*
* @author Kris De Volder
*/
public class PropertiesToYamlConverter {
private RefactoringStatus status = new RefactoringStatus();
private String output;
class YamlBuilder {
final YamlPath path;
final List<Object> scalars = new ArrayList<>();
final TreeMap<Integer, YamlBuilder> listItems = new TreeMap<>();
final TreeMap<String, YamlBuilder> mapEntries = new TreeMap<>();
public YamlBuilder(YamlPath path) {
this.path = path;
}
void addProperty(YamlPath path, String value) {
if (path.isEmpty()) {
scalars.add(objectify(value));
} else {
YamlPathSegment segment = path.getSegment(0);
YamlBuilder subBuilder;
if (segment instanceof AtIndex) {
subBuilder = getSubBuilder(listItems, segment, segment.toIndex());
} else {
subBuilder = getSubBuilder(mapEntries, segment, segment.toPropString());
}
subBuilder.addProperty(path.dropFirst(1), value);
}
}
private Object objectify(String value) {
if (value != null) {
Object parsed = null;
try {
parsed = new BigInteger(value);
} catch (NumberFormatException e) {
try {
parsed = new BigDecimal(value);
} catch (NumberFormatException e2) {
if (value.equals("true")) {
parsed = true;
} else if (value.equals("false")) {
parsed = false;
}
}
}
if (parsed!=null && parsed.toString().equals(value)) {
return parsed;
}
}
return value;
}
private <T> YamlBuilder getSubBuilder(TreeMap<T, YamlBuilder> subBuilders, YamlPathSegment segment, T key) {
YamlBuilder existing = subBuilders.get(key);
if (existing==null) {
subBuilders.put(key, existing = new YamlBuilder(path.append(segment)));
}
return existing;
}
public Object build() {
if (!scalars.isEmpty()) {
if (listItems.isEmpty() && mapEntries.isEmpty()) {
if (scalars.size()>1) {
status.addWarning("Multiple values "+ scalars +" assigned to '"+path.toPropString()+"'. Values will be merged into a yaml sequence node.");
return scalars;
} else {
return scalars.get(0);
}
} else {
if (!mapEntries.isEmpty()) {
status.addError(
"Direct assignment '"+path.toPropString()+"="+scalars.get(0)+"' can not be combined " +
"with sub-property assignment '"+path.toPropString()+"." + mapEntries.keySet().iterator().next()+"...'. "+
"Direct assignment will be dropped!"
);
} else {
status.addError(
"Direct assignment '"+path.toPropString()+"="+scalars.get(0)+"' can not be combined " +
"with sequence assignment '"+path.toPropString()+"[" + listItems.keySet().iterator().next()+"]...' "+
"Direct assignments will be dropped!"
);
}
scalars.clear();
}
}
Assert.isLegal(scalars.isEmpty());
if (!listItems.isEmpty() && !mapEntries.isEmpty()) {
status.addWarning("'"+path.toPropString()+"' has some entries that look like list items and others that look like map entries. "
+ "All these entries will be treated as map entries");
for (Entry<Integer, YamlBuilder> listItem : listItems.entrySet()) {
mapEntries.put(listItem.getKey().toString(), listItem.getValue());
}
listItems.clear();
}
if (!listItems.isEmpty()) {
return listItems.values().stream()
.map(childBuilder -> childBuilder.build())
.collect(Collectors.toList());
} else {
TreeMap<String, Object> map = new TreeMap<>();
for (Entry<String, YamlBuilder> entry : mapEntries.entrySet()) {
map.put(entry.getKey(), entry.getValue().build());
}
return map;
}
}
}
public PropertiesToYamlConverter(Multimap<String, String> properties) {
if (properties.isEmpty()) {
output = "";
return;
}
YamlBuilder root = new YamlBuilder(YamlPath.EMPTY);
for (Entry<String, String> e : properties.entries()) {
root.addProperty(YamlPath.fromProperty(e.getKey()), e.getValue());
}
Object object = root.build();
DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setPrettyFlow(true);
Yaml yaml = new Yaml(options);
this.output = yaml.dump(object);
}
public RefactoringStatus getStatus() {
return status;
}
public String getYaml() {
return output;
}
}

View File

@@ -0,0 +1,21 @@
/*******************************************************************************
* Copyright (c) 2018 Pivotal, Inc.
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.refactoring;
import org.eclipse.ui.plugin.AbstractUIPlugin;
public class SpringBootRefactoringPlugin extends AbstractUIPlugin {
public SpringBootRefactoringPlugin() {
// TODO Auto-generated constructor stub
}
}

View File

@@ -0,0 +1,178 @@
/*******************************************************************************
* Copyright (c) 2016 Pivotal, Inc.
* 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
* https://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Pivotal, Inc. - initial API and implementation
*******************************************************************************/
package org.springframework.ide.eclipse.boot.refactoring.typerename;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating;
import org.eclipse.jdt.ui.refactoring.RenameSupport;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ltk.core.refactoring.Change;
import org.eclipse.ltk.core.refactoring.NullChange;
import org.eclipse.ltk.core.refactoring.RefactoringStatus;
import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
import org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor;
import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.progress.UIJob;
import org.springsource.ide.eclipse.commons.livexp.util.ExceptionUtil;
import org.springsource.ide.eclipse.commons.livexp.util.Log;
/**
* @author Kris De Volder
*/
@SuppressWarnings("restriction")
public class TypeRenameParticipant extends RenameParticipant {
private static final String[] POSTFIXES = { "Test", "Tests"};
private IType renamedType;
private IType companionType;
public TypeRenameParticipant() {
}
@Override
protected boolean initialize(Object element) {
try {
if (element instanceof IType) {
this.renamedType = (IType) element;
this.companionType = findCompanion(renamedType);
return companionType!=null;
}
} catch (Exception e) {
Log.log(e);
}
return false;
}
private IType findCompanion(IType renamedType) throws Exception {
if (!renamedType.isMember() && !renamedType.isAnonymous()) {
IJavaProject project = renamedType.getJavaProject();
for (String postfix : POSTFIXES) {
String baseName = renamedType.getFullyQualifiedName();
String companionName = baseName+postfix;
IType companion = project.findType(companionName);
if (companion!=null && !companion.isBinary()) {
return companion;
}
}
}
return null;
}
@Override
public String getName() {
return "Rename Type Participant";
}
@Override
public RefactoringStatus checkConditions(IProgressMonitor pm, CheckConditionsContext context)
throws OperationCanceledException {
return RefactoringStatus.create(Status.OK_STATUS);
}
private void schedulePromptForCompanionTypeRename() {
System.out.println("DDDD");
UIJob job = new UIJob("Prompt for Companion Type Rename") {
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
try {
String oldName = renamedType.getElementName();
String oldCompanionName = companionType.getElementName();
String newName = getArguments().getNewName();
Assert.isLegal(oldCompanionName.startsWith(oldName));
String postfix = oldCompanionName.substring(oldName.length());
String newCompanionName = newName+postfix;
boolean answeredYes = MessageDialog.openQuestion(getShell(), "Also Rename '"+companionType.getElementName()+"'?",
"Type '"+oldName+"' was renamed to '"+newName+"'." +
"Do you also want to rename '"+companionType.getElementName()+
"' from package '"+companionType.getPackageFragment().getElementName()+"' "+
"to '"+newCompanionName+"'?"
);
if (answeredYes) {
int options = 0;
if ( getArguments().getUpdateReferences()) {
options |= RenameSupport.UPDATE_REFERENCES;
}
if (getUpdateTextualMatches()) {
options |= RenameSupport.UPDATE_TEXTUAL_MATCHES;
}
RenameSupport renameSupport = RenameSupport.create(companionType, newCompanionName, options);
renameSupport.perform(getShell(), PlatformUI.getWorkbench().getProgressService());
}
return Status.OK_STATUS;
} catch (Exception e) {
return ExceptionUtil.status(e);
}
}
private Shell getShell() {
try {
return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
} catch (Exception e) {
//troubles getting shell... no worries we'll just pass null.
}
return null;
}
};
job.setRule(ResourcesPlugin.getWorkspace().getRuleFactory().buildRule());
job.schedule();
}
private boolean getUpdateTextualMatches() {
RefactoringProcessor processor = getProcessor();
if (processor instanceof ITextUpdating) {
return ((ITextUpdating) processor).getUpdateTextualMatches();
}
return false;
}
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
//This is not an active participant. It does not contribute changes to the refactoring. It will just schedule
return new Change() {
@Override
public Change perform(IProgressMonitor pm) throws CoreException {
schedulePromptForCompanionTypeRename();
return new NullChange();
}
@Override
public String getName() {
return "Prompt rename companion: '"+companionType.getElementName()+"'";
}
@Override
public void initializeValidationData(IProgressMonitor pm) {
}
@Override
public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
return new RefactoringStatus();
}
@Override
public Object getModifiedElement() {
return null;
}
};
}
}