public code v1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?flintstones.helper.data.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,17 @@
|
||||
<?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.valuation.linguistic.ui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Ui</name>
|
||||
<organization>
|
||||
<name>Sinbad2</name>
|
||||
</organization>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.valuation.linguistic.ui</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.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>1779484362747</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>
|
||||
@@ -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,20 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Ui
|
||||
Bundle-SymbolicName: flintstones.valuation.linguistic.ui;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: Sinbad2
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Automatic-Module-Name: flintstones.valuation.linguistic.ui
|
||||
Require-Bundle: flintstones.valuation.ui,
|
||||
flintstones.valuation.linguistic,
|
||||
org.eclipse.wb.swt,
|
||||
javax.inject,
|
||||
org.eclipse.e4.core.services,
|
||||
org.eclipse.swt,
|
||||
flintstones.entity.domain,
|
||||
flintstones.model.valuation.service,
|
||||
flintstones.entity.valuation,
|
||||
flintstones.model.ui.service,
|
||||
flintstones.application.constants
|
||||
Export-Package: flintstones.valuation.linguistic.ui
|
||||
@@ -0,0 +1,5 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension
|
||||
point="flintstones.valuation.ui.extensionpoint">
|
||||
<valuation_ui
|
||||
uid="flintstones.valuation.linguistic.ui"
|
||||
valuation="flintstones.valuation.linguistic"
|
||||
valuation_panel="flintstones.valuation.linguistic.ui.ValuationPanelLinguistic">
|
||||
</valuation_ui>
|
||||
</extension>
|
||||
|
||||
|
||||
</plugin>
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package flintstones.valuation.linguistic.ui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Combo;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.wb.swt.SWTResourceManager;
|
||||
|
||||
import flintstones.domain.fuzzyset.FuzzySet;
|
||||
import flintstones.domain.fuzzyset.label.LabelLinguisticDomain;
|
||||
import flintstones.entity.valuation.Valuation;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
import flintstones.valuation.linguistic.LinguisticValuation;
|
||||
import flintstones.valuation.linguistic.ui.messages.Messages;
|
||||
import flintstones.valuation.ui.ValuationPanel;
|
||||
|
||||
@SuppressWarnings("javadoc")
|
||||
public class ValuationPanelLinguistic extends ValuationPanel {
|
||||
|
||||
private Combo labelCombo;
|
||||
|
||||
private LabelLinguisticDomain label;
|
||||
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
@Override
|
||||
protected void createControls() {
|
||||
UiService.setGridLayout(this.valuationPart, 1);
|
||||
|
||||
createBlock1Title();
|
||||
createBlock2LabelsCombo();
|
||||
}
|
||||
|
||||
private void createBlock1Title() {
|
||||
Label titleLabel = new Label(this.valuationPart, SWT.NONE);
|
||||
titleLabel.setFont(SWTResourceManager.getFont("Cantarell", 11, SWT.BOLD)); //$NON-NLS-1$
|
||||
GridData gd = UiService.setGridData(titleLabel, 0, 0, true, false);
|
||||
gd.verticalIndent = 15;
|
||||
titleLabel.setText(this.messages.Linguistic_evaluation);
|
||||
titleLabel.setBackground(new Color(Display.getCurrent(), 255, 255, 255));
|
||||
}
|
||||
|
||||
private void createBlock2LabelsCombo() {
|
||||
ArrayList<String> labelsName = ((FuzzySet) this.domain).getLabelSet().getLabelsName();
|
||||
this.labelCombo = new Combo(this.valuationPart, SWT.BORDER | SWT.READ_ONLY);
|
||||
GridData gd = UiService.setGridData(this.labelCombo, 0, 1, false, false);
|
||||
gd.verticalIndent = 10;
|
||||
this.labelCombo.setItems(labelsName.toArray(new String[0]));
|
||||
this.labelCombo.setBackground(new Color(Display.getCurrent(), 255, 255, 255));
|
||||
selectComboLabel();
|
||||
this.labelCombo.addModifyListener(e -> {
|
||||
ValuationPanelLinguistic.this.label =
|
||||
((FuzzySet) ValuationPanelLinguistic.this.domain)
|
||||
.getLabelSet()
|
||||
.getLabel(ValuationPanelLinguistic.this.labelCombo.getText());
|
||||
ValuationPanelLinguistic.this.selectionChange();
|
||||
});
|
||||
}
|
||||
|
||||
private void selectComboLabel() {
|
||||
int pos = 0;
|
||||
if (this.valuation != null && this.valuation instanceof LinguisticValuation) {
|
||||
this.label = ((LinguisticValuation) this.valuation).getLabel();
|
||||
pos = ((FuzzySet) this.domain).getLabelSet().getPos(this.label);
|
||||
} else
|
||||
this.label = ((FuzzySet) this.domain).getLabelSet().getLabel(pos);
|
||||
|
||||
this.labelCombo.select(pos);
|
||||
this.selectionChange();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getSelection() {
|
||||
return this.labelCombo.getSelectionIndex();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Valuation createNewValuation() {
|
||||
|
||||
LinguisticValuation result = null;
|
||||
|
||||
if (this.valuation == null) {
|
||||
result = (LinguisticValuation) this.valuationService.create(this.domain);
|
||||
result.setDomain(this.domain);
|
||||
} else
|
||||
result = (LinguisticValuation) this.valuation.clone();
|
||||
|
||||
result.setLabel(this.label);
|
||||
result.setEvaluated(true);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// This file has been auto-generated
|
||||
package flintstones.valuation.linguistic.ui.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
@SuppressWarnings("javadoc")
|
||||
public class Messages {
|
||||
|
||||
public String Linguistic_evaluation;
|
||||
public String Value;
|
||||
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Linguistic_evaluation=Linguistic evaluation
|
||||
Value=Value
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Linguistic_evaluation=Evaluación Linguistica
|
||||
Value=Valor
|
||||
Reference in New Issue
Block a user