public code v1
This commit is contained in:
@@ -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>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>flintstones.group</groupId>
|
||||
<artifactId>flintstones.bundles</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>flintstones.model.ahppreferences.provider</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Provider</name>
|
||||
</project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.model.ahppreferences.provider</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>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ds.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1779484362716</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,19 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Provider
|
||||
Bundle-SymbolicName: flintstones.model.ahppreferences.provider
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Automatic-Module-Name: flintstones.model.ahppreferences.provider
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Require-Bundle: flintstones.model.ahppreferences.service,
|
||||
flintstones.entity.ahppreferences,
|
||||
org.eclipse.e4.core.contexts,
|
||||
javax.inject,
|
||||
flintstones.model.problemelement.provider,
|
||||
flintstones.model.problemelement.service,
|
||||
org.eclipse.e4.ui.model.workbench,
|
||||
org.eclipse.e4.core.di,
|
||||
flintstones.entity.preferences.preferencecollection,
|
||||
javax.annotation
|
||||
Service-Component: component.xml
|
||||
Bundle-ActivationPolicy: lazy
|
||||
@@ -0,0 +1,5 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
component.xml
|
||||
source.. = src/
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="flintstones.model.ahppreferences.provider">
|
||||
<service>
|
||||
<provide interface="flintstones.model.ahppreferences.service.IProblemPreferencesService"/>
|
||||
</service>
|
||||
<implementation class="flintstones.model.ahppreferences.provider.ProblemPreferencesServiceProvider"/>
|
||||
</scr:component>
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package flintstones.model.ahppreferences.provider;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
|
||||
import flintstones.entity.ahppreferences.PreferenceCollectionKey;
|
||||
import flintstones.entity.preferences.preferencecollection.PreferenceCollection;
|
||||
import flintstones.model.ahppreferences.service.IProblemPreferencesService;
|
||||
|
||||
public class ProblemPreferencesServiceProvider implements IProblemPreferencesService {
|
||||
|
||||
HashMap<PreferenceCollectionKey, PreferenceCollection> preferences = new HashMap<>();
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@PostConstruct
|
||||
private void init() {}
|
||||
|
||||
@Override
|
||||
public void addOrUpdate(PreferenceCollection pc) {
|
||||
preferences.put(pc.getKey(), pc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreferenceCollection get(String mainType, String otherType, String leftType, String rightType) {
|
||||
PreferenceCollectionKey pck = new PreferenceCollectionKey(mainType, otherType, leftType, rightType);
|
||||
return get(pck);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreferenceCollection get(PreferenceCollectionKey pck) {
|
||||
return preferences.get(pck);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<PreferenceCollectionKey, PreferenceCollection> getAllPreferences() {
|
||||
return preferences;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
for(Entry<PreferenceCollectionKey, PreferenceCollection> entry : preferences.entrySet()) {
|
||||
|
||||
PreferenceCollectionKey key = entry.getKey();
|
||||
PreferenceCollection col = entry.getValue();
|
||||
|
||||
sb.append("Preferencias para ");
|
||||
sb.append(key.toString());
|
||||
sb.append("\n");
|
||||
sb.append(col.toString());
|
||||
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
preferences.clear();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user