Remove javax.inject usages - unnecessary
Signed-off-by: BoykoAlex <alex.boyko@broadcom.com>
This commit is contained in:
@@ -49,5 +49,4 @@ Import-Package: org.eclipse.core.runtime,
|
||||
com.google.gson.annotations,
|
||||
com.google.gson.reflect,
|
||||
com.google.gson.stream,
|
||||
org.apache.commons.lang3,
|
||||
javax.inject
|
||||
org.apache.commons.lang3
|
||||
|
||||
@@ -15,24 +15,23 @@ import static org.springframework.ide.eclipse.editor.support.util.HtmlSnippet.ra
|
||||
import static org.springframework.ide.eclipse.editor.support.util.HtmlSnippet.text;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.springframework.ide.eclipse.editor.support.EditorSupportActivator;
|
||||
import org.springframework.ide.eclipse.editor.support.util.HtmlSnippet;
|
||||
import org.springsource.ide.eclipse.commons.frameworks.core.util.IOUtil;
|
||||
|
||||
/**
|
||||
* Static methods and convenience constants for creating some 'description providers'.
|
||||
* Static methods and convenience constants for creating some 'description Suppliers'.
|
||||
*
|
||||
* @author Kris De Volder
|
||||
*/
|
||||
public class DescriptionProviders {
|
||||
|
||||
public static final Provider<HtmlSnippet> NO_DESCRIPTION = snippet(italic(text("no description")));
|
||||
public static final Supplier<HtmlSnippet> NO_DESCRIPTION = snippet(italic(text("no description")));
|
||||
|
||||
public static Provider<HtmlSnippet> snippet(final HtmlSnippet snippet) {
|
||||
return new Provider<HtmlSnippet>() {
|
||||
public static Supplier<HtmlSnippet> snippet(final HtmlSnippet snippet) {
|
||||
return new Supplier<HtmlSnippet>() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return snippet.toString();
|
||||
@@ -44,8 +43,8 @@ public class DescriptionProviders {
|
||||
};
|
||||
}
|
||||
|
||||
public static Provider<HtmlSnippet> fromClasspath(final Class<?> klass, final String resourcePath) {
|
||||
return new Provider<HtmlSnippet>() {
|
||||
public static Supplier<HtmlSnippet> fromClasspath(final Class<?> klass, final String resourcePath) {
|
||||
return new Supplier<HtmlSnippet>() {
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HtmlSnippetFromClassPth(class="+klass.getSimpleName()+", "+resourcePath+")";
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
*******************************************************************************/
|
||||
package org.springframework.ide.eclipse.editor.support.util;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
@@ -18,13 +18,13 @@ import org.eclipse.ui.texteditor.ITextEditor;
|
||||
|
||||
/**
|
||||
* Convenience methods to addapt various types of objects representing a 'ui context'
|
||||
* to a Shell{@link Provider}
|
||||
* to a Shell{@link Supplier}
|
||||
*
|
||||
* @author Kris De Volder
|
||||
*/
|
||||
public class ShellProviders {
|
||||
public static Provider<Shell> from(final ITextEditor editor) {
|
||||
return new Provider<Shell>() {
|
||||
public static Supplier<Shell> from(final ITextEditor editor) {
|
||||
return new Supplier<Shell>() {
|
||||
@Override
|
||||
public Shell get() {
|
||||
return editor.getSite().getShell();
|
||||
@@ -32,8 +32,8 @@ public class ShellProviders {
|
||||
};
|
||||
}
|
||||
|
||||
public static Provider<Shell> from(final Composite composite) {
|
||||
return new Provider<Shell>() {
|
||||
public static Supplier<Shell> from(final Composite composite) {
|
||||
return new Supplier<Shell>() {
|
||||
@Override
|
||||
public Shell get() {
|
||||
return composite.getShell();
|
||||
|
||||
@@ -19,8 +19,7 @@ import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.inject.Provider;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.eclipse.core.runtime.Assert;
|
||||
import org.springframework.ide.eclipse.editor.support.hover.DescriptionProviders;
|
||||
@@ -148,7 +147,7 @@ public class YTypeFactory {
|
||||
private List<YTypedProperty> propertyList = new ArrayList<>();
|
||||
private final List<YValueHint> hints = new ArrayList<>();
|
||||
private Map<String, YTypedProperty> cachedPropertyMap;
|
||||
private Provider<Collection<YValueHint>> hintProvider;
|
||||
private Supplier<Collection<YValueHint>> hintProvider;
|
||||
private List<Constraint> constraints = new ArrayList<>(2);
|
||||
|
||||
public boolean isSequenceable() {
|
||||
@@ -171,7 +170,7 @@ public class YTypeFactory {
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addHintProvider(Provider<Collection<YValueHint>> hintProvider) {
|
||||
public void addHintProvider(Supplier<Collection<YValueHint>> hintProvider) {
|
||||
this.hintProvider = hintProvider;
|
||||
}
|
||||
|
||||
@@ -181,7 +180,7 @@ public class YTypeFactory {
|
||||
if (providerHints == null || providerHints.isEmpty()) {
|
||||
return hints.toArray(new YValueHint[hints.size()]);
|
||||
} else {
|
||||
// Only merge if there are provider hints to merge
|
||||
// Only merge if there are Supplier hints to merge
|
||||
Set<YValueHint> mergedHints = new LinkedHashSet<>();
|
||||
|
||||
// Add type hints first
|
||||
@@ -189,7 +188,7 @@ public class YTypeFactory {
|
||||
mergedHints.add(val);
|
||||
}
|
||||
|
||||
// merge the provider hints
|
||||
// merge the Supplier hints
|
||||
for (YValueHint val : providerHints) {
|
||||
mergedHints.add(val);
|
||||
}
|
||||
@@ -226,7 +225,7 @@ public class YTypeFactory {
|
||||
propertyList.add(p);
|
||||
}
|
||||
|
||||
public void addProperty(String name, YType type, Provider<HtmlSnippet> description) {
|
||||
public void addProperty(String name, YType type, Supplier<HtmlSnippet> description) {
|
||||
YTypedPropertyImpl prop;
|
||||
addProperty(prop = new YTypedPropertyImpl(name, type));
|
||||
prop.setDescriptionProvider(description);
|
||||
@@ -413,7 +412,7 @@ public class YTypeFactory {
|
||||
|
||||
final private String name;
|
||||
final private YType type;
|
||||
private Provider<HtmlSnippet> descriptionProvider = DescriptionProviders.NO_DESCRIPTION;
|
||||
private Supplier<HtmlSnippet> descriptionProvider = DescriptionProviders.NO_DESCRIPTION;
|
||||
private boolean isDeprecated;
|
||||
private String deprecationMessage;
|
||||
|
||||
@@ -442,7 +441,7 @@ public class YTypeFactory {
|
||||
return descriptionProvider.get();
|
||||
}
|
||||
|
||||
public void setDescriptionProvider(Provider<HtmlSnippet> descriptionProvider) {
|
||||
public void setDescriptionProvider(Supplier<HtmlSnippet> descriptionProvider) {
|
||||
this.descriptionProvider = descriptionProvider;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user