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"/>
|
||||
<classpathentry exported="true" 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.application.perspective.framework.ui</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] FrameworkUI</name>
|
||||
<organization>
|
||||
<name>Sinbad2</name>
|
||||
</organization>
|
||||
</project>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.application.perspective.framework.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>1779484362526</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>
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//OSGI-INF/l10n/bundle_zh_cn.properties=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
+7
@@ -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
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,40 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: %Bundle-Name
|
||||
Bundle-SymbolicName: flintstones.application.perspective.framework.ui;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Vendor: %Bundle-Vendor
|
||||
Export-Package: flintstones.application.perspective.framework.ui.interfaces,
|
||||
flintstones.application.perspective.framework.ui.providers,
|
||||
flintstones.application.perspective.framework.ui.viewer
|
||||
Require-Bundle: flintstones.element.common.ui,
|
||||
flintstones.entity.problemelement;visibility:=reexport,
|
||||
org.eclipse.e4.ui.services,
|
||||
flintstones.model.problemelement.service,
|
||||
org.eclipse.e4.core.services,
|
||||
flintstones.helper.ui,
|
||||
org.eclipse.e4.core.contexts,
|
||||
javax.inject,
|
||||
org.eclipse.e4.core.di,
|
||||
flintstones.model.domain.service,
|
||||
flintstones.entity.domain,
|
||||
flintstones.model.valuation.service,
|
||||
flintstones.entity.domain.ui.chart,
|
||||
flintstones.model.domain.ui.service,
|
||||
flintstones.entity.domain.ui.dialog,
|
||||
javax.annotation,
|
||||
flintstones.model.ui.service,
|
||||
org.eclipse.nebula.widgets.opal.notifier,
|
||||
flintstones.helper.html,
|
||||
flintstones.helper.data,
|
||||
flintstones.model.ahpsort.profileassignment.service,
|
||||
flintstones.entity.problemelement.ui,
|
||||
flintstones.entity.ahpsort.profileassignment,
|
||||
flintstones.entity.sorting.ui,
|
||||
flintstones.model.ahppreferences.service,
|
||||
flintstones.model.ahp.referencepoint.service,
|
||||
flintstones.helper.extensionpoint,
|
||||
flintstones.entity.domain.ui.provider,
|
||||
flintstones.helper.debug
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-11
|
||||
Automatic-Module-Name: flintstones.framework.ui
|
||||
+82
@@ -0,0 +1,82 @@
|
||||
flintstones.framework.ui.part.experts.label = Experts
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.label = Add expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.tooltip = Add expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.label = Add auto-generated expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.tooltip = Add auto-generated expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.label = Modify expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.tooltip = Modify expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.label = Remove expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.tooltip = Remove expert
|
||||
flintstones.framework.ui.part.alternatives.label = Alternatives
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.label = Add alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.tooltip = Add alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.label = Add auto-generated alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.tooltip = Add auto-generated alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.label = Modify alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.tooltip = Modify alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.label = Remove alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.tooltip = Remove alternative
|
||||
flintstones.framework.ui.part.criteria.label = Criteria
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.label = Add criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.tooltip = Add criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.label = Add auto-generated criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.tooltip = Add auto-generated criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.label = Modify criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.tooltip = Modify criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.label = Remove criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.tooltip = Remove criterion
|
||||
flintstones.framework.ui.part.domains.label = Domains
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.label = Add domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.tooltip = Add domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.label = Add auto-generated domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.tooltip = Add auto-generated domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.label = Modify domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.tooltip = Modify domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.label = Remove domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.tooltip = Remove domain
|
||||
flintstones.framework.ui.part.sortingclasses.label = Sorting classes
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.label = Add class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.tooltip = Add class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.label = Modify class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.tooltip = Modify class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.label = Remove class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.tooltip = Remove class
|
||||
flintstones.framework.ui.part.domain.label = Domain
|
||||
flintstones.framework.ui.part.clasification.label = Classification
|
||||
flintstones.framework.ui.command.addpe.label = Add problem element
|
||||
flintstones.framework.ui.command.modifype.label = Modify problem element
|
||||
flintstones.framework.ui.command.removepe.label = Remove problem element
|
||||
flintstones.framework.ui.command.modifyexpert.label = Modify expert
|
||||
flintstones.framework.ui.command.removeexpert.label = Remove expert
|
||||
flintstones.framework.ui.command.modifyalternative.label = Modify alternative
|
||||
flintstones.framework.ui.command.removealternative.label = Remove alternative
|
||||
flintstones.framework.ui.command.modifycriterion.label = Modify criterion
|
||||
flintstones.framework.ui.command.removecriterion.label = Remove criterion
|
||||
flintstones.framework.ui.command.adddomain.label = Add domain
|
||||
flintstones.framework.ui.command.modifydomain.label = Modify domain
|
||||
flintstones.framework.ui.command.removedomain.label = Remove domain
|
||||
flintstones.framework.ui.command.modifysortingclass.label = Modify sorting class
|
||||
flintstones.framework.ui.command.removesortingclass.label = Remove sorting class
|
||||
flintstones.framework.ui.menu.framework.label = Framework
|
||||
flintstones.framework.ui.menu.experts.label = Experts
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.addexpert.label = Add
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.modifyexpert.label = Modify
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.removeexpert.label = Remove
|
||||
flintstones.framework.ui.menu.alternatives.label = Alternatives
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.addalternative.label = Add
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.modifyalternative.label = Modify
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.removealternative.label = Remove
|
||||
flintstones.framework.ui.menu.criteria.label = Criteria
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.addcriterion.label = Add
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.modifycriterion.label = Modify
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.removecriterion.label = Remove
|
||||
flintstones.framework.ui.menu.domains.label = Domains
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.adddomain.label = Add
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.modifydomain.label = Modify
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.removedomain.label = Remove
|
||||
flintstones.framework.ui.menu.sortingclasses.label = Sorting classes
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.addsortingclass.label = Add
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.modifysortingclass.label = Modify
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.removesortingclass.label = Remove
|
||||
Bundle-Vendor = Sinbad2
|
||||
Bundle-Name = FrameworkUI
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
|
||||
flintstones.framework.ui.part.experts.label = Expertos
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.label = Añadir experto
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.tooltip = Añadir experto
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.label = Añadir experto autogenerado
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.tooltip = Añadir experto autogenerado
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.label = Modificar experto
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.tooltip = Modificar experto
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.label = Eliminar experto
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.tooltip = Eliminar experto
|
||||
flintstones.framework.ui.part.alternatives.label = Alternativas
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.label = Añadir alternativa
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.tooltip = Añadir alternativa
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.label = Añadir alternativa autogenerada
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.tooltip = Añadir alternativa autogenerada
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.label = Modificar alternativa
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.tooltip = Modificar alternativa
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.label = Eliminar alternativa
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.tooltip = Eliminar alternativa
|
||||
flintstones.framework.ui.part.criteria.label = Criterios
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.label = Añadir criterio
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.tooltip = Añadir criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.label = Añadir criterio autogenerado
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.tooltip = Añadir criterio autogenerado
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.label = Modificar criterio
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.tooltip = Modificar criterio
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.label = Eliminar criterio
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.tooltip = Eliminar criterio
|
||||
flintstones.framework.ui.part.domains.label = Dominios
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.label = Añadir dominio
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.tooltip = Añadir dominio
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.label = Añadir dominio autogenerado
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.tooltip = Añadir dominio autogenerado
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.label = Modificar dominio
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.tooltip = Modificar dominio
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.label = Eliminar dominio
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.tooltip = Eliminar dominio
|
||||
flintstones.framework.ui.part.sortingclass.label = Clases
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.label = Añadir clase
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.tooltip = Añadir clase
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.label = Modificar clase
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.tooltip = Modificar clase
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.label = Eliminar clase
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.tooltip = Eliminar clase
|
||||
flintstones.framework.ui.part.domain.label = Dominio
|
||||
flintstones.framework.ui.part.clasification.label = Clasificación
|
||||
flintstones.framework.ui.command.addpe.label = Añadir elemento de problema
|
||||
flintstones.framework.ui.command.modifype.label = Modificar elemento del problema
|
||||
flintstones.framework.ui.command.removepe.label = Eliminar elemento del problema
|
||||
flintstones.framework.ui.command.adddomain.label = Añadir dominio
|
||||
flintstones.framework.ui.command.modifydomain.label = Modificar dominio
|
||||
flintstones.framework.ui.command.removedomain.label = Eliminar dominio
|
||||
flintstones.framework.ui.menu.framework.label = Framework
|
||||
flintstones.framework.ui.menu.experts.label = Expertos
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.addexpert.label = Añadir
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.modifyexpert.label = Modificar
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.removeexpert.label = Eliminar
|
||||
flintstones.framework.ui.menu.alternatives.label = Alternativas
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.addalternative.label Añadir
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.modifyalternative.label = Modificar
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.removealternative.label = Eliminar
|
||||
flintstones.framework.ui.menu.criteria.label = Criterios
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.addcriterion.label = Añadir
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.modifycriterion.label = Modificar
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.removecriterion.label = Eliminar
|
||||
flintstones.framework.ui.menu.domains.label = Dominios
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.adddomain.label = Añadir
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.modifydomain.label = Modificar
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.removedomain.label = Eliminar
|
||||
flintstones.framework.ui.menu.sortingclasses.label = Clases
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.addsortingclass.label = Añadir
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.modifysortingclass.label = Modificar
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.removesortingclass.label = Eliminar
|
||||
Bundle-Vendor = Sinbad2
|
||||
Bundle-Name = FrameworkUI
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
flintstones.framework.ui.part.experts.label = 发框架
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.label = Add expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.addexpert.tooltip = Add expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.label = Modify expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.tooltip = Modify expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.label = Remove expert
|
||||
flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.tooltip = Remove expert
|
||||
flintstones.framework.ui.part.alternatives.label = Alternatives
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.label = Add alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.tooltip = Add alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.label = Modify alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.tooltip = Modify alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.label = Remove alternative
|
||||
flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.tooltip = Remove alternative
|
||||
flintstones.framework.ui.part.criteria.label = Criteria
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.label = Add criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.tooltip = Add criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.label = Modify criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.tooltip = Modify criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.label = Remove criterion
|
||||
flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.tooltip = Remove criterion
|
||||
flintstones.framework.ui.part.domains.label = Domains
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.label = Add domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.adddomain.tooltip = Add domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.label = Modify domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.tooltip = Modify domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.label = Remove domain
|
||||
flintstones.framework.ui.part.domains.handledtoolitem.removedomain.tooltip = Remove domain
|
||||
flintstones.framework.ui.part.sortingclasses.label = Sorting classes
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.label = Add class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.tooltip = Add class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.label = Modify class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.tooltip = Modify class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.label = Remove class
|
||||
flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.tooltip = Remove class
|
||||
flintstones.framework.ui.part.domain.label = Domain
|
||||
flintstones.framework.ui.part.clasification.label = Classification
|
||||
flintstones.framework.ui.command.addpe.label = Add problem element
|
||||
flintstones.framework.ui.command.modifype.label = Modify problem element
|
||||
flintstones.framework.ui.command.removepe.label = Remove problem element
|
||||
flintstones.framework.ui.command.modifyexpert.label = Modify expert
|
||||
flintstones.framework.ui.command.removeexpert.label = Remove expert
|
||||
flintstones.framework.ui.command.modifyalternative.label = Modify alternative
|
||||
flintstones.framework.ui.command.removealternative.label = Remove alternative
|
||||
flintstones.framework.ui.command.modifycriterion.label = Modify criterion
|
||||
flintstones.framework.ui.command.removecriterion.label = Remove criterion
|
||||
flintstones.framework.ui.command.adddomain.label = Add domain
|
||||
flintstones.framework.ui.command.modifydomain.label = Modify domain
|
||||
flintstones.framework.ui.command.removedomain.label = Remove domain
|
||||
flintstones.framework.ui.command.modifysortingclass.label = Modify sorting class
|
||||
flintstones.framework.ui.command.removesortingclass.label = Remove sorting class
|
||||
flintstones.framework.ui.menu.framework.label = Framework
|
||||
flintstones.framework.ui.menu.experts.label = Experts
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.addexpert.label = Add
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.modifyexpert.label = Modify
|
||||
flintstones.framework.ui.menu.experts.handledmenuitem.removeexpert.label = Remove
|
||||
flintstones.framework.ui.menu.alternatives.label = Alternatives
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.addalternative.label = Add
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.modifyalternative.label = Modify
|
||||
flintstones.framework.ui.menu.alternatives.handledmenuitem.removealternative.label = Remove
|
||||
flintstones.framework.ui.menu.criteria.label = Criteria
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.addcriterion.label = Add
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.modifycriterion.label = Modify
|
||||
flintstones.framework.ui.menu.criteria.handledmenuitem.removecriterion.label = Remove
|
||||
flintstones.framework.ui.menu.domains.label = Domains
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.adddomain.label = Add
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.modifydomain.label = Modify
|
||||
flintstones.framework.ui.menu.domains.handledmenuitem.removedomain.label = Remove
|
||||
flintstones.framework.ui.menu.sortingclasses.label = Sorting classes
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.addsortingclass.label = Add
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.modifysortingclass.label = Modify
|
||||
flintstones.framework.ui.menu.sortingclasses.handledmenuitem.removesortingclass.label = Remove
|
||||
Bundle-Vendor = Sinbad2
|
||||
Bundle-Name = FrameworkUI
|
||||
@@ -0,0 +1,8 @@
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
fragment.e4xmi,\
|
||||
plugin.xml,\
|
||||
OSGI-INF/,\
|
||||
OSGI-INF/l10n/bundle.properties
|
||||
source.. = src/
|
||||
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<fragment:ModelFragments xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:basic="http://www.eclipse.org/ui/2010/UIModel/application/ui/basic" xmlns:commands="http://www.eclipse.org/ui/2010/UIModel/application/commands" xmlns:fragment="http://www.eclipse.org/ui/2010/UIModel/fragment" xmlns:menu="http://www.eclipse.org/ui/2010/UIModel/application/ui/menu" xmi:id="_DzaBoNmeEee116JrfV3ZgA">
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_xwM1sNmvEee116JrfV3ZgA" featurename="commands" parentElementId="flintstones.application.application">
|
||||
<elements xsi:type="commands:Command" xmi:id="_UtshAI0LEemebIlYrceR2A" elementId="flintstones.framework.ui.command.addpe" commandName="%flintstones.framework.ui.command.addpe.label">
|
||||
<parameters xmi:id="_gEbIsI0LEemebIlYrceR2A" elementId="add_object_parameter" name="Parameter"/>
|
||||
</elements>
|
||||
<elements xsi:type="commands:Command" xmi:id="_VVsDMI0NEemebIlYrceR2A" elementId="flintstones.framework.ui.command.modifype" commandName="%flintstones.framework.ui.command.modifype.label">
|
||||
<parameters xmi:id="_gfWfQI0NEemebIlYrceR2A" elementId="modify_object_parameter" name="Parameter"/>
|
||||
</elements>
|
||||
<elements xsi:type="commands:Command" xmi:id="_hIqQEI0PEemebIlYrceR2A" elementId="flintstones.framework.ui.command.removepe" commandName="%flintstones.framework.ui.command.removepe.label">
|
||||
<parameters xmi:id="_s_i-gI0PEemebIlYrceR2A" elementId="remove_object_parameter" name="Parameter"/>
|
||||
</elements>
|
||||
<elements xsi:type="commands:Command" xmi:id="_7fgPwNmzEee116JrfV3ZgA" elementId="flintstones.framework.ui.command.adddomain" commandName="%flintstones.framework.ui.command.adddomain.label"/>
|
||||
<elements xsi:type="commands:Command" xmi:id="_7w5hwNmzEee116JrfV3ZgA" elementId="flintstones.framework.ui.command.modifydomain" commandName="%flintstones.framework.ui.command.modifydomain.label"/>
|
||||
<elements xsi:type="commands:Command" xmi:id="_8CJCwNmzEee116JrfV3ZgA" elementId="flintstones.framework.ui.command.removedomain" commandName="%flintstones.framework.ui.command.removedomain.label"/>
|
||||
<elements xsi:type="commands:Command" xmi:id="_AMeHYNXqEeiSwMCPn2wPHw" elementId="flintstones.framework.ui.command.addsomeexpert" commandName="Añadir varios expertos"/>
|
||||
<elements xsi:type="commands:Command" xmi:id="_pLspkEVqEems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.command.pastePE" commandName="Paste PE">
|
||||
<parameters xmi:id="_Fb36oEVrEems14nuCAO_MA" elementId="paste_parameter_id" name="Type"/>
|
||||
</elements>
|
||||
<elements xsi:type="commands:Command" xmi:id="_r1zJENdxEeiOnpCMp-K8MA" elementId="flintstones.framework.ui.command.addobjectparameters" commandName="Añadir varios">
|
||||
<parameters xmi:id="_zkzcINdxEeiOnpCMp-K8MA" elementId="add_object_parameter" name="Parameter"/>
|
||||
</elements>
|
||||
<elements xsi:type="commands:Command" xmi:id="_20OsoJGZEemj6dmkdhydeA" elementId="flintstones.application.perspective.framework.ui.command.fastadddomain" commandName="Fast Add Domain"/>
|
||||
<elements xsi:type="commands:Command" xmi:id="_z63yoJKFEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.command.toggleprofiles" commandName="Toggle Profiles">
|
||||
<parameters xmi:id="_3ZQlEJKFEem4bI5DgXWjVg" elementId="profile_type" name="Parameter"/>
|
||||
</elements>
|
||||
</fragments>
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_EGScMNmwEee116JrfV3ZgA" featurename="handlers" parentElementId="flintstones.application.application">
|
||||
<elements xsi:type="commands:Handler" xmi:id="_kC2tII0LEemebIlYrceR2A" elementId="flintstones.framework.ui.handler.addpe" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.AddProblemElementHandler" command="_UtshAI0LEemebIlYrceR2A"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_hzdygI0NEemebIlYrceR2A" elementId="flintstones.framework.ui.handler.modifype" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.ModifyProblemElementHandler" command="_VVsDMI0NEemebIlYrceR2A"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_xssDEI0PEemebIlYrceR2A" elementId="flintstones.framework.ui.handler.removepe" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.RemoveProblemElementHandler" command="_hIqQEI0PEemebIlYrceR2A"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_ljOwQNm0Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handler.adddomain" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.AddDomainHandler" command="_7fgPwNmzEee116JrfV3ZgA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_l7pQQNm0Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handler.removedomain" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.RemoveDomainHandler" command="_8CJCwNmzEee116JrfV3ZgA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_lvqpwNm0Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handler.modifydomain" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.ModifyDomainHandler" command="_7w5hwNmzEee116JrfV3ZgA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_UzdBQNeREeiFeIU5BaU4cw" elementId="flintstones.framework.ui.handler.addobjectparameters" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.AddSomeProblemElementHandler" command="_r1zJENdxEeiOnpCMp-K8MA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_rjb9AEVqEems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.handler.paste" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.PasteProblemElementsHandler" command="_pLspkEVqEems14nuCAO_MA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_46z-oJGZEemj6dmkdhydeA" elementId="flintstones.application.perspective.framework.ui.handler.fastadddomain" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.FastAddDomainHandler" command="_20OsoJGZEemj6dmkdhydeA"/>
|
||||
<elements xsi:type="commands:Handler" xmi:id="_Wcr2UJKFEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.handler.toggleprofiles" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.handlers.ToggleProfilesHandler" command="_z63yoJKFEem4bI5DgXWjVg"/>
|
||||
</fragments>
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_FXNp0Nm2Eee116JrfV3ZgA" featurename="children" parentElementId="flintstones.application.menu.main">
|
||||
<elements xsi:type="menu:Menu" xmi:id="_M3e9UNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.menu.framework" label="%flintstones.framework.ui.menu.framework.label">
|
||||
<children xsi:type="menu:Menu" xmi:id="_O5obQNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.menu.experts" label="%flintstones.framework.ui.menu.experts.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/group-of-experts.png">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_RlmSQNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.addexpert" label="%flintstones.framework.ui.menu.experts.handledmenuitem.addexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_CyMLcI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addexpert" name="add_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_RzQTwNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.modifyexpert" label="%flintstones.framework.ui.menu.experts.handledmenuitem.modifyexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_EMuPwI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifyExpert" name="modify_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_SAsS0Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.removeexpert" label="%flintstones.framework.ui.menu.experts.handledmenuitem.removeexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_IJ8TQI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removeExpert" name="remove_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="menu:Menu" xmi:id="_PvH40Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.menu.alternatives" label="%flintstones.framework.ui.menu.alternatives.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/alternatives.png">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_SRoR0Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.addalternative" label="%flintstones.framework.ui.menu.alternatives.handledmenuitem.addalternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_K9QIYI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addalternative" name="add_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_Sg410Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.modifyalternative" label="%flintstones.framework.ui.menu.alternatives.handledmenuitem.modifyalternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_MAtwgI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifyalternative" name="modify_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_Ss3cUNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.removealternative" label="%flintstones.framework.ui.menu.alternatives.handledmenuitem.removealternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_ReQXQI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removealternative" name="remove_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="menu:Menu" xmi:id="_P82y0Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.menu.criteria" label="%flintstones.framework.ui.menu.criteria.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/criteria.png">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_S5rwUNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.addcriterion" label="%flintstones.framework.ui.menu.criteria.handledmenuitem.addcriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_WIAJkI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addcriterion" name="add_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_TEvw0Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.modifycriterion" label="%flintstones.framework.ui.menu.criteria.handledmenuitem.modifycriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_XowKoI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifycriterion" name="modify_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_TQft0Nm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.removecriterion" label="%flintstones.framework.ui.menu.criteria.handledmenuitem.removecriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_ZJLbkI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removecriterion" name="remove_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="menu:Menu" xmi:id="_QI_KUNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.menu.domains" label="%flintstones.framework.ui.menu.domains.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/domains.png">
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_Tcx2UNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.adddomain" label="%flintstones.framework.ui.menu.domains.handledmenuitem.adddomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" command="_7fgPwNmzEee116JrfV3ZgA"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_Tpv7UNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.modifydomain" label="%flintstones.framework.ui.menu.domains.handledmenuitem.modifydomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" command="_7w5hwNmzEee116JrfV3ZgA"/>
|
||||
<children xsi:type="menu:HandledMenuItem" xmi:id="_T2uAUNm2Eee116JrfV3ZgA" elementId="flintstones.framework.ui.handledmenuitem.removedomain" label="%flintstones.framework.ui.menu.domains.handledmenuitem.removedomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" command="_8CJCwNmzEee116JrfV3ZgA"/>
|
||||
</children>
|
||||
</elements>
|
||||
</fragments>
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_gHc7wLcpEeiIWMI8wDGaZg" featurename="children" parentElementId="flintstones.application.perspective.framework">
|
||||
<elements xsi:type="basic:PartSashContainer" xmi:id="_zJJuIIqrEemWhvlKP-WOsA" elementId="flintstones.application.perspective.framework.ui.partsashcontainer.0" horizontal="true">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_gHc7wbcpEeiIWMI8wDGaZg" elementId="flintstones.application.perspective.framework.partsashcontainer">
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_gHc7wrcpEeiIWMI8wDGaZg" elementId="flintstones.application.framework.partsashcontainer.elements" horizontal="true">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_gHc7w7cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.partstack.experts">
|
||||
<children xsi:type="basic:Part" xmi:id="_gHc7xLcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.experts" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.ExpertsPart" label="%flintstones.framework.ui.part.experts.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/group-of-experts.png" bindingContexts="_IyrLcEV4Eems14nuCAO_MA">
|
||||
<toolbar xmi:id="_gHc7xbcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.toolbar.experts">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7xrcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.experts.handledtoolitem.addexpert" label="%flintstones.framework.ui.part.experts.handledtoolitem.addexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" tooltip="%flintstones.framework.ui.part.experts.handledtoolitem.addexpert.tooltip" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_CWaAoI0LEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addexpert" name="add_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_P4J9INXqEeiSwMCPn2wPHw" elementId="flintstones.framework.ui.part.experts.handledtoolitem.addsomeexpert" label="%flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add_group_of_experts.png" tooltip="%flintstones.framework.ui.part.experts.handledtoolitem.addseveralexperts.tooltip" command="_r1zJENdxEeiOnpCMp-K8MA">
|
||||
<parameters xmi:id="_FfVsENeTEeiFeIU5BaU4cw" elementId="flintstones.framework.ui.parameter.addexpert" name="add_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7x7cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert" label="%flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" tooltip="%flintstones.framework.ui.part.experts.handledtoolitem.modifyexpert.tooltip" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_naJuMI0NEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifyExpert" name="modify_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7yLcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.experts.handledtoolitem.removeexpert" label="%flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" tooltip="%flintstones.framework.ui.part.experts.handledtoolitem.removeexpert.tooltip" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_F-V-YI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removeExpert" name="remove_object_parameter" value="Expert"/>
|
||||
</children>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_gHc7ybcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.partstack.alternatives">
|
||||
<children xsi:type="basic:Part" xmi:id="_gHc7yrcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.alternatives" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.AlternativesPart" label="%flintstones.framework.ui.part.alternatives.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/alternatives.png" bindingContexts="_I2LycEV4Eems14nuCAO_MA">
|
||||
<toolbar xmi:id="_gHc7y7cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.toolbar.alternatives">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7zLcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.addalternative" label="%flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" tooltip="%flintstones.framework.ui.part.alternatives.handledtoolitem.addalternative.tooltip" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_EpW6sI0LEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addalternative" name="add_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_tYAYUNeVEeiFeIU5BaU4cw" elementId="flintstones.framework.ui.handledtoolitem.addsomealternative" label="%flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add_some_alternatives.png" tooltip="%flintstones.framework.ui.part.alternatives.handledtoolitem.addseveralalternatives.tooltip" command="_r1zJENdxEeiOnpCMp-K8MA">
|
||||
<parameters xmi:id="_12MsoNeVEeiFeIU5BaU4cw" elementId="flintstones.framework.ui.parameter.addalternative" name="add_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7zbcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.modifyalternative" label="%flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" tooltip="%flintstones.framework.ui.part.alternatives.handledtoolitem.modifyalternative.tooltip" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_q4XhgI0NEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifyalternative" name="modify_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc7zrcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.removealternative" label="%flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" tooltip="%flintstones.framework.ui.part.alternatives.handledtoolitem.removealternative.tooltip" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_Mn7hgI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removealternative" name="remove_object_parameter" value="Alternative"/>
|
||||
</children>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_gHc7z7cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.partstack.criteria">
|
||||
<children xsi:type="basic:Part" xmi:id="_gHc70LcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.criteria" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.CriteriaPart" label="%flintstones.framework.ui.part.criteria.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/criteria.png" bindingContexts="_6vSRkUVpEems14nuCAO_MA">
|
||||
<toolbar xmi:id="_gHc70bcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.toolbar.criteria">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc70rcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.addcriterion" label="%flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" tooltip="%flintstones.framework.ui.part.criteria.handledtoolitem.addcriterion.tooltip" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_Guwg8I0LEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addcriterion" name="add_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_Pd770NeWEeiFeIU5BaU4cw" elementId="flintstones.framework.ui.handledtoolitem.addcriterion" label="%flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add_some_criteria.png" tooltip="%flintstones.framework.ui.part.criteria.handledtoolitem.addseveralcriteria.tooltip" command="_r1zJENdxEeiOnpCMp-K8MA">
|
||||
<parameters xmi:id="_VunPsNeWEeiFeIU5BaU4cw" elementId="flintstones.framework.ui.parameter.addcriterion" name="add_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc707cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.modifycriterion" label="%flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" tooltip="%flintstones.framework.ui.part.criteria.handledtoolitem.modifycriterion.tooltip" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_wsjGoI0NEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifycriterion" name="modify_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc71LcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.removecriterion" label="%flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" tooltip="%flintstones.framework.ui.part.criteria.handledtoolitem.removecriterion.tooltip" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_dErAwI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removecriterion" name="remove_object_parameter" value="Criterion"/>
|
||||
</children>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartSashContainer" xmi:id="_gHc71bcpEeiIWMI8wDGaZg" elementId="flintstones.application.framework.partsashcontainer.domains" horizontal="true">
|
||||
<children xsi:type="basic:PartStack" xmi:id="_gHc71rcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.partstack.domains">
|
||||
<children xsi:type="basic:Part" xmi:id="_gHc717cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.domains" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.DomainsPart" label="%flintstones.framework.ui.part.domains.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/domains.png" bindingContexts="_O55N8EBvEeuHiNkWuiROVw">
|
||||
<toolbar xmi:id="_gHc72LcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.toolbar.domains">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc72bcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.adddomain" label="%flintstones.framework.ui.part.domains.handledtoolitem.adddomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" tooltip="%flintstones.framework.ui.part.domains.handledtoolitem.adddomain.tooltip" command="_7fgPwNmzEee116JrfV3ZgA"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_pCieYJGZEemj6dmkdhydeA" elementId="flintstones.application.perspective.framework.ui.handledtoolitem" label="%flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add_some_domains.png" tooltip="%flintstones.framework.ui.part.domains.handledtoolitem.addfastdomain.tooltip" command="_20OsoJGZEemj6dmkdhydeA"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc72rcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.modifydomain" label="%flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" tooltip="%flintstones.framework.ui.part.domains.handledtoolitem.modifydomain.tooltip" command="_7w5hwNmzEee116JrfV3ZgA"/>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_gHc727cpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.handledtoolitem.removedomain" label="%flintstones.framework.ui.part.domains.handledtoolitem.removedomain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" tooltip="%flintstones.framework.ui.part.domains.handledtoolitem.removedomain.tooltip" command="_8CJCwNmzEee116JrfV3ZgA"/>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_gHc73LcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.partstack.domain">
|
||||
<children xsi:type="basic:Part" xmi:id="_gHc73bcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.part.domaindetails" accessibilityPhrase="" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.DomainChartPart" label="%flintstones.framework.ui.part.domain.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/domain.png">
|
||||
<toolbar xmi:id="_gHc73rcpEeiIWMI8wDGaZg" elementId="flintstones.framework.ui.toolbar.0"/>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_zR9uIIeFEemDjYgOm8DuMQ" elementId="flintstones.framework.ui.partstack.ahpclasses" visible="false">
|
||||
<children xsi:type="basic:Part" xmi:id="_ur-oMIeKEemDjYgOm8DuMQ" elementId="flintstones.application.perspective.framework.ui.part.classes" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.SortClassPart" label="Classes" iconURI="platform:/plugin/flintstones.model.ui.service/icons/problemelement/sortclass.png" bindingContexts="_BurUsIoKEemWhvlKP-WOsA">
|
||||
<toolbar xmi:id="_4UO74IeKEemDjYgOm8DuMQ" elementId="flintstones.application.perspective.framework.ui.toolbar.0">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_dHJ20IoMEemWhvlKP-WOsA" elementId="flintstones.framework.ui.handledtoolitem.addsortingclass" label="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add.png" tooltip="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.addsortingclass.tooltip" command="_UtshAI0LEemebIlYrceR2A">
|
||||
<parameters xmi:id="_KbWHcI0LEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.addcriterion" name="add_object_parameter" value="SortingClass"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_64K6IIttEemVD6RgunhnUg" elementId="flintstones.framework.ui.part.experts.handledtoolitem.addsomesortingclasses" label="Añadir varios Sorting Class" iconURI="platform:/plugin/flintstones.model.ui.service/icons/add_some_sortingclass.png" command="_r1zJENdxEeiOnpCMp-K8MA">
|
||||
<parameters xmi:id="_TtnJsItuEemVD6RgunhnUg" elementId="flintstones.framework.ui.parameter.addsortingclass" name="add_object_parameter" value="SortingClass"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_dHOvUIoMEemWhvlKP-WOsA" elementId="flintstones.framework.ui.handledtoolitem.modifysortingclass" label="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/quick_edit.gif" tooltip="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.modifysortingclass.tooltip" command="_VVsDMI0NEemebIlYrceR2A">
|
||||
<parameters xmi:id="_y1xc8I0NEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.modifysortingclass" name="modify_object_parameter" value="SortingClass"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_dHRLkIoMEemWhvlKP-WOsA" elementId="flintstones.framework.ui.handledtoolitem.removesortingclass" label="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.label" iconURI="platform:/plugin/flintstones.model.ui.service/icons/remove.gif" tooltip="%flintstones.framework.ui.part.sortingclasses.handledtoolitem.removesortingclass.tooltip" command="_hIqQEI0PEemebIlYrceR2A">
|
||||
<parameters xmi:id="_h8pcUI0QEemebIlYrceR2A" elementId="flintstones.framework.ui.parameter.removesortingclass" name="remove_object_parameter" value="SortingClass"/>
|
||||
</children>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_9uxrQIeFEemDjYgOm8DuMQ" elementId="flintstones.framework.ui.partstack.ahpviewer" visible="false">
|
||||
<children xsi:type="basic:Part" xmi:id="_4-BxsIeIEemDjYgOm8DuMQ" elementId="flintstones.application.perspective.framework.ui.part.profiles" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.ProfilesPart" label="Profiles" iconURI="">
|
||||
<toolbar xmi:id="_yUQ6EIglEemQOrtdyO_bmA" elementId="flintstones.application.perspective.framework.ui.toolbar.1">
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_9omcMJKFEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.handledtoolitem.central" accessibilityPhrase="Central Profiles" label="Central Profiles" iconURI="platform:/plugin/flintstones.model.ui.service/icons/action_profile_central.gif" tooltip="Central Profiles" command="_z63yoJKFEem4bI5DgXWjVg">
|
||||
<parameters xmi:id="_EJO3oJKGEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.parameter.1" name="profile_type" value="Central"/>
|
||||
</children>
|
||||
<children xsi:type="menu:HandledToolItem" xmi:id="_GiDJIJKGEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.handledtoolitem.limitingprofiles" accessibilityPhrase="Limiting Profiles" label="Limiting Profiles" iconURI="platform:/plugin/flintstones.model.ui.service/icons/action_profile_limiting.gif" tooltip="Limiting Profiles" command="_z63yoJKFEem4bI5DgXWjVg">
|
||||
<parameters xmi:id="_Mx-2IJKGEem4bI5DgXWjVg" elementId="flintstones.application.perspective.framework.ui.parameter.2" name="profile_type" value="Limiting"/>
|
||||
</children>
|
||||
</toolbar>
|
||||
</children>
|
||||
</children>
|
||||
</children>
|
||||
</children>
|
||||
<children xsi:type="basic:PartStack" xmi:id="_9dyB4IeFEemDjYgOm8DuMQ" elementId="flintstones.framework.ui.partstack.ahpprofiles" visible="false" containerData="800">
|
||||
<children xsi:type="basic:Part" xmi:id="_80qzYIhJEemQOrtdyO_bmA" elementId="flintstones.application.perspective.framework.ui.part.viewer" contributionURI="bundleclass://flintstones.application.perspective.framework.ui/flintstones.application.perspective.framework.ui.parts.ProfilesClassesPart" label="%flintstones.framework.ui.part.clasification.label">
|
||||
<toolbar xmi:id="_XboD4IhKEemQOrtdyO_bmA" elementId="flintstones.application.perspective.framework.ui.toolbar.2"/>
|
||||
</children>
|
||||
</children>
|
||||
</elements>
|
||||
</fragments>
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_6vSRkEVpEems14nuCAO_MA" featurename="rootContext" parentElementId="flintstones.application.application">
|
||||
<elements xsi:type="commands:BindingContext" xmi:id="_6vSRkUVpEems14nuCAO_MA" elementId="flintstones.application.bindingcontext.criterionPart" name="Criterion Part Context" description="Allows CTRL+V on Criterion Part"/>
|
||||
<elements xsi:type="commands:BindingContext" xmi:id="_IyrLcEV4Eems14nuCAO_MA" elementId="flintstones.application.bindingcontext.expertPart" name="Expert Part Context" description="Allows CTRL+V on Expert Part"/>
|
||||
<elements xsi:type="commands:BindingContext" xmi:id="_I2LycEV4Eems14nuCAO_MA" elementId="flintstones.application.bindingcontext.alternativesPart" name="Alternatives Part Context" description="Allows CTRL+V on Alternatives Part"/>
|
||||
<elements xsi:type="commands:BindingContext" xmi:id="_BurUsIoKEemWhvlKP-WOsA" elementId="flintstones.application.bindingcontext.sortingclassesPart" name="SortingClass Part Context" description="Allows CTRL+V on SortingClass Part"/>
|
||||
<elements xsi:type="commands:BindingContext" xmi:id="_O55N8EBvEeuHiNkWuiROVw" elementId="flintstones.application.bindingcontext.domainPart" name="Domain Part Context" description="Context of domains"/>
|
||||
</fragments>
|
||||
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_UPQE0EVqEems14nuCAO_MA" featurename="bindingTables" parentElementId="flintstones.application.application">
|
||||
<elements xsi:type="commands:BindingTable" xmi:id="_UPQr4EVqEems14nuCAO_MA" elementId="flintstones.application.bindingtable.criterionPart" bindingContext="_6vSRkUVpEems14nuCAO_MA">
|
||||
<bindings xmi:id="_XZyHIEVqEems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.keybinding.alternativesPart.paste" keySequence="M1+V" command="_pLspkEVqEems14nuCAO_MA">
|
||||
<parameters xmi:id="_glFjoEVrEems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.parameter.0" name="paste_parameter_id" value="Criterion"/>
|
||||
</bindings>
|
||||
</elements>
|
||||
<elements xsi:type="commands:BindingTable" xmi:id="_GeMAUEV4Eems14nuCAO_MA" elementId="flintstones.application.bindingtable.alternativesPart" bindingContext="_I2LycEV4Eems14nuCAO_MA">
|
||||
<bindings xmi:id="_GeMAUUV4Eems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.keybinding.alternativesPart.paste" keySequence="M1+V" command="_pLspkEVqEems14nuCAO_MA">
|
||||
<parameters xmi:id="_GeMAUkV4Eems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.parameter.0" name="paste_parameter_id" value="Alternative"/>
|
||||
</bindings>
|
||||
</elements>
|
||||
<elements xsi:type="commands:BindingTable" xmi:id="_HWIU8EV4Eems14nuCAO_MA" elementId="flintstones.application.bindingtable.expertPart" bindingContext="_IyrLcEV4Eems14nuCAO_MA">
|
||||
<bindings xmi:id="_HWIU8UV4Eems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.keybinding.alternativesPart.paste" keySequence="M1+V" command="_pLspkEVqEems14nuCAO_MA">
|
||||
<parameters xmi:id="_HWIU8kV4Eems14nuCAO_MA" elementId="flintstones.application.perspective.framework.ui.parameter.0" name="paste_parameter_id" value="Expert"/>
|
||||
</bindings>
|
||||
</elements>
|
||||
</fragments>
|
||||
</fragment:ModelFragments>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE xml>
|
||||
<plugin>
|
||||
|
||||
<extension
|
||||
id="flintstones.framework.ui.fragment"
|
||||
point="org.eclipse.e4.workbench.model">
|
||||
<fragment
|
||||
uri="fragment.e4xmi">
|
||||
</fragment>
|
||||
</extension>
|
||||
|
||||
</plugin>
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
package flintstones.application.perspective.framework.ui.dialogs;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.jface.viewers.AbstractTreeViewer;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||
import org.eclipse.jface.viewers.DoubleClickEvent;
|
||||
import org.eclipse.jface.viewers.IDoubleClickListener;
|
||||
import org.eclipse.jface.viewers.ISelection;
|
||||
import org.eclipse.jface.viewers.ISelectionChangedListener;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.SelectionChangedEvent;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.TreeViewerColumn;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import flintstones.entity.domain.DomainInstanceMockup;
|
||||
import flintstones.entity.domain.DomainMockup;
|
||||
import flintstones.entity.domain.ui.provider.DomainDomainMockupContentProvider;
|
||||
import flintstones.entity.domain.ui.provider.DomainMockupLabelProvider;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
public class FastAddDomainDialog extends Dialog {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
private static final int DIALOG_SIZE_Y = 400;
|
||||
|
||||
private static final int DIALOG_SIZE_X = 450;
|
||||
|
||||
DomainMockup[] domains;
|
||||
String selectedDomainId = null;
|
||||
|
||||
Button okButton;
|
||||
|
||||
@Inject
|
||||
public FastAddDomainDialog(Shell parentShell) {
|
||||
super(parentShell);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Control createDialogArea(Composite parent) {
|
||||
Composite container = (Composite) super.createDialogArea(parent);
|
||||
|
||||
UiService.setGridLayout(parent, 1);
|
||||
UiService.setGridDataAuto(parent);
|
||||
|
||||
this.addTreeView(container);
|
||||
|
||||
return container;
|
||||
}
|
||||
|
||||
public void setDomains(DomainInstanceMockup[] domains) {
|
||||
this.domains = domains;
|
||||
}
|
||||
|
||||
private void addTreeView(Composite container) {
|
||||
|
||||
DomainMockupLabelProvider delp = ContextInjectionFactory.make(DomainMockupLabelProvider.class, this.context);
|
||||
DomainDomainMockupContentProvider dccp = ContextInjectionFactory.make(DomainDomainMockupContentProvider.class,
|
||||
context);
|
||||
|
||||
final TreeViewer tv = new TreeViewer(container);
|
||||
tv.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
|
||||
tv.setContentProvider(dccp);
|
||||
|
||||
TreeViewerColumn mainColumn = new TreeViewerColumn(tv, SWT.NONE);
|
||||
mainColumn.getColumn().setText("Domains");
|
||||
mainColumn.getColumn().setWidth(300);
|
||||
mainColumn.setLabelProvider(new DelegatingStyledCellLabelProvider(delp));
|
||||
|
||||
tv.getTree().setHeaderVisible(true);
|
||||
tv.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
|
||||
|
||||
tv.setInput(domains);
|
||||
tv.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
|
||||
@Override
|
||||
public void selectionChanged(SelectionChangedEvent event) {
|
||||
ISelection selection = event.getSelection();
|
||||
Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
|
||||
|
||||
if (!selectedElements.hasNext())
|
||||
return;
|
||||
|
||||
Object next = selectedElements.next();
|
||||
|
||||
DomainInstanceMockup domain = (DomainInstanceMockup) next;
|
||||
|
||||
selectedDomainId = domain.getFastId();
|
||||
okButton.setEnabled(selectedDomainId != null);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
tv.addDoubleClickListener(new IDoubleClickListener() {
|
||||
|
||||
@Override
|
||||
public void doubleClick(DoubleClickEvent event) {
|
||||
ISelection selection = event.getSelection();
|
||||
Iterator<?> selectedElements = ((IStructuredSelection) selection).iterator();
|
||||
|
||||
if (!selectedElements.hasNext())
|
||||
return;
|
||||
|
||||
Object next = selectedElements.next();
|
||||
|
||||
DomainInstanceMockup domain = (DomainInstanceMockup) next;
|
||||
|
||||
selectedDomainId = domain.getFastId();
|
||||
if (selectedDomainId != null)
|
||||
pushOk();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void pushOk() {
|
||||
super.okPressed();
|
||||
}
|
||||
|
||||
public String getSelectedDomain() {
|
||||
return this.selectedDomainId;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
super.configureShell(newShell);
|
||||
newShell.setText("Select");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Point getInitialSize() {
|
||||
return new Point(DIALOG_SIZE_X, DIALOG_SIZE_Y);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void okPressed() {
|
||||
super.okPressed();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
this.createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
|
||||
this.okButton = this.getButton(IDialogConstants.OK_ID);
|
||||
this.okButton.setEnabled(false);
|
||||
this.okButton.setToolTipText("Doble click sobre el elemento");
|
||||
}
|
||||
|
||||
}
|
||||
+443
@@ -0,0 +1,443 @@
|
||||
package flintstones.application.perspective.framework.ui.dialogs;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.dialogs.IDialogConstants;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.swt.widgets.Text;
|
||||
|
||||
import flintstones.application.perspective.framework.ui.messages.Messages;
|
||||
import flintstones.entity.problemelement.entities.Alternative;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
/**
|
||||
* The Class UpsertProblemElementDialog.
|
||||
*/
|
||||
public class UpsertProblemElementDialog extends Dialog {
|
||||
|
||||
/** The messages. */
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The Constant DIALOG_SIZE. */
|
||||
private static final Point DIALOG_SIZE = new Point(400, 220);
|
||||
|
||||
/** The ok button. */
|
||||
private Button okButton;
|
||||
|
||||
// Tercera solución
|
||||
Label errorLabel;
|
||||
HashMap<String, Object> attributes = new HashMap<String, Object>();
|
||||
|
||||
/**
|
||||
* Instantiates a new upsert problem element dialog.
|
||||
*
|
||||
* @param current the current
|
||||
* @param parent the parent
|
||||
*/
|
||||
public UpsertProblemElementDialog(ProblemElement current, ProblemElement parent) {
|
||||
super(Display.getCurrent().getActiveShell());
|
||||
|
||||
update("oldName", current.getName());
|
||||
|
||||
update("name", current.getName());
|
||||
update("type", current.getType());
|
||||
|
||||
String type = (String) get("type");
|
||||
if (!type.equals(Alternative.Type)) {
|
||||
|
||||
if (parent == null) {
|
||||
update("parentId", "");
|
||||
update("hasParent", false);
|
||||
} else {
|
||||
update("parentId", parent.getId());
|
||||
update("_parentName", parent.getName());
|
||||
update("hasParent", true);
|
||||
}
|
||||
|
||||
} else
|
||||
update("hasParent", false);
|
||||
|
||||
if (type.equals(Criterion.Type))
|
||||
update("isCost", ((Criterion) current).isCost());
|
||||
|
||||
if (type.equals(Expert.Type))
|
||||
update("mail", ((Expert) current).getMail());
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) /* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.
|
||||
* Composite)
|
||||
*/
|
||||
@Override
|
||||
protected Control createDialogArea(Composite base) {
|
||||
super.createDialogArea(base);
|
||||
|
||||
for (Control c : base.getChildren())
|
||||
c.dispose();
|
||||
|
||||
UiService.setGridLayout(base, 1);
|
||||
UiService.setGridDataAuto(base);
|
||||
|
||||
drawBlock1ProblemElementName(base);
|
||||
drawBlock2Options(base);
|
||||
drawBlock0Errors(base);
|
||||
|
||||
return base;
|
||||
}
|
||||
|
||||
private void drawBlock0Errors(Composite parent) {
|
||||
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridLayout(row, 1);
|
||||
|
||||
errorLabel = new Label(row,1);
|
||||
errorLabel.setText(" ");
|
||||
UiService.setGridData(errorLabel, 9, 0, true, false);
|
||||
UiService.setFontColor(errorLabel, UiService.COLOR_FG_ERROR);
|
||||
UiService.setFont(errorLabel, UiService.FONT_TEXT_ERROR);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw block 1 problem element name.
|
||||
*
|
||||
* @param parent the parent
|
||||
*/
|
||||
private void drawBlock1ProblemElementName(Composite parent) {
|
||||
|
||||
String name = (String) get("name");
|
||||
|
||||
// LABEL
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridLayout(row, 2);
|
||||
|
||||
Label nameLabel = new Label(row, SWT.NULL);
|
||||
nameLabel.setText(this.messages.name);
|
||||
UiService.setGridData(nameLabel, -1, 0, true, false);
|
||||
UiService.setFont(nameLabel, UiService.FONT_SECTION_TITLE);
|
||||
|
||||
// ERROR: name
|
||||
// this.addErrorLabel(row, "name"); //$NON-NLS-1$
|
||||
|
||||
// INPUT
|
||||
Composite row2 = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridData(row2, 9, 0, true, false);
|
||||
UiService.setGridLayout(row2, 1);
|
||||
|
||||
Text nameInput = new Text(row2, SWT.BORDER);
|
||||
UiService.setGridData(nameInput, 9, 0, true, true);
|
||||
nameInput.setText(name); //$NON-NLS-1$
|
||||
nameInput.addModifyListener(nameInputOnChange());
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw block 2 options.
|
||||
*
|
||||
* @param parent the parent
|
||||
*/
|
||||
private void drawBlock2Options(Composite parent) {
|
||||
|
||||
String type = (String) get("type");
|
||||
String parentName = (String) get("_parentName");
|
||||
Boolean hasParent = (Boolean) get("hasParent");
|
||||
|
||||
boolean isCriterion = type.equals(Criterion.Type);
|
||||
boolean isExpert = type.equals(Expert.Type);
|
||||
|
||||
if (isExpert) {
|
||||
Composite row = new Composite(parent, 0);
|
||||
UiService.setGridLayout(row, 2);
|
||||
|
||||
Label emailTitleLabel = new Label(row, SWT.NULL);
|
||||
emailTitleLabel.setText("E-mail");
|
||||
UiService.setGridData(emailTitleLabel, -1, 0, true, false);
|
||||
UiService.setFont(emailTitleLabel, UiService.FONT_SECTION_TITLE);
|
||||
|
||||
Composite row2 = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridData(row2, 9, 0, true, false);
|
||||
UiService.setGridLayout(row2, 1);
|
||||
|
||||
Text mailInput = new Text(row2, SWT.BORDER);
|
||||
if(get("mail") != null)
|
||||
mailInput.setText((String) get("mail"));
|
||||
UiService.setGridData(mailInput, 9, 0, true, true);
|
||||
mailInput.addModifyListener(this.mailInputOnChange());
|
||||
|
||||
}
|
||||
|
||||
if (hasParent || isCriterion) {
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridLayout(row, 1);
|
||||
|
||||
Label titleLabel = new Label(row, SWT.NULL);
|
||||
titleLabel.setText(this.messages.Options);
|
||||
UiService.setGridData(titleLabel, -1, 0, true, false);
|
||||
UiService.setFont(titleLabel, UiService.FONT_SECTION_TITLE);
|
||||
}
|
||||
|
||||
if (hasParent) {
|
||||
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridData(row, 9, 0, true, false);
|
||||
UiService.setGridLayout(row, 1);
|
||||
|
||||
Button childCB = new Button(row, SWT.CHECK);
|
||||
childCB.addSelectionListener(this.addParentSelectionAdapter());
|
||||
childCB.setSelection(hasParent);
|
||||
|
||||
String template = this.messages.is_child_of;
|
||||
String line = MessageFormat.format(template, parentName);
|
||||
childCB.setText(line);
|
||||
UiService.setFont(childCB, UiService.FONT_TEXT_NORMAL);
|
||||
}
|
||||
|
||||
if (isCriterion) {
|
||||
|
||||
Composite row = new Composite(parent, SWT.NONE);
|
||||
UiService.setGridData(row, 9, 0, true, false);
|
||||
UiService.setGridLayout(row, 1);
|
||||
|
||||
Button costCB = new Button(row, SWT.CHECK);
|
||||
costCB.addSelectionListener(this.addCostSelectionAdapter());
|
||||
costCB.setText(this.messages.is_negative_cost);
|
||||
costCB.setSelection((boolean) get("isCost"));
|
||||
UiService.setFont(costCB, UiService.FONT_TEXT_NORMAL);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the parent selection adapter.
|
||||
*
|
||||
* @return the selection adapter
|
||||
*/
|
||||
private SelectionAdapter addParentSelectionAdapter() {
|
||||
return new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
boolean selected = ((Button) e.getSource()).getSelection();
|
||||
update("hasParent", selected);
|
||||
redraw();
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the cost selection adapter.
|
||||
*
|
||||
* @return the selection adapter
|
||||
*/
|
||||
private SelectionAdapter addCostSelectionAdapter() {
|
||||
return new SelectionAdapter() {
|
||||
@Override
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
boolean selected = ((Button) e.getSource()).getSelection();
|
||||
update("isCost", selected);
|
||||
redraw();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Name input on change.
|
||||
*
|
||||
* @return the modify listener
|
||||
*/
|
||||
private ModifyListener nameInputOnChange() {
|
||||
return e -> {
|
||||
String name = ((Text) e.getSource()).getText();
|
||||
update("name", name);
|
||||
redraw();
|
||||
};
|
||||
}
|
||||
|
||||
private ModifyListener mailInputOnChange() {
|
||||
return e -> {
|
||||
String mail = ((Text) e.getSource()).getText();
|
||||
update("mail", mail);
|
||||
redraw();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Redraw.
|
||||
*/
|
||||
private void redraw() {
|
||||
|
||||
String name = (String) get("name");
|
||||
String oldName = (String) get("oldName");
|
||||
String type = (String) get("type");
|
||||
|
||||
if(!name.equals(oldName) && problemService.getByName(type, name) != null) {
|
||||
error("Nombre en uso");
|
||||
okButton.setEnabled(false);
|
||||
} else {
|
||||
error("");
|
||||
okButton.setEnabled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.
|
||||
* widgets.Composite)
|
||||
*/
|
||||
@Override
|
||||
protected void createButtonsForButtonBar(Composite parent) {
|
||||
this.okButton = this.createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
|
||||
this.okButton.setEnabled(false);
|
||||
this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
|
||||
UiService.reLayoutShell(this.getShell());
|
||||
|
||||
this.redraw();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
|
||||
*/
|
||||
@Override
|
||||
protected void configureShell(Shell newShell) {
|
||||
String type = (String) get("type");
|
||||
String name = (String) get("name");
|
||||
|
||||
super.configureShell(newShell);
|
||||
String template = this.messages.upsert_pe_title_template;
|
||||
String title = MessageFormat.format(template,
|
||||
name.equals("") ? this.messages.creating : this.messages.modifying, type); //$NON-NLS-1$
|
||||
newShell.setText(title);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.dialogs.Dialog#getInitialSize()
|
||||
*/
|
||||
@Override
|
||||
protected Point getInitialSize() {
|
||||
return UpsertProblemElementDialog.DIALOG_SIZE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the problem element.
|
||||
*
|
||||
* @return the problem element
|
||||
*/
|
||||
public ProblemElement getNewProblemElement() {
|
||||
|
||||
String type = (String) get("type");
|
||||
String oldName = (String) get("oldName");
|
||||
String name = (String) get("name");
|
||||
Boolean hasParent = (Boolean) get("hasParent");
|
||||
String parentId = (String) get("parentId");
|
||||
|
||||
ProblemElement result = ProblemElementHelper.create(name,type);
|
||||
if(!oldName.equals(""))
|
||||
result.setName(oldName);
|
||||
|
||||
result.setName((String) get("name"));
|
||||
|
||||
ProblemElement parent = problemService.getByName(type, parentId);
|
||||
if(hasParent) {
|
||||
parent.removeChildren(result);
|
||||
parent.addChildren(result);
|
||||
} else {
|
||||
if(parent != null) {
|
||||
ProblemElement item = problemService.getByName(type, oldName);
|
||||
parent.removeChildren(item);
|
||||
}
|
||||
}
|
||||
|
||||
if(type.equals(Expert.Type)) {
|
||||
((Expert)result).setMail((String) get("mail"));
|
||||
}
|
||||
|
||||
if(type.equals(Criterion.Type)) {
|
||||
((Criterion)result).setCost((Boolean) get("isCost"));
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public ProblemElement getModifiedProblemElement(ProblemElement pe) {
|
||||
String type = (String) get("type");
|
||||
String oldName = (String) get("oldName");
|
||||
String name = (String) get("name");
|
||||
Boolean hasParent = (Boolean) get("hasParent");
|
||||
String parentId = (String) get("parentId");
|
||||
|
||||
if(!oldName.equals(""))
|
||||
pe.setName(oldName);
|
||||
|
||||
pe.setName(name);
|
||||
|
||||
ProblemElement parent = problemService.getByName(type, parentId);
|
||||
if(hasParent) {
|
||||
parent.removeChildren(pe);
|
||||
parent.addChildren(pe);
|
||||
} else {
|
||||
if(parent != null) {
|
||||
ProblemElement item = problemService.getByName(type, oldName);
|
||||
parent.removeChildren(item);
|
||||
}
|
||||
}
|
||||
|
||||
if(type.equals(Expert.Type))
|
||||
((Expert) pe).setMail((String) get("mail"));
|
||||
|
||||
if(type.equals(Criterion.Type))
|
||||
((Criterion) pe).setCost((Boolean) get("isCost"));
|
||||
|
||||
return pe;
|
||||
}
|
||||
|
||||
private void update(String key, Object value) {
|
||||
attributes.put(key, value);
|
||||
}
|
||||
|
||||
private Object get(String key) {
|
||||
return attributes.get(key);
|
||||
}
|
||||
|
||||
private void error(String err) {
|
||||
errorLabel.setText(err);
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package flintstones.application.perspective.framework.ui.draganddrop;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||
import org.eclipse.swt.dnd.DragSourceListener;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
/**
|
||||
* The listener interface for receiving problemElementDrag events.
|
||||
* The class that is interested in processing a problemElementDrag
|
||||
* event implements this interface, and the object created
|
||||
* with that class is registered with a component using the
|
||||
* component's <code>addProblemElementDragListener<code> method. When
|
||||
* the problemElementDrag event occurs, that object's appropriate
|
||||
* method is invoked.
|
||||
*
|
||||
* @see ProblemElementDragEvent
|
||||
*/
|
||||
public class ProblemElementDragListener implements DragSourceListener {
|
||||
|
||||
/** The viewer. */
|
||||
private final Viewer _viewer;
|
||||
|
||||
/**
|
||||
* Instantiates a new problem element drag listener.
|
||||
*
|
||||
* @param viewer the viewer
|
||||
*/
|
||||
public ProblemElementDragListener(Viewer viewer) {
|
||||
this._viewer = viewer;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.dnd.DragSourceListener#dragStart(org.eclipse.swt.dnd.
|
||||
* DragSourceEvent) */
|
||||
@Override
|
||||
public void dragStart(DragSourceEvent event) {
|
||||
// System.out.println("dragStart " + event);
|
||||
event.doit = !this._viewer.getSelection()
|
||||
.isEmpty();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.dnd.DragSourceListener#dragSetData(org.eclipse.swt.dnd.
|
||||
* DragSourceEvent) */
|
||||
@Override
|
||||
public void dragSetData(DragSourceEvent event) {
|
||||
// System.out.println("dragSetData " + event);
|
||||
|
||||
IStructuredSelection selection = (IStructuredSelection) this._viewer.getSelection();
|
||||
ProblemElement firstElement = (ProblemElement) selection.getFirstElement();
|
||||
|
||||
if (TextTransfer.getInstance()
|
||||
.isSupportedType(event.dataType))
|
||||
event.data = firstElement.getCanonicalName();
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.swt.dnd.DragSourceListener#dragFinished(org.eclipse.swt.dnd.
|
||||
* DragSourceEvent) */
|
||||
@Override
|
||||
public void dragFinished(DragSourceEvent event) {
|
||||
// System.out.println("dragFinished " + event);
|
||||
|
||||
}
|
||||
}
|
||||
+146
@@ -0,0 +1,146 @@
|
||||
package flintstones.application.perspective.framework.ui.draganddrop;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerDropAdapter;
|
||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||
import org.eclipse.swt.dnd.TransferData;
|
||||
|
||||
import flintstones.application.perspective.framework.ui.handlers.MoveProblemElementHandler;
|
||||
import flintstones.application.perspective.framework.ui.handlers.ReorderProblemElementHandler;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The listener interface for receiving problemElementDrop events.
|
||||
* The class that is interested in processing a problemElementDrop
|
||||
* event implements this interface, and the object created
|
||||
* with that class is registered with a component using the
|
||||
* component's <code>addProblemElementDropListener<code> method. When
|
||||
* the problemElementDrop event occurs, that object's appropriate
|
||||
* method is invoked.
|
||||
*
|
||||
* @see ProblemElementDropEvent
|
||||
*/
|
||||
public class ProblemElementDropListener extends ViewerDropAdapter {
|
||||
|
||||
/** The draggedElement. */
|
||||
private ProblemElement draggedElement;
|
||||
|
||||
/** The new draggedElement. */
|
||||
private ProblemElement dropTarget;
|
||||
|
||||
boolean droppedInside = false;
|
||||
boolean droppedBefore = false;
|
||||
|
||||
/** The context. */
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
Viewer viewer;
|
||||
/**
|
||||
* Instantiates a new problem element drop listener.
|
||||
*
|
||||
* @param viewer the viewer
|
||||
*/
|
||||
public ProblemElementDropListener(Viewer viewer) {
|
||||
super(viewer);
|
||||
this.viewer = viewer;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void drop(DropTargetEvent event) {
|
||||
int location = this.determineLocation(event);
|
||||
// ProblemElement target = (ProblemElement) determineTarget(event);
|
||||
// String translatedLocation = "";
|
||||
switch (location) {
|
||||
case 1:
|
||||
// translatedLocation = "Dropped before the target ";
|
||||
droppedInside = false;
|
||||
droppedBefore = true;
|
||||
break;
|
||||
case 2:
|
||||
// translatedLocation = "Dropped after the target ";
|
||||
droppedInside = false;
|
||||
droppedBefore = false;
|
||||
break;
|
||||
case 3:
|
||||
// translatedLocation = "Dropped on the target ";
|
||||
droppedInside = true;
|
||||
droppedBefore = false;
|
||||
break;
|
||||
case 4:
|
||||
// translatedLocation = "Dropped into nothing ";
|
||||
droppedInside = false;
|
||||
droppedBefore = false;
|
||||
break;
|
||||
}
|
||||
// System.out.println(translatedLocation);
|
||||
// System.out.println("The drop was done on the element: " + target);
|
||||
super.drop(event);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ViewerDropAdapter#performDrop(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean performDrop(Object data) {
|
||||
|
||||
if( droppedInside ) {
|
||||
MoveProblemElementHandler handler = new MoveProblemElementHandler(this.draggedElement, this.dropTarget);
|
||||
ContextInjectionFactory.inject(handler, this.context);
|
||||
|
||||
try {
|
||||
handler.execute(null);
|
||||
} catch (ExecutionException e) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
ReorderProblemElementHandler handler = new ReorderProblemElementHandler(draggedElement, dropTarget, droppedBefore );
|
||||
ContextInjectionFactory.inject(handler, this.context);
|
||||
|
||||
handler.execute();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.jface.viewers.ViewerDropAdapter#validateDrop(java.lang.Object, int, org.eclipse.swt.dnd.TransferData)
|
||||
*/
|
||||
@Override
|
||||
public boolean validateDrop(Object target, int operation, TransferData transferType) {
|
||||
|
||||
boolean result = false;
|
||||
|
||||
Object selectedObject = this.getSelectedObject();
|
||||
|
||||
if (selectedObject instanceof ProblemElement) {
|
||||
draggedElement = (ProblemElement) selectedObject;
|
||||
if (target != null)
|
||||
this.dropTarget = (ProblemElement) target;
|
||||
|
||||
result = true;
|
||||
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.jface.window.Window;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.domain.ui.dialog.AddDomainDialog;
|
||||
import flintstones.entity.domain.ui.dialog.DomainDialog;
|
||||
import flintstones.entity.domain.ui.dialog.SelectBetweenMultipleDomainsDialog;
|
||||
import flintstones.model.domain.service.IDomainService;
|
||||
import flintstones.model.domain.ui.service.IDomainUIService;
|
||||
|
||||
/**
|
||||
* @author Sinbad2 Domain GUI + icon
|
||||
*
|
||||
*/
|
||||
public class AddDomainHandler {
|
||||
|
||||
@Inject
|
||||
IDomainUIService uiDomainService;
|
||||
|
||||
@Inject
|
||||
IDomainService domainService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/**
|
||||
* @param context
|
||||
* Eclipse context injected
|
||||
*/
|
||||
@Execute
|
||||
public void execute(IEclipseContext context) {
|
||||
// Select domain type
|
||||
String domainType = this.firstDialog(context);
|
||||
|
||||
if (domainType != null)
|
||||
this.secondDialog(domainType);
|
||||
|
||||
}
|
||||
|
||||
private String firstDialog(IEclipseContext context) {
|
||||
AddDomainDialog dialog = ContextInjectionFactory.make(AddDomainDialog.class, context);
|
||||
int status = dialog.open();
|
||||
|
||||
if (status == Window.OK) {
|
||||
String ret = dialog.getSelectedDomainExtension();
|
||||
return ret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void secondDialog(String domainType) {
|
||||
// Create empty domain
|
||||
|
||||
// Open create domain Dialog
|
||||
String[] dialogIds = this.uiDomainService.getExtensionIdsForDomain(domainType,"new");
|
||||
|
||||
// If more than one id was found, chose one in a new dialog
|
||||
String dialogId = ""; //$NON-NLS-1$
|
||||
if (dialogIds.length > 1)
|
||||
dialogId = this.launchSelectDomain(dialogIds);
|
||||
else if( dialogIds.length == 1)
|
||||
dialogId = dialogIds[0];
|
||||
|
||||
// If the domain has a dialog, launch it and complete its data
|
||||
Domain ret = domainService.create(domainType);
|
||||
|
||||
if (dialogId != "" && dialogId != null) {
|
||||
ret = this.launchDomainDialog(ret, dialogId);
|
||||
// Save the new Domain
|
||||
if(ret != null) {
|
||||
this.domainService.add(ret);
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_CREATED, ret);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private String launchSelectDomain(String[] ids) {
|
||||
|
||||
SelectBetweenMultipleDomainsDialog dialog = ContextInjectionFactory.make(SelectBetweenMultipleDomainsDialog.class, context);
|
||||
|
||||
// Cache
|
||||
HashMap<String,String> descriptionIdMap = new HashMap<>();
|
||||
for(String id : ids) {
|
||||
String description = uiDomainService.getDescriptionNewDomainDialog(id);
|
||||
descriptionIdMap.put(description, id);
|
||||
}
|
||||
|
||||
String[] descriptions = descriptionIdMap.keySet().stream().toArray(String[]::new);
|
||||
dialog.setDescriptions(descriptions);
|
||||
|
||||
// Grab info from user
|
||||
int status = dialog.open();
|
||||
String selectedId = descriptionIdMap.get( dialog.getSelected() );
|
||||
if (status == Window.OK)
|
||||
return selectedId;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private Domain launchDomainDialog(Domain baseDomain, String dialogId) {
|
||||
|
||||
DomainDialog newD = this.uiDomainService.newDomainDialog(baseDomain, dialogId);
|
||||
int status = newD.open();
|
||||
|
||||
if (status == Window.OK)
|
||||
return newD.getDomain();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.jface.window.Window;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.dialogs.UpsertProblemElementDialog;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
public class AddProblemElementHandler {
|
||||
|
||||
private String problemElementType;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param context the context
|
||||
* @param nameParameter the name parameter
|
||||
*/
|
||||
@Execute
|
||||
public void execute(IEclipseContext context, @Named("add_object_parameter") String nameParameter) {
|
||||
problemElementType = nameParameter;
|
||||
|
||||
UpsertProblemElementDialog dialog = new UpsertProblemElementDialog(ProblemElementHelper.create("", problemElementType), null); //$NON-NLS-1$
|
||||
ContextInjectionFactory.inject(dialog, context);
|
||||
int dialogResult = dialog.open();
|
||||
|
||||
if (dialogResult == Window.OK) {
|
||||
ProblemElement pe = dialog.getNewProblemElement();
|
||||
problemService.add(pe);
|
||||
broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_CREATED, FrameworkConstants.map("pe", pe));
|
||||
}
|
||||
}
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The Class AddSomeProblemElementHandler -> Quick PE creation.
|
||||
*/
|
||||
public class AddSomeProblemElementHandler {
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The broker. */
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param context the context
|
||||
* @param nameParameter the name parameter
|
||||
*/
|
||||
@Execute
|
||||
public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SELECTION) ProblemElement selectedPE,
|
||||
@Named("add_object_parameter") String nameParameter) {
|
||||
|
||||
int numberCount = 1;
|
||||
String nameObject = "";
|
||||
|
||||
ProblemElement parent = selectedPE != null && selectedPE.getType().equals(nameParameter) ? selectedPE : null;
|
||||
|
||||
nameObject = parent != null ? selectedPE.getName() + "_" : nameParameter + " ";
|
||||
|
||||
boolean alreadyExists = this.problemService.getByName(nameParameter, nameObject + numberCount) != null;
|
||||
while (alreadyExists) {
|
||||
numberCount++;
|
||||
alreadyExists = this.problemService.getByName(nameParameter, nameObject + numberCount) != null;
|
||||
}
|
||||
|
||||
ProblemElement pE = ProblemElementHelper.create(nameObject + numberCount, nameParameter);
|
||||
if (pE.getType().equals(Expert.Type))
|
||||
((Expert) pE).setMail(pE.getName().replace(" ", "") + "@fs4.test");
|
||||
|
||||
if (parent != null)
|
||||
pE.changeParent(parent);
|
||||
|
||||
this.problemService.add(pE);
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_CREATED, FrameworkConstants.map("pe", pE));
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute(IEclipseContext context,
|
||||
@Named("add_object_parameter") String nameParameter) {
|
||||
|
||||
int numberCount = 1;
|
||||
String nameObject = "";
|
||||
|
||||
|
||||
nameObject = nameParameter + " ";
|
||||
|
||||
boolean alreadyExists = this.problemService.getByName(nameParameter, nameObject + numberCount) != null;
|
||||
while (alreadyExists) {
|
||||
numberCount++;
|
||||
alreadyExists = this.problemService.getByName(nameParameter, nameObject + numberCount) != null;
|
||||
}
|
||||
|
||||
ProblemElement pE = ProblemElementHelper.create(nameObject + numberCount, nameParameter);
|
||||
if (pE.getType().equals(Expert.Type))
|
||||
((Expert) pE).setMail(pE.getName().replace(" ", "") + "@fs4.test");
|
||||
|
||||
this.problemService.add(pE);
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_CREATED, FrameworkConstants.map("pe", pE));
|
||||
}
|
||||
|
||||
}
|
||||
+111
@@ -0,0 +1,111 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.jface.window.Window;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.dialogs.FastAddDomainDialog;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.domain.DomainInstance;
|
||||
import flintstones.entity.domain.DomainInstanceMockup;
|
||||
import flintstones.helper.extensionpoint.BaseRegistry;
|
||||
import flintstones.helper.extensionpoint.ExtensionRegistry;
|
||||
import flintstones.model.domain.service.IDomainService;
|
||||
import flintstones.model.domain.ui.service.IDomainUIService;
|
||||
|
||||
public class FastAddDomainHandler {
|
||||
|
||||
private HashMap<String, Integer> fastDomainCounter = new HashMap<String, Integer>();
|
||||
|
||||
@Inject
|
||||
IDomainUIService uiDomainService;
|
||||
|
||||
@Inject
|
||||
IDomainService domainService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
BaseRegistry instancesReg = new BaseRegistry("flintstones.entity.domain.fastadd");
|
||||
BaseRegistry domainReg = new BaseRegistry("flintstones.entity.domain");
|
||||
|
||||
@Execute
|
||||
public void execute(IEclipseContext context) {
|
||||
|
||||
FastAddDomainDialog dialog = ContextInjectionFactory.make(FastAddDomainDialog.class, context);
|
||||
dialog.setDomains(getMockups());
|
||||
|
||||
if(dialog.open() == Window.OK) {
|
||||
String id = dialog.getSelectedDomain();
|
||||
create(id);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private DomainInstanceMockup[] getMockups() {
|
||||
|
||||
ExtensionRegistry[] domainsReg = domainReg.getAllRegistries();
|
||||
|
||||
ArrayList<DomainInstanceMockup> mockups = new ArrayList<>();
|
||||
for(ExtensionRegistry registry : domainsReg) {
|
||||
ExtensionRegistry[] regs = instancesReg.getAllRegistriesWhere("domain_id", registry.getAttribute("uid"));
|
||||
|
||||
if(regs.length > 0) {
|
||||
String catName = registry.getAttribute("label");
|
||||
String domainId = registry.getAttribute("uid");
|
||||
DomainInstanceMockup category = new DomainInstanceMockup(catName);
|
||||
mockups.add(category);
|
||||
|
||||
for(ExtensionRegistry instanceReg : regs) {
|
||||
String id = instanceReg.getAttribute("uid");
|
||||
String label = instanceReg.getAttribute("label");
|
||||
DomainInstanceMockup mock = new DomainInstanceMockup(id, domainId, label, catName);
|
||||
category.addDomain(mock);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return mockups.stream().toArray(DomainInstanceMockup[]::new);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void create(String id) {
|
||||
ExtensionRegistry ex = instancesReg.getFirstRegistryWhere("uid", id);
|
||||
|
||||
// Prepare data
|
||||
String domainId = ex.getAttribute("domain_id");
|
||||
String label = ex.getAttribute("label");
|
||||
|
||||
DomainInstance dInstance = (DomainInstance) instancesReg.instantiate(ex);
|
||||
Domain baseDomain = domainService.create(domainId);
|
||||
dInstance.setCleanDomain(baseDomain);
|
||||
|
||||
if(domainService.getByName(label) != null)
|
||||
label += "_" + fastDomainCounter.put(label, fastDomainCounter.get(label) + 1);
|
||||
else
|
||||
fastDomainCounter.put(label, 1);
|
||||
|
||||
dInstance.setLabel(label);
|
||||
|
||||
Domain finalDomain = dInstance.getInstance();
|
||||
domainService.add(finalDomain);
|
||||
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_CREATED, finalDomain);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.window.Window;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.domain.ui.dialog.DomainDialog;
|
||||
import flintstones.model.domain.service.IDomainService;
|
||||
import flintstones.model.domain.ui.service.IDomainUIService;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
|
||||
/**
|
||||
* The Class ModifyDomainHandler.
|
||||
*/
|
||||
public class ModifyDomainHandler {
|
||||
|
||||
/** The valuation service. */
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
/** The domain service. */
|
||||
@Inject
|
||||
IDomainService domainService;
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The broker. */
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
@Inject
|
||||
IDomainUIService uiDomainService;
|
||||
|
||||
/** The Constant BUS_ID. */
|
||||
private final static String BUS_ID = FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_MODIFIED;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param context Eclipse context injected
|
||||
* @param selectedItem the selected item
|
||||
*/
|
||||
@Execute
|
||||
public void execute(IEclipseContext context, @Named(IServiceConstants.ACTIVE_SELECTION) Domain selectedItem) {
|
||||
// Select domain type
|
||||
String domainType = selectedItem.getType();
|
||||
|
||||
if (domainType != null)
|
||||
this.secondDialog(domainType, selectedItem);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Second dialog.
|
||||
*
|
||||
* @param domainType the domain type
|
||||
* @param d the d
|
||||
* @param context the context
|
||||
*/
|
||||
private void secondDialog(String domainType, Domain d) {
|
||||
DomainDialog domainDialog = this.uiDomainService.modifyDomainDialog(d);
|
||||
|
||||
int status = domainDialog.open();
|
||||
if (status == Window.OK)
|
||||
this.broker.post(ModifyDomainHandler.BUS_ID, d);
|
||||
}
|
||||
|
||||
/**
|
||||
* Can execute.
|
||||
*
|
||||
* @param domain the domain
|
||||
* @return true if the right item is selected
|
||||
*/
|
||||
@CanExecute
|
||||
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) Domain domain) {
|
||||
|
||||
if (domain == null)
|
||||
return false;
|
||||
|
||||
if (uiDomainService.getModifyDomainDialogId(domain.getType()) == null)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.window.Window;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.dialogs.UpsertProblemElementDialog;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
public class ModifyProblemElementHandler {
|
||||
|
||||
/** The context. */
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The broker. */
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param shell the shell
|
||||
* @param pe the problem element
|
||||
*/
|
||||
@Execute
|
||||
public void execute(Shell shell, @Named(IServiceConstants.ACTIVE_SELECTION) ProblemElement pe) {
|
||||
this.handle(pe);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle.
|
||||
*
|
||||
* @param item the item
|
||||
*/
|
||||
public void handle(ProblemElement item) {
|
||||
UpsertProblemElementDialog dialog = new UpsertProblemElementDialog(item, item.getParent());
|
||||
ContextInjectionFactory.inject(dialog, this.context);
|
||||
|
||||
if (dialog.open() == Window.OK) {
|
||||
|
||||
dialog.getModifiedProblemElement(item);
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_MODIFIED, FrameworkConstants.map("pe", item));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can execute.
|
||||
*
|
||||
* @param alternative the alternative
|
||||
* @return true, if successful
|
||||
*/
|
||||
@CanExecute
|
||||
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) ProblemElement pe,
|
||||
@Named("modify_object_parameter") String nameParameter) {
|
||||
if (pe == null || ! ((ProblemElement) pe).getType()
|
||||
.equals(nameParameter))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.core.commands.AbstractHandler;
|
||||
import org.eclipse.core.commands.ExecutionEvent;
|
||||
import org.eclipse.core.commands.ExecutionException;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
|
||||
/**
|
||||
* The Class MoveProblemElementHandler.
|
||||
*/
|
||||
public class MoveProblemElementHandler extends AbstractHandler {
|
||||
|
||||
/** The broker. */
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The valuation service. */
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
/** The pe. */
|
||||
final private ProblemElement pe;
|
||||
|
||||
/** The new pe. */
|
||||
final private ProblemElement newPe;
|
||||
|
||||
/**
|
||||
* Instantiates a new move problem element handler.
|
||||
*
|
||||
* @param pe the pe
|
||||
* @param newPe the new pe
|
||||
*/
|
||||
public MoveProblemElementHandler(ProblemElement pe, ProblemElement newPe) {
|
||||
this.pe = pe;
|
||||
this.newPe = newPe;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.core.commands.IHandler#execute(org.eclipse.core.commands.
|
||||
* ExecutionEvent) */
|
||||
@Override
|
||||
public Object execute(ExecutionEvent event) throws ExecutionException {
|
||||
|
||||
// If the item was moved
|
||||
if (pe.changeParent(newPe)) {
|
||||
|
||||
// Remove the valuation of the PE that now is parent. Now it is not a leaf so it
|
||||
// cant have valuation.
|
||||
this.valuationService.removeValuationFor(this.pe.getType(), this.newPe);
|
||||
|
||||
// Refresh UI
|
||||
if (this.pe instanceof Criterion)
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_CRITERION_MODIFIED, FrameworkConstants.empty());
|
||||
if (this.pe instanceof Expert)
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_EXPERT_MODIFIED, FrameworkConstants.empty());
|
||||
this.broker.post(FrameworkConstants.TOPIC_VALUATION_DELETED, null);
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.nebula.widgets.opal.notifier.NotifierColorsFactory.NotifierTheme;
|
||||
import org.eclipse.nebula.widgets.opal.notifier.WNotifier;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.messages.Messages;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
|
||||
// http://www.java2s.com/Code/Java/SWT-JFace-Eclipse/CopyandPaste.htm
|
||||
public class PasteProblemElementsHandler {
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
Messages messages;
|
||||
|
||||
@Execute
|
||||
public void execute(IEclipseContext context, @Named("paste_parameter_id") String type) {
|
||||
|
||||
Clipboard clipboard = new Clipboard(Display.getCurrent());
|
||||
String plainText = (String) clipboard.getContents(TextTransfer.getInstance());
|
||||
|
||||
String[] elements = plainText.split("\r\n"); //$NON-NLS-1$
|
||||
if(elements.length == 1)
|
||||
elements = plainText.split("\t"); //$NON-NLS-1$
|
||||
|
||||
for(int i = 0; i < elements.length; i++)
|
||||
elements[i] = elements[i].replaceAll("\n","").replaceAll("\r","").replaceAll("\t",""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$
|
||||
|
||||
if(elements.length == 1) {
|
||||
new WNotifier("Error", messages.Elements_have_to_be_separated_by_line_break_or_tabulations, NotifierTheme.YELLOW_THEME) //$NON-NLS-1$
|
||||
.withCloseOnClick(true)
|
||||
.send();
|
||||
return ;
|
||||
}
|
||||
|
||||
if(problemService.getAll(type).length != 0) {
|
||||
new WNotifier("Error", messages.Remove_all_the_elements_before_pasting,NotifierTheme.YELLOW_THEME) //$NON-NLS-1$
|
||||
.withCloseOnClick(true)
|
||||
.withTimeout(60)
|
||||
.send();
|
||||
|
||||
return ;
|
||||
}
|
||||
|
||||
for(String element : elements) {
|
||||
|
||||
// Create
|
||||
ProblemElement pe = ProblemElementHelper.create(element, type);
|
||||
problemService.add(pe);
|
||||
|
||||
}
|
||||
|
||||
// Notify the change to the APP/UI
|
||||
broker.send(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_CREATED, null);
|
||||
new WNotifier(messages.Successfully_completed, messages.Problem_elements_successfully_added, NotifierTheme.BLUE_THEME).send(); //$NON-NLS-1$
|
||||
|
||||
}
|
||||
}
|
||||
+86
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.messages.Messages;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.model.domain.service.IDomainService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
|
||||
/**
|
||||
* The Class RemoveDomainHandler.
|
||||
*/
|
||||
public class RemoveDomainHandler {
|
||||
|
||||
/** The messages. */
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
/** The broker. */
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/** The domain service. */
|
||||
@Inject
|
||||
IDomainService domainService;
|
||||
|
||||
/** The valuation service. */
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
/** The Constant BUS_ID_VALUATION. */
|
||||
private final static String BUS_ID_VALUATION = FrameworkConstants.TOPIC_VALUATION_DELETED;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param shell the shell
|
||||
* @param selectedItem the selected item
|
||||
*/
|
||||
@Execute
|
||||
public void execute(Shell shell, @Named(IServiceConstants.ACTIVE_SELECTION) Domain selectedItem) {
|
||||
|
||||
String template = this.messages.confirmRemoveDomainTemplate;
|
||||
String confirmRemoveDomainMessage = MessageFormat.format(template, selectedItem.getName());
|
||||
|
||||
boolean result = MessageDialog.openConfirm(shell, this.messages.confirmRemoveDomainTitle, confirmRemoveDomainMessage); // $NON-NLS-2$
|
||||
|
||||
if (result) {
|
||||
this.domainService.removeDomain(selectedItem.getId());
|
||||
this.valuationService.removeValuationFor(selectedItem);
|
||||
this.broker.post(FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_DELETED, null);
|
||||
this.broker.post(RemoveDomainHandler.BUS_ID_VALUATION, null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Can execute.
|
||||
*
|
||||
* @param domain the domain
|
||||
* @return true, if successful
|
||||
*/
|
||||
@CanExecute
|
||||
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) Object domain) {
|
||||
if (domain == null || !(domain instanceof Domain))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.e4.ui.services.IServiceConstants;
|
||||
import org.eclipse.jface.dialogs.MessageDialog;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.messages.Messages;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
import flintstones.model.valuation.service.IValuationService;
|
||||
|
||||
public class RemoveProblemElementHandler {
|
||||
|
||||
/** The messages. */
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
/** The valuation service. */
|
||||
@Inject
|
||||
IValuationService valuationService;
|
||||
|
||||
/**
|
||||
* Execute.
|
||||
*
|
||||
* @param shell the shell
|
||||
* @param context the context
|
||||
* @param problemService the problem service
|
||||
* @param broker the broker
|
||||
* @param pe the problem element
|
||||
*/
|
||||
@Execute
|
||||
public void execute(Shell shell, IEclipseContext context, IProblemElementService problemService,
|
||||
IEventBroker broker, @Named(IServiceConstants.ACTIVE_SELECTION) ProblemElement pe,
|
||||
@Named("remove_object_parameter") String nameParameter) {
|
||||
|
||||
String template = this.messages.confirmRemoveProblemElementTemplate;
|
||||
String title = this.messages.confirmRemoveProblemElementTitle;
|
||||
String confirmRemoveProblemElementMessage = MessageFormat.format(template, pe.getName());
|
||||
String confirmRemoveProblemElementTitleMessage = MessageFormat.format(title, pe.getName());
|
||||
|
||||
boolean result = MessageDialog.openConfirm(shell, confirmRemoveProblemElementTitleMessage,
|
||||
confirmRemoveProblemElementMessage); // $NON-NLS-2$
|
||||
|
||||
if (result) {
|
||||
problemService.delete(pe);
|
||||
broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_DELETED, FrameworkConstants.empty());
|
||||
this.valuationService.removeValuationFor(nameParameter, pe);
|
||||
broker.post(FrameworkConstants.TOPIC_VALUATION_DELETED, null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Can execute.
|
||||
*
|
||||
* @param alternative the alternative
|
||||
* @return true, if successful
|
||||
*/
|
||||
@CanExecute
|
||||
public boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION) ProblemElement pe,
|
||||
@Named("remove_object_parameter") String nameParameter) {
|
||||
if (pe == null || ! ((ProblemElement) pe).getType().equals(nameParameter))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
public class ReorderProblemElementHandler {
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
ProblemElement draggedElement;
|
||||
ProblemElement targetElement;
|
||||
boolean before;
|
||||
|
||||
public ReorderProblemElementHandler(ProblemElement draggedElement, ProblemElement targetElement, boolean before) {
|
||||
this.draggedElement = draggedElement;
|
||||
this.targetElement = targetElement;
|
||||
}
|
||||
|
||||
@Execute
|
||||
public void execute() {
|
||||
|
||||
String type = draggedElement.getType();
|
||||
if(!targetElement.getType().equals(type))
|
||||
return ;
|
||||
|
||||
int targetOrder = targetElement.getOrder();
|
||||
int newOrder = before ? targetOrder -1 : targetOrder +1;
|
||||
|
||||
ProblemElement[] pes = ProblemElementHelper.getAsUserOrdered(problemService.getAll(type));
|
||||
for(ProblemElement current : pes) {
|
||||
if( current.getOrder() >= newOrder ) {
|
||||
current.setOrder( current.getOrder() +1 );
|
||||
problemService.add(current);
|
||||
}
|
||||
}
|
||||
draggedElement.setOrder(newOrder);
|
||||
problemService.add(draggedElement);
|
||||
|
||||
broker.send(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_CREATED, null);
|
||||
}
|
||||
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
package flintstones.application.perspective.framework.ui.handlers;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Named;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.CanExecute;
|
||||
import org.eclipse.e4.core.di.annotations.Execute;
|
||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||
|
||||
import flintstones.entity.problemelement.entities.SortingProfile;
|
||||
import flintstones.model.ahpsort.profileassignment.service.IProfileAssignmentService;
|
||||
|
||||
public class ToggleProfilesHandler {
|
||||
|
||||
@Inject
|
||||
IProfileAssignmentService profileService;
|
||||
|
||||
@Inject
|
||||
ESelectionService selectionService;
|
||||
|
||||
@Execute
|
||||
public void execute(IEclipseContext context, @Named("profile_type") String type) {
|
||||
|
||||
if(type.equals(SortingProfile.SortingProfileType.Central.toString()))
|
||||
profileService.setType(SortingProfile.SortingProfileType.Central);
|
||||
if(type.equals(SortingProfile.SortingProfileType.Limiting.toString()))
|
||||
profileService.setType(SortingProfile.SortingProfileType.Limiting);
|
||||
|
||||
// Refresh canExecute
|
||||
selectionService.setSelection(type);
|
||||
}
|
||||
|
||||
@CanExecute
|
||||
public boolean canExecute(@Named("profile_type") String type) {
|
||||
if(profileService.getType().toString().equals(type))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package flintstones.application.perspective.framework.ui.interfaces;
|
||||
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
/**
|
||||
* The Interface IProblemElementViewerOnDoubleClick.
|
||||
*/
|
||||
public interface IProblemElementViewerOnDoubleClick {
|
||||
|
||||
/**
|
||||
* Problem element viewer on double click.
|
||||
*
|
||||
* @param item the item
|
||||
*/
|
||||
void problemElementViewerOnDoubleClick(ProblemElement item);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package flintstones.application.perspective.framework.ui.interfaces;
|
||||
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
/**
|
||||
* The Interface IProblemElementViewerOnSingleClick.
|
||||
*/
|
||||
public interface IProblemElementViewerOnSingleClick {
|
||||
|
||||
/**
|
||||
* Problem element viewer on single click.
|
||||
*
|
||||
* @param item the item
|
||||
*/
|
||||
void problemElementViewerOnSingleClick(ProblemElement item);
|
||||
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// This file has been auto-generated
|
||||
package flintstones.application.perspective.framework.ui.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
@SuppressWarnings("javadoc")
|
||||
public class Messages {
|
||||
|
||||
public String confirmRemoveDomainTemplate;
|
||||
public String confirmRemoveDomainTitle;
|
||||
public String confirmRemoveProblemElementTemplate;
|
||||
public String confirmRemoveProblemElementTitle;
|
||||
public String creating;
|
||||
public String error_alredy_used_name;
|
||||
public String error_name_empty;
|
||||
public String is_child_of;
|
||||
public String is_negative_cost;
|
||||
public String modifying;
|
||||
public String name;
|
||||
public String label_domain_description;
|
||||
public String label_domain_name;
|
||||
public String label_domain_valuation;
|
||||
public String Options;
|
||||
public String upsert_pe_title_template;
|
||||
public String label_experts;
|
||||
public String label_criterions;
|
||||
public String label_alternatives;
|
||||
public String Elements_have_to_be_separated_by_line_break_or_tabulations;
|
||||
public String Problem_elements_successfully_added;
|
||||
public String Remove_all_the_elements_before_pasting;
|
||||
public String Successfully_completed;
|
||||
public String profiles_assignment;
|
||||
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
confirmRemoveDomainTemplate=Do you really want to remove the domain {0}?
|
||||
confirmRemoveDomainTitle=Confirm remove of domain
|
||||
confirmRemoveProblemElementTemplate= Do you really want to remove {0}?
|
||||
confirmRemoveProblemElementTitle= Confirm remove {0}
|
||||
creating=Creating
|
||||
error_alredy_used_name=This name is already been used
|
||||
error_name_empty=The field name can not be empty
|
||||
is_child_of=Is child of {0}
|
||||
is_negative_cost=Is a cost criterion
|
||||
modifying=Modifying
|
||||
name=Name
|
||||
label_domain_description=Description
|
||||
label_domain_name=Domains
|
||||
label_experts=Experts
|
||||
label_criterions=Criteria
|
||||
label_alternatives=Alternatives
|
||||
label_domain_valuation=Valuation
|
||||
Options=Options
|
||||
Elements_have_to_be_separated_by_line_break_or_tabulations=Elements have to be separated by line breaks or tabulations
|
||||
Problem_elements_successfully_added=Problem elements successfully added
|
||||
Remove_all_the_elements_before_pasting=Remove all the elements before pasting
|
||||
Successfully_completed=Successfully completed
|
||||
upsert_pe_title_template={0} a {1}
|
||||
profiles_assignment=Profiles asignment
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
confirmRemoveDomainTemplate=¿Quieres eliminar el dominio {0}?
|
||||
confirmRemoveDomainTitle=Confirma el borrado del dominio
|
||||
confirmRemoveProblemElementTemplate= ¿Quieres eliminar {0}?
|
||||
confirmRemoveProblemElementTitle= Confirma el borrado de {0}
|
||||
creating=Creando
|
||||
error_alredy_used_name=Ese nombre ya esta siendo usado
|
||||
error_name_empty=El campo nombre no puede estar vacio
|
||||
is_child_of=Es hijo de {0}
|
||||
is_negative_cost=Es un criterio de coste
|
||||
modifying=Modificar
|
||||
name=Nombre
|
||||
label_domain_description=Descripciones
|
||||
label_domain_name=Dominios
|
||||
label_domain_valuation=Evaluaciones
|
||||
Options=Opciones
|
||||
upsert_pe_title_template={0} a {1}
|
||||
label_experts=Expertos
|
||||
label_criterions=Criterios
|
||||
label_alternatives=Alternativas
|
||||
Elements_have_to_be_separated_by_line_break_or_tabulations=Debes pegar más de un elemento separado por saltos de línea \n o por tabulaciones
|
||||
Problem_elements_successfully_added=Se han añadido elementos de problema correctamente
|
||||
Remove_all_the_elements_before_pasting=No es posible añadir pegando sin borrar todos
|
||||
Successfully_completed=Completado con éxito
|
||||
profiles_assignment=Asignar perfiles
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.viewer.ProblemElementViewerV2;
|
||||
import flintstones.entity.problemelement.entities.Alternative;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The Class AlternativesPart.
|
||||
*/
|
||||
public class AlternativesPart {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
ProblemElementViewerV2 viewer;
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
ProblemElement[] pes = problemService.getMainElements(Alternative.Type);
|
||||
|
||||
viewer = ContextInjectionFactory.make(ProblemElementViewerV2.class, context);
|
||||
viewer.buildProblemElementViewerV2(parent, pes, Alternative.Type);
|
||||
viewer.isOpenedOnClick(true)
|
||||
.isModifiedOnDoubleClick(true);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_ALLTOPICS) Object event) {
|
||||
viewer.refresh(problemService.getMainElements(Alternative.Type));
|
||||
}
|
||||
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.viewer.ProblemElementViewerV2;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The Class CriteriaPart.
|
||||
*/
|
||||
public class CriteriaPart {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
ProblemElementViewerV2 viewer;
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
ProblemElement[] pes = problemService.getMainElements(Criterion.Type);
|
||||
|
||||
viewer = ContextInjectionFactory.make(ProblemElementViewerV2.class, context);
|
||||
viewer.buildProblemElementViewerV2(parent, pes, Criterion.Type);
|
||||
viewer.isOpenedOnClick(true)
|
||||
.isModifiedOnDoubleClick(true);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_ALLTOPICS) Object event) {
|
||||
viewer.refresh(problemService.getMainElements(Criterion.Type));
|
||||
}
|
||||
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.graphics.Point;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Control;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.domain.Domain;
|
||||
import flintstones.entity.domain.ui.chart.DomainChart;
|
||||
import flintstones.model.domain.ui.service.IDomainUIService;
|
||||
|
||||
/**
|
||||
* The Class DomainChartPart.
|
||||
*/
|
||||
public class DomainChartPart {
|
||||
|
||||
/** The context. */
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/** The domain ui service. */
|
||||
@Inject
|
||||
IDomainUIService uiDomainService;
|
||||
|
||||
@Inject
|
||||
@Translation
|
||||
private flintstones.entity.domain.messages.Messages domainMessages;
|
||||
|
||||
/** The container. */
|
||||
private Composite container;
|
||||
|
||||
/** The chart. */
|
||||
private DomainChart chart = null;
|
||||
|
||||
/** The ranking. */
|
||||
private final Object ranking = null;
|
||||
|
||||
/** The Constant SUB_ID. Subscribe to any change on domain */
|
||||
private final static String SUB_ID = FrameworkConstants.TOPIC_SELECTION_FRAMEWORK_DOMAIN;
|
||||
|
||||
/** The container part. */
|
||||
@Inject
|
||||
MPart part;
|
||||
|
||||
/**
|
||||
* Inits the.
|
||||
*
|
||||
* @param parent the parent
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
this.container = parent;
|
||||
this.part.getParent().setVisible(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Refresh the domain chart.
|
||||
*
|
||||
* @param domain the domain
|
||||
*/
|
||||
public void refresh(Domain domain) {
|
||||
|
||||
this.part.getParent().setVisible(false);
|
||||
|
||||
// if (this.chart != null)
|
||||
for (Control control : this.container.getChildren())
|
||||
if (!control.isDisposed())
|
||||
control.dispose();
|
||||
|
||||
if (domain != null) {
|
||||
Point size = this.container.getSize();
|
||||
|
||||
chart = this.uiDomainService.createChart(domain.getType());
|
||||
if (chart != null)
|
||||
showChart(domain, size);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void showChart(Domain domain, Point size) {
|
||||
this.part.getParent().setVisible(true);
|
||||
this.chart.initialize(domain, this.container, size.x, size.y, SWT.NONE);
|
||||
if (this.ranking != null)
|
||||
this.chart.displayRanking(this.ranking);
|
||||
this.container.layout();
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(DomainChartPart.SUB_ID) Map<String, Object> event) {
|
||||
if (event != null) {
|
||||
|
||||
Domain d = (Domain) event.get(this.domainMessages.Domain_entity);
|
||||
this.refresh(d);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_ALLTOPICS) Domain d) {
|
||||
this.part.getParent().setVisible(false);
|
||||
chart = null;
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.element.common.ui.views.DomainViewer;
|
||||
import flintstones.entity.domain.Domain;
|
||||
|
||||
/**
|
||||
* The Class DomainsPart.
|
||||
*/
|
||||
public class DomainsPart {
|
||||
|
||||
/** The context. */
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/** The domain viewer. */
|
||||
DomainViewer viewer;
|
||||
|
||||
/** The Constant SUB_ID. Subscribe to any change on domains */
|
||||
private static final String SUB_ID = FrameworkConstants.TOPIC_FRAMEWORK_DOMAIN_ALLTOPICS;
|
||||
|
||||
/**
|
||||
* Inits the part.
|
||||
*
|
||||
* @param parent the parent
|
||||
*/
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
this.viewer = ContextInjectionFactory.make(DomainViewer.class, this.context);
|
||||
this.viewer.createControls(parent, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe.
|
||||
*
|
||||
* @param event the event
|
||||
*/
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(DomainsPart.SUB_ID) Domain d) {
|
||||
this.viewer.updateViewer();
|
||||
}
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.viewer.ProblemElementViewerV2;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.helper.debug.DH;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The Class ExpertsPart.
|
||||
*/
|
||||
public class ExpertsPart {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
ProblemElementViewerV2 viewer;
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
ProblemElement[] pes = problemService.getMainElements(Expert.Type);
|
||||
|
||||
viewer = ContextInjectionFactory.make(ProblemElementViewerV2.class, context);
|
||||
viewer.buildProblemElementViewerV2(parent, pes, Expert.Type);
|
||||
viewer.isOpenedOnClick(true)
|
||||
.isModifiedOnDoubleClick(true);
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_ALLTOPICS) Object event) {
|
||||
DH.out(problemService.getMainElements(Expert.Type));
|
||||
|
||||
viewer.refresh(problemService.getMainElements(Expert.Type));
|
||||
}
|
||||
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.ahpsort.profileassignment.ProfileAssignment;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.sorting.ui.SortingDiagram;
|
||||
import flintstones.helper.data.Pair;
|
||||
import flintstones.helper.html.svg.SvgBrowser;
|
||||
import flintstones.model.ahpsort.profileassignment.service.IProfileAssignmentService;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
public class ProfilesClassesPart {
|
||||
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
@Inject
|
||||
IProfileAssignmentService profileService;
|
||||
|
||||
Composite parent;
|
||||
|
||||
Expert e;
|
||||
Criterion c;
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_SORTINGPROFILE_ALLTOPICS) Pair<Expert, Criterion> pair) {
|
||||
|
||||
Arrays.stream(parent.getChildren()).forEach(k -> k.dispose());
|
||||
|
||||
ProblemElement[] experts = problemService.getAll(Expert.Type);
|
||||
ProblemElement[] crits = problemService.getAll(Criterion.Type);
|
||||
|
||||
if(experts.length > 0 && crits.length > 0) {
|
||||
e = pair != null ? (Expert) pair.getLeft() : (Expert) experts[0];
|
||||
c = pair != null ? (Criterion) pair.getRight() : (Criterion) crits[0];
|
||||
|
||||
ProfileAssignment pas = profileService.get(e, c);
|
||||
|
||||
if(pas == null)
|
||||
return ;
|
||||
|
||||
SvgBrowser br = new SvgBrowser(parent);
|
||||
|
||||
SortingDiagram diagram = new SortingDiagram();
|
||||
diagram.setProfiles(pas.getAllProfiles());
|
||||
|
||||
br.setCanvas(diagram);
|
||||
br.render();
|
||||
}
|
||||
parent.layout();
|
||||
|
||||
}
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribeCombo(@UIEventTopic("SORTING_COMBO_SELECTION") Pair<Expert, Criterion> pair) {
|
||||
|
||||
Arrays.stream(parent.getChildren()).forEach(k -> k.dispose());
|
||||
|
||||
ProblemElement[] experts = problemService.getAll(Expert.Type);
|
||||
ProblemElement[] crits = problemService.getAll(Criterion.Type);
|
||||
|
||||
if(experts.length > 0 && crits.length > 0) {
|
||||
e = (Expert) pair.getLeft();
|
||||
c = (Criterion) pair.getRight();
|
||||
ProfileAssignment pas = profileService.get(e, c);
|
||||
|
||||
if(pas == null)
|
||||
return ;
|
||||
|
||||
SvgBrowser br = new SvgBrowser(parent);
|
||||
|
||||
SortingDiagram diagram = new SortingDiagram();
|
||||
diagram.setProfiles(pas.getAllProfiles());
|
||||
|
||||
br.setCanvas(diagram);
|
||||
br.render();
|
||||
}
|
||||
parent.layout();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+261
@@ -0,0 +1,261 @@
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
import org.eclipse.swt.widgets.Label;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.messages.Messages;
|
||||
import flintstones.entity.ahpsort.profileassignment.ProfileAssignment;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.SortingProfile;
|
||||
import flintstones.entity.problemelement.ui.widget.ProblemElementPairSelector;
|
||||
import flintstones.entity.problemelement.ui.widget.listener.IProblemElementPairChangedListener;
|
||||
import flintstones.helper.DoubleHelper;
|
||||
import flintstones.helper.data.Pair;
|
||||
import flintstones.helper.ui.components.WCollector;
|
||||
import flintstones.helper.ui.components.listeners.WEvent;
|
||||
import flintstones.helper.ui.components.listeners.WItemBeforeOperation;
|
||||
import flintstones.helper.ui.components.listeners.WItemChanged;
|
||||
import flintstones.model.ahpsort.profileassignment.service.IProfileAssignmentService;
|
||||
import flintstones.model.domain.service.IDomainService;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
public class ProfilesPart implements WItemBeforeOperation, WItemChanged {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
@Inject
|
||||
IDomainService domainService;
|
||||
|
||||
@Inject
|
||||
IProfileAssignmentService profileService;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
/** The messages. */
|
||||
@Inject
|
||||
@Translation
|
||||
private Messages messages;
|
||||
|
||||
WCollector collector;
|
||||
ProblemElementPairSelector selectors;
|
||||
Label executionError;
|
||||
Composite parent;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
this.parent = parent;
|
||||
new Label(parent,0).setText("");;
|
||||
}
|
||||
|
||||
private void draw(Composite parent, ProblemElement[] experts, ProblemElement[] criterions ) {
|
||||
|
||||
Composite base = new Composite(parent, 0);
|
||||
UiService.setGridLayout(base, 1, true);
|
||||
UiService.setGridData(base, 9, 9, true, true);
|
||||
|
||||
Composite row1 = new Composite(base, 0);
|
||||
UiService.setGridLayout(row1, 1, true);
|
||||
UiService.setGridData(row1, 9, 0, true, false);
|
||||
|
||||
Label titleRightLabel = new Label(row1, 0);
|
||||
titleRightLabel.setText(messages.profiles_assignment);
|
||||
UiService.setGridData(titleRightLabel, 9, 0, true, false);
|
||||
UiService.setFont(titleRightLabel, UiService.FONT_SECTION_TITLE);
|
||||
|
||||
Composite row2 = new Composite(base, 0);
|
||||
UiService.setGridLayout(row2, 5, false);
|
||||
UiService.setGridData(row2, 9, 0, true, false);
|
||||
|
||||
selectors = new ProblemElementPairSelector(row2, experts, criterions);
|
||||
selectors.setListener(new IProblemElementPairChangedListener() {
|
||||
public void otherProblemElementChanged(ProblemElement pe) {
|
||||
Pair<Expert,Criterion> pair = new Pair<>((Expert)selectors.getSelectedMain(), (Criterion)selectors.getSelectedOther());
|
||||
broker.post("SORTING_COMBO_SELECTION",pair);
|
||||
refresh();
|
||||
|
||||
}
|
||||
public void mainProblemElementChanged(ProblemElement pe) {
|
||||
Pair<Expert,Criterion> pair = new Pair<>((Expert)selectors.getSelectedMain(), (Criterion)selectors.getSelectedOther());
|
||||
broker.post("SORTING_COMBO_SELECTION",pair);
|
||||
refresh();
|
||||
}
|
||||
});
|
||||
|
||||
executionError = new Label(row2, 0);
|
||||
executionError.setText(" ");
|
||||
UiService.setFont(executionError, UiService.FONT_TEXT_ERROR);
|
||||
UiService.setGridData(executionError, 9, 0, true, false);
|
||||
|
||||
collector = new WCollector(base);
|
||||
collector.setBeforeOperationListener(this);
|
||||
collector.setChangeListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldBeExecuted(WEvent operationType, String before, String after) {
|
||||
|
||||
// Check if a number is added
|
||||
if (operationType.equals(WEvent.ADD)) {
|
||||
|
||||
String[] data = collector.getData();
|
||||
|
||||
// El valor es doble?
|
||||
if (!DoubleHelper.IsDouble(before)) {
|
||||
executionError.setText("Debe ser un número");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Se respeta el número de perfiles del dominio?
|
||||
// int max = domain.getNumberOfProfiles();
|
||||
// if (data.length == max) {
|
||||
// executionError.setText("Máximo " + max + " valores");
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// Los valores van en orden?
|
||||
if (data.length > 0) {
|
||||
|
||||
|
||||
double[] arr = DoubleHelper.Convert(data);
|
||||
arr = DoubleHelper.Add(arr, DoubleHelper.ParseDouble(before));
|
||||
|
||||
if(!DoubleHelper.IsSorted(arr)) {
|
||||
executionError.setText("Los limites deben introducirse ordenados");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
refresh();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void refresh() {
|
||||
collector.clear();
|
||||
|
||||
ProblemElement e = getCurrentExpert();
|
||||
ProblemElement c = getCurrentCriterion();
|
||||
|
||||
ProfileAssignment assignment = profileService.get((Expert)e, (Criterion)c);
|
||||
|
||||
if (assignment != null) {
|
||||
Double[] valuesD = assignment.getValues();
|
||||
ArrayList<String> values = new ArrayList<>();
|
||||
for (Double val : valuesD)
|
||||
values.add(val + "");
|
||||
|
||||
collector.setValues(values);
|
||||
}
|
||||
|
||||
for (ProblemElement expert : problemService.getAll(Expert.Type)) {
|
||||
for (ProblemElement criterion : problemService.getAll(Criterion.Type)) {
|
||||
updateOtherStatus(expert, criterion, false);
|
||||
}
|
||||
}
|
||||
selectors.refresh();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onWidgetChange() {
|
||||
ProblemElement e = getCurrentExpert();
|
||||
ProblemElement c = getCurrentCriterion();
|
||||
|
||||
ProfileAssignment pa = profileService.create((Expert)e, (Criterion)c);
|
||||
|
||||
String[] limitsS = collector.getData();
|
||||
Double[] limits = new Double[limitsS.length];
|
||||
|
||||
for (int i = 0; i < limitsS.length; i++)
|
||||
limits[i] = Double.parseDouble(limitsS[i]);
|
||||
|
||||
for (Double limit : limits) {
|
||||
SortingProfile profile = new SortingProfile((Expert)getCurrentExpert(), (Criterion)getCurrentCriterion(), limit);
|
||||
ContextInjectionFactory.inject(profile, context);
|
||||
pa.addProfile(profile);
|
||||
}
|
||||
|
||||
profileService.addOrUpdate(pa);
|
||||
|
||||
// Mini refresh
|
||||
executionError.setText("");
|
||||
|
||||
updateOtherStatus(e, c, true);
|
||||
Pair<Expert,Criterion> pair = new Pair<>((Expert)selectors.getSelectedMain(), (Criterion)selectors.getSelectedOther());
|
||||
broker.post(FrameworkConstants.TOPIC_FRAMEWORK_SORTINGPROFILE_CREATED,pair);
|
||||
|
||||
}
|
||||
|
||||
private void updateOtherStatus(ProblemElement expert, ProblemElement criterion, boolean refresh) {
|
||||
ProfileAssignment pa = profileService.get((Expert)expert, (Criterion)criterion);
|
||||
boolean status = pa != null;
|
||||
|
||||
selectors.setStatus(expert, criterion, status, refresh);
|
||||
}
|
||||
|
||||
private ProblemElement getCurrentExpert() {
|
||||
return selectors.getSelectedMain();
|
||||
}
|
||||
|
||||
private ProblemElement getCurrentCriterion() {
|
||||
return selectors.getSelectedOther();
|
||||
}
|
||||
|
||||
private void onCriterionOrExpertCreated() {
|
||||
UiService.setGridLayout(parent, 1, true);
|
||||
UiService.setGridData(parent, 9, 9, true, true);
|
||||
UiService.setBackgroundColor(parent, 255, 255, 255);
|
||||
|
||||
Arrays.stream(parent.getChildren()).forEach(k -> k.dispose());
|
||||
|
||||
ProblemElement[] experts = problemService.getAll(Expert.Type);
|
||||
ProblemElement[] criterions = problemService.getAll(Criterion.Type);
|
||||
|
||||
if(experts.length > 0 && criterions.length > 0 ) {
|
||||
|
||||
draw(parent, experts, criterions);
|
||||
|
||||
refresh();
|
||||
}
|
||||
|
||||
parent.layout();
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribeExpert(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_ALLTOPICS) Map<String, Object> event) {
|
||||
onCriterionOrExpertCreated();
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package flintstones.application.perspective.framework.ui.parts;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.viewer.ProblemElementViewerV2;
|
||||
import flintstones.entity.problemelement.entities.SortingClass;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
public class SortClassPart {
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
ProblemElementViewerV2 viewer;
|
||||
|
||||
@PostConstruct
|
||||
public void init(Composite parent) {
|
||||
ProblemElement[] pes = problemService.getMainElements(SortingClass.Type);
|
||||
|
||||
viewer = ContextInjectionFactory.make(ProblemElementViewerV2.class, context);
|
||||
viewer.buildProblemElementViewerV2(parent, pes, SortingClass.Type);
|
||||
viewer.isOpenedOnClick(true)
|
||||
.isModifiedOnDoubleClick(true);
|
||||
|
||||
}
|
||||
|
||||
@Inject
|
||||
@Optional
|
||||
private void subscribe(@UIEventTopic(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_ALLTOPICS) Object event) {
|
||||
viewer.refresh(problemService.getMainElements(SortingClass.Type));
|
||||
}
|
||||
|
||||
}
|
||||
+66
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.providers;
|
||||
|
||||
import org.eclipse.jface.resource.ImageDescriptor;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.StyledString;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
|
||||
/**
|
||||
* The Class CostLabelCriterionProvider.
|
||||
*/
|
||||
public class CostLabelCriterionProvider extends LabelProvider implements IStyledLabelProvider {
|
||||
|
||||
/** The profit image. */
|
||||
private final ImageDescriptor profitImage;
|
||||
|
||||
/** The cost image. */
|
||||
private final ImageDescriptor costImage;
|
||||
|
||||
/**
|
||||
* Instantiates a new cost label criterion provider.
|
||||
*
|
||||
* @param costImage the cost image
|
||||
* @param profitImage the profit image
|
||||
*/
|
||||
public CostLabelCriterionProvider(ImageDescriptor costImage, ImageDescriptor profitImage) {
|
||||
this.costImage = costImage;
|
||||
this.profitImage = profitImage;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
|
||||
if (element instanceof Criterion) {
|
||||
if (((Criterion) element).isCost())
|
||||
return this.costImage.createImage();
|
||||
return this.profitImage.createImage();
|
||||
}
|
||||
|
||||
return super.getImage(element);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.BaseLabelProvider#dispose() */
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.
|
||||
* IStyledLabelProvider#getStyledText(java.lang.Object) */
|
||||
@Override
|
||||
public StyledString getStyledText(Object element) {
|
||||
return new StyledString(""); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.providers;
|
||||
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.StyledString;
|
||||
import org.eclipse.swt.graphics.Color;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
import flintstones.model.ui.service.style.ForegroundStyler;
|
||||
|
||||
/**
|
||||
* The Class ProblemElementNameLabelProvider.
|
||||
*/
|
||||
public class ProblemElementNameLabelProvider extends LabelProvider implements IStyledLabelProvider {
|
||||
|
||||
/**
|
||||
* Instantiates a new problem element name label provider.
|
||||
*
|
||||
* @param individualImage the individual image
|
||||
* @param groupImage the group image
|
||||
*/
|
||||
public ProblemElementNameLabelProvider() {
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.
|
||||
* IStyledLabelProvider#getStyledText(java.lang.Object) */
|
||||
@Override
|
||||
public StyledString getStyledText(Object element) {
|
||||
if (element instanceof ProblemElement) {
|
||||
ProblemElement pe = (ProblemElement) element;
|
||||
|
||||
StyledString styledString = new StyledString(pe.getName());
|
||||
if( pe.getType().equals(Expert.Type)) {
|
||||
Expert e = (Expert)pe;
|
||||
if(e.getMail() != null && !e.getMail().equals(""))
|
||||
styledString = paint(pe.getName(), "[" + e.getMail() + "]");
|
||||
}
|
||||
return styledString;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object) */
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
if (element instanceof ProblemElement) {
|
||||
|
||||
ProblemElement pe = (ProblemElement) element;
|
||||
|
||||
boolean isCost = false;
|
||||
if(pe.getType().equals(Criterion.Type)) {
|
||||
isCost = ((Criterion)pe).isCost();
|
||||
}
|
||||
|
||||
return UiService.getIcon(ProblemElementHelper.getImage(pe.getType(), pe.hasChildren(), isCost)).createImage();
|
||||
}
|
||||
|
||||
return super.getImage(element);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.jface.viewers.BaseLabelProvider#dispose() */
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
|
||||
private StyledString paint(String leftText, String rightText) {
|
||||
|
||||
Color foregroundColorLeft = UiService.COLOR_FG_NORMAL;
|
||||
Color foregroundColorRight = UiService.COLOR_FG_SECONDARY;
|
||||
|
||||
StyledString leftT = new StyledString(leftText, new ForegroundStyler(foregroundColorLeft));
|
||||
StyledString rightT = new StyledString(rightText, new ForegroundStyler(foregroundColorRight));
|
||||
return leftT.append(" ")
|
||||
.append(rightT);
|
||||
}
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.providers;
|
||||
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
public class ProblemElementTreeContentProvider implements ITreeContentProvider {
|
||||
|
||||
@Override
|
||||
public boolean hasChildren(Object element) {
|
||||
ProblemElement item = (ProblemElement) element;
|
||||
return item.hasChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
return (Object[]) inputElement;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getChildren(Object parentElement) {
|
||||
ProblemElement item = (ProblemElement) parentElement;
|
||||
return item.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getParent(Object element) {
|
||||
ProblemElement item = (ProblemElement) element;
|
||||
|
||||
return item.getParent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import org.eclipse.jface.viewers.ITreeContentProvider;
|
||||
|
||||
import flintstones.entity.problemelement.entities.FakeProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
public class ProblemElementContentProviderV2 implements ITreeContentProvider {
|
||||
|
||||
/* Create a fake root elemtn */
|
||||
ProblemElement fake;
|
||||
ProblemElement[] items;
|
||||
|
||||
public ProblemElementContentProviderV2(String type, ProblemElement[] items) {
|
||||
this.items = items;
|
||||
fake = new FakeProblemElement(type).as(type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getElements(Object inputElement) {
|
||||
|
||||
items = (ProblemElement[]) inputElement;
|
||||
|
||||
return new Object[] {fake};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getChildren(Object parentElement) {
|
||||
|
||||
if(parentElement.equals(fake))
|
||||
return items;
|
||||
|
||||
ProblemElement item = (ProblemElement)parentElement;
|
||||
return item.getChildren();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getParent(Object element) {
|
||||
|
||||
ProblemElement item = (ProblemElement)element;
|
||||
if(item.getParent() == null)
|
||||
return fake;
|
||||
|
||||
return item.getParent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasChildren(Object element) {
|
||||
|
||||
if(element.equals(fake))
|
||||
return true;
|
||||
|
||||
ProblemElement item = (ProblemElement)element;
|
||||
return item.hasChildren();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.swt.dnd.DragSourceEvent;
|
||||
import org.eclipse.swt.dnd.DragSourceListener;
|
||||
|
||||
public class ProblemElementDragProviderV2 implements DragSourceListener {
|
||||
|
||||
// private final Viewer viewer;
|
||||
|
||||
/**
|
||||
* Instantiates a new problem element drag listener.
|
||||
*
|
||||
* @param viewer the viewer
|
||||
*/
|
||||
public ProblemElementDragProviderV2(Viewer viewer) {
|
||||
// this.viewer = viewer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragStart(DragSourceEvent event) {
|
||||
// System.out.println("A -> " + event.getSource());
|
||||
// System.out.println("A -> " + event.getSource());
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragSetData(DragSourceEvent event) {
|
||||
// System.out.println("B -> " + event.getSource());
|
||||
|
||||
// IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
|
||||
// ProblemElement firstElement = (ProblemElement) selection.getFirstElement();
|
||||
|
||||
// if (LocalSelectionTransfer.getTransfer().isSupportedType(event.dataType))
|
||||
// event.data = firstElement;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dragFinished(DragSourceEvent event) {
|
||||
// System.out.println("C -> " + event.getSource());
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerDropAdapter;
|
||||
import org.eclipse.swt.dnd.DropTargetEvent;
|
||||
import org.eclipse.swt.dnd.TransferData;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.entity.problemelement.entities.FakeProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
|
||||
public class ProblemElementDropProviderV2 extends ViewerDropAdapter {
|
||||
|
||||
@Optional
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
private final Viewer viewer;
|
||||
|
||||
public ProblemElementDropProviderV2(Viewer viewer) {
|
||||
super(viewer);
|
||||
this.viewer = viewer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drop(DropTargetEvent event) {
|
||||
int location = this.determineLocation(event);
|
||||
// event.data;
|
||||
ProblemElement target = (ProblemElement) determineTarget(event);
|
||||
|
||||
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
|
||||
ProblemElement source = (ProblemElement) selection.getFirstElement();
|
||||
|
||||
if (target.equals(source))
|
||||
return;
|
||||
|
||||
if (source != null && source.getParent() != null && source.getParent().equals(target))
|
||||
return;
|
||||
|
||||
if (target != null && target.getParent() != null && target.getParent().equals(source))
|
||||
return;
|
||||
|
||||
String translatedLocation = "";
|
||||
switch (location) {
|
||||
case 1:
|
||||
translatedLocation = "Dropped before the target ";
|
||||
// Special case
|
||||
if (target.getParent() == null)
|
||||
target.addChildren(source);
|
||||
else
|
||||
target.getParent().addChildrenBefore(target, source);
|
||||
break;
|
||||
case 2:
|
||||
translatedLocation = "Dropped after the target ";
|
||||
|
||||
// Special case
|
||||
if (target.getParent() == null)
|
||||
target.addChildren(source);
|
||||
else
|
||||
target.getParent().addChildrenAfter(target, source);
|
||||
break;
|
||||
case 3:
|
||||
translatedLocation = "Dropped on the target ";
|
||||
if (target instanceof FakeProblemElement) {
|
||||
if (source.getParent() != null) {
|
||||
source.getParent().removeChildren(source);
|
||||
}
|
||||
} else
|
||||
target.addChildren(source);
|
||||
|
||||
break;
|
||||
case 4:
|
||||
translatedLocation = "Dropped into nothing ";
|
||||
break;
|
||||
}
|
||||
|
||||
System.out.println(translatedLocation);
|
||||
System.out.println("The drop was done on the element: " + target);
|
||||
|
||||
// viewer.setInput(viewer.getInput());
|
||||
broker.post(FrameworkConstants.TOPIC_FRAMEWORK_PROBLEMELEMENT_MODIFIED, target);
|
||||
// super.drop(event);
|
||||
|
||||
}
|
||||
|
||||
// This method performs the actual drop
|
||||
// We simply add the String we receive to the model and trigger a refresh of the
|
||||
// viewer by calling its setInput method.
|
||||
@Override
|
||||
public boolean performDrop(Object data) {
|
||||
// ContentProviderTree.INSTANCE.getModel().add( data.toString());
|
||||
// viewer.setInput(ContentProviderTree.INSTANCE.getModel());
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validateDrop(Object target, int operation, TransferData transferType) {
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||
import org.eclipse.jface.viewers.LabelProvider;
|
||||
import org.eclipse.jface.viewers.StyledString;
|
||||
import org.eclipse.swt.graphics.Image;
|
||||
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.FakeProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.ui.service.UiService;
|
||||
|
||||
public class ProblemElementLabelProviderV2 extends LabelProvider implements IStyledLabelProvider {
|
||||
|
||||
@Override
|
||||
public StyledString getStyledText(Object element) {
|
||||
|
||||
ProblemElement item = (ProblemElement) element;
|
||||
|
||||
StyledString styledString = new StyledString(item.getName());
|
||||
|
||||
if(item instanceof FakeProblemElement)
|
||||
return styledString;
|
||||
|
||||
if( item.getType().equals(Expert.Type) ) {
|
||||
Expert e = (Expert)item;
|
||||
if(e.getMail() != null && !e.getMail().equals(""))
|
||||
styledString = UiService.paintTextWithBrackets(item.getName(), e.getMail(),UiService.COLOR_FG_SECONDARY);
|
||||
|
||||
}
|
||||
|
||||
return styledString;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Image getImage(Object element) {
|
||||
|
||||
ProblemElement item = (ProblemElement) element;
|
||||
if(item instanceof FakeProblemElement)
|
||||
item = new FakeProblemElement("");
|
||||
|
||||
String image = ProblemElementHelper.getImage(item);
|
||||
if(image != null)
|
||||
return UiService.getIcon(image).createImage();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+396
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.di.annotations.Optional;
|
||||
import org.eclipse.e4.core.services.nls.ILocaleChangeService;
|
||||
import org.eclipse.e4.core.services.nls.Translation;
|
||||
import org.eclipse.e4.ui.di.UIEventTopic;
|
||||
import org.eclipse.e4.ui.workbench.modeling.EPartService;
|
||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||
import org.eclipse.jface.viewers.AbstractTreeViewer;
|
||||
import org.eclipse.jface.viewers.CheckboxTreeViewer;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider;
|
||||
import org.eclipse.jface.viewers.ICheckStateListener;
|
||||
import org.eclipse.jface.viewers.ICheckStateProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.TreeViewerColumn;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.TextTransfer;
|
||||
import org.eclipse.swt.dnd.Transfer;
|
||||
import org.eclipse.swt.events.ControlAdapter;
|
||||
import org.eclipse.swt.events.ControlEvent;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.perspective.framework.ui.draganddrop.ProblemElementDragListener;
|
||||
import flintstones.application.perspective.framework.ui.draganddrop.ProblemElementDropListener;
|
||||
import flintstones.application.perspective.framework.ui.interfaces.IProblemElementViewerOnDoubleClick;
|
||||
import flintstones.application.perspective.framework.ui.interfaces.IProblemElementViewerOnSingleClick;
|
||||
import flintstones.application.perspective.framework.ui.providers.ProblemElementNameLabelProvider;
|
||||
import flintstones.application.perspective.framework.ui.providers.ProblemElementTreeContentProvider;
|
||||
import flintstones.entity.problemelement.entities.Alternative;
|
||||
import flintstones.entity.problemelement.entities.Criterion;
|
||||
import flintstones.entity.problemelement.entities.Expert;
|
||||
import flintstones.entity.problemelement.entities.FakeProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElementHelper;
|
||||
import flintstones.model.problemelement.service.IProblemElementService;
|
||||
|
||||
/**
|
||||
* The Class ProblemElementViewer.
|
||||
*/
|
||||
public class ProblemElementViewer {
|
||||
|
||||
/** The problem service. */
|
||||
@Inject
|
||||
IProblemElementService problemService;
|
||||
|
||||
/** The selection service. */
|
||||
@Inject
|
||||
ESelectionService selectionService;
|
||||
|
||||
/** The resource service. */
|
||||
|
||||
/** The part service. */
|
||||
@Inject
|
||||
EPartService partService;
|
||||
|
||||
/** The context. */
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
/** The problem messages. */
|
||||
@Inject
|
||||
@Translation
|
||||
private flintstones.entity.problemelement.messages.Messages problemMessages;
|
||||
|
||||
/** The viewer. */
|
||||
private TreeViewer viewer;
|
||||
|
||||
/** The pe type. */
|
||||
private String peType;
|
||||
|
||||
/** The name column. */
|
||||
// Translatables
|
||||
TreeViewerColumn nameColumn;
|
||||
|
||||
Composite parent;
|
||||
|
||||
/** The header problem element. */
|
||||
// PE as header
|
||||
private FakeProblemElement headerProblemElement;
|
||||
|
||||
/** The open on click. */
|
||||
private boolean openOnClick = false;
|
||||
|
||||
/** The checkable. */
|
||||
private boolean checkable = false;
|
||||
|
||||
/** The check state provider. */
|
||||
private ICheckStateProvider checkStateProvider;
|
||||
|
||||
/** The check statelisteners. */
|
||||
private ArrayList<ICheckStateListener> checkStatelisteners = new ArrayList<>();
|
||||
|
||||
/** The single click listeners. */
|
||||
private ArrayList<IProblemElementViewerOnSingleClick> singleClickListeners = new ArrayList<>();
|
||||
|
||||
/** The double click listeners. */
|
||||
private ArrayList<IProblemElementViewerOnDoubleClick> doubleClickListeners = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* Instantiates a new problem element viewer.
|
||||
*/
|
||||
public ProblemElementViewer() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the controls.
|
||||
*
|
||||
* @param type the type
|
||||
* @param parent the parent
|
||||
*/
|
||||
public void createControls(String type, Composite parent) {
|
||||
this.parent = parent;
|
||||
|
||||
this.createTableViewer(parent);
|
||||
this.createMainColumn(type);
|
||||
this.peType = type;
|
||||
|
||||
this.updateViewer(type);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Open on click.
|
||||
*
|
||||
* @param status the status
|
||||
*/
|
||||
public void openOnClick(boolean status) {
|
||||
openOnClick = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Use global parent.
|
||||
*
|
||||
* @param parentPe the parent pe
|
||||
*/
|
||||
public void useGlobalParent(FakeProblemElement parentPe) {
|
||||
this.headerProblemElement = parentPe;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the listener.
|
||||
*
|
||||
* @param listener the listener
|
||||
*/
|
||||
public void addListener(IProblemElementViewerOnSingleClick listener) {
|
||||
singleClickListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the listener.
|
||||
*
|
||||
* @param listener the listener
|
||||
*/
|
||||
public void addListener(IProblemElementViewerOnDoubleClick listener) {
|
||||
doubleClickListeners.add(listener);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the check state provider.
|
||||
*
|
||||
* @param provider the provider
|
||||
* @param listeners the listeners
|
||||
*/
|
||||
public void addCheckStateProvider(ICheckStateProvider provider, ArrayList<ICheckStateListener> listeners) {
|
||||
checkable = true;
|
||||
checkStateProvider = provider;
|
||||
checkStatelisteners = listeners;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the listeners.
|
||||
*/
|
||||
public void loadListeners() {
|
||||
|
||||
this.viewer.addSelectionChangedListener(e -> {
|
||||
IStructuredSelection selection = (IStructuredSelection) ProblemElementViewer.this.viewer.getSelection();
|
||||
ProblemElementViewer.this.selectionService.setSelection(selection.getFirstElement());
|
||||
});
|
||||
|
||||
this.viewer.addDoubleClickListener(event -> {
|
||||
IStructuredSelection selection = (IStructuredSelection) ProblemElementViewer.this.viewer.getSelection();
|
||||
ProblemElement item = (ProblemElement) selection.getFirstElement();
|
||||
|
||||
for (IProblemElementViewerOnDoubleClick listener : doubleClickListeners) {
|
||||
listener.problemElementViewerOnDoubleClick(item);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
this.viewer.getTree().addListener(SWT.Selection, event -> {
|
||||
|
||||
IStructuredSelection selection = (IStructuredSelection) ProblemElementViewer.this.viewer.getSelection();
|
||||
ProblemElement item = (ProblemElement) selection.getFirstElement();
|
||||
|
||||
// EVENTO CHECK
|
||||
/* if (event.detail == SWT.CHECK) { System.out.println("CHECK"); } else */
|
||||
if (event.detail == SWT.NONE /* 0, click */) {
|
||||
if (openOnClick) {
|
||||
if (item != null)
|
||||
ProblemElementViewer.this.viewer.setExpandedState(item, !ProblemElementViewer.this.viewer.getExpandedState(item));
|
||||
}
|
||||
|
||||
for (IProblemElementViewerOnSingleClick listener : singleClickListeners) {
|
||||
listener.problemElementViewerOnSingleClick(item);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the DND.
|
||||
*/
|
||||
public void addDND() {
|
||||
int operations = DND.DROP_COPY | DND.DROP_MOVE;
|
||||
Transfer[] transferTypes = new Transfer[] { TextTransfer.getInstance() };
|
||||
|
||||
ProblemElementDropListener drop = new ProblemElementDropListener(this.viewer);
|
||||
ProblemElementDragListener drag = new ProblemElementDragListener(this.viewer);
|
||||
|
||||
ContextInjectionFactory.inject(drop, this.context);
|
||||
ContextInjectionFactory.inject(drag, this.context);
|
||||
|
||||
this.viewer.addDragSupport(operations, transferTypes, drag);
|
||||
this.viewer.addDropSupport(operations, transferTypes, drop);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the main column.
|
||||
*
|
||||
* @param type the type
|
||||
*/
|
||||
private void createMainColumn(String type) {
|
||||
this.nameColumn = new TreeViewerColumn(this.viewer, SWT.NONE);
|
||||
this.drawMainColumn(type);
|
||||
|
||||
parent.addControlListener(new ControlAdapter() {
|
||||
@Override
|
||||
public void controlResized(ControlEvent e) {
|
||||
Composite composite = (Composite) e.widget;
|
||||
int width = composite.getBounds().width;
|
||||
nameColumn.getColumn().setWidth(width);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw main column.
|
||||
*
|
||||
* @param type the type
|
||||
*/
|
||||
private void drawMainColumn(String type) {
|
||||
|
||||
this.nameColumn.getColumn().setWidth(300);
|
||||
|
||||
String label = ""; //$NON-NLS-1$
|
||||
if (type.equals(Alternative.Type))
|
||||
label = this.problemMessages.ALTERNATIVE_GROUP_NAME;
|
||||
else if (type.equals(Criterion.Type))
|
||||
label = this.problemMessages.CRITERION_GROUP_NAME;
|
||||
else if (type.equals(Expert.Type))
|
||||
label = this.problemMessages.EXPERT_GROUP_NAME;
|
||||
this.nameColumn.getColumn().setText(label);
|
||||
|
||||
this.nameColumn.setLabelProvider(new DelegatingStyledCellLabelProvider(getLabelProvider(type)));
|
||||
this.viewer.getTree().setSortColumn(this.viewer.getTree().getColumn(0));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the label provider.
|
||||
*
|
||||
* @param type the type
|
||||
* @return the label provider
|
||||
*/
|
||||
protected IStyledLabelProvider getLabelProvider(String type) {
|
||||
return new ProblemElementNameLabelProvider();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the table viewer.
|
||||
*
|
||||
* @param parent the parent
|
||||
*/
|
||||
private void createTableViewer(Composite parent) {
|
||||
if (checkable) {
|
||||
// Tree tree = new Tree(parent, SWT.NONE);
|
||||
this.viewer = new CheckboxTreeViewer(parent);
|
||||
if (checkStateProvider != null)
|
||||
((CheckboxTreeViewer) viewer).setCheckStateProvider(checkStateProvider);
|
||||
|
||||
for (ICheckStateListener listener : checkStatelisteners) {
|
||||
((CheckboxTreeViewer) viewer).addCheckStateListener(listener);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.viewer = new TreeViewer(parent);
|
||||
}
|
||||
this.viewer.setContentProvider(new ProblemElementTreeContentProvider());
|
||||
this.viewer.getTree().setHeaderVisible(true);
|
||||
this.viewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update viewer.
|
||||
*
|
||||
* @param type the type
|
||||
*/
|
||||
public void updateViewer(String type) {
|
||||
if (this.viewer != null) {
|
||||
|
||||
ProblemElement[] items = ProblemElementHelper.getAsUserOrdered(problemService.getMainElements(type));
|
||||
Arrays.sort(items, new Comparator<ProblemElement>() {
|
||||
public int compare(ProblemElement o1, ProblemElement o2) {
|
||||
return transformToSInteger(o1.getName()) - transformToSInteger(o2.getName());
|
||||
}
|
||||
|
||||
int transformToSInteger(String str) {
|
||||
String number = str.replaceAll("\\D", "");
|
||||
return number.isEmpty() ? 0 : Integer.parseInt(number);
|
||||
}
|
||||
});
|
||||
|
||||
if ( this.headerProblemElement != null ) {
|
||||
ProblemElement[] children = headerProblemElement.getChildren();
|
||||
for( ProblemElement child : children )
|
||||
headerProblemElement.removeChildren(child);
|
||||
|
||||
for(ProblemElement item : items)
|
||||
headerProblemElement.addChildren(item);
|
||||
|
||||
items = new ProblemElement[1];
|
||||
items[0] = headerProblemElement;
|
||||
}
|
||||
|
||||
this.viewer.setInput(items);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the header problem element.
|
||||
*
|
||||
* @return the header problem element
|
||||
*/
|
||||
public FakeProblemElement getHeaderProblemElement() {
|
||||
return headerProblemElement;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Gets the tree.
|
||||
*
|
||||
* @return the tree
|
||||
*/
|
||||
public TreeViewer getTree() {
|
||||
return this.viewer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the focus.
|
||||
*/
|
||||
public void setFocus() {
|
||||
this.viewer.getControl().setFocus();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the notified.
|
||||
*
|
||||
* @param s the s
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Inject
|
||||
@Optional
|
||||
private void getNotified(@UIEventTopic(ILocaleChangeService.LOCALE_CHANGE) Locale s) {
|
||||
this.drawMainColumn(this.peType);
|
||||
}
|
||||
|
||||
}
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
package flintstones.application.perspective.framework.ui.viewer;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.e4.core.services.events.IEventBroker;
|
||||
import org.eclipse.e4.ui.workbench.modeling.ESelectionService;
|
||||
import org.eclipse.jface.util.LocalSelectionTransfer;
|
||||
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.TreeSelection;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.jface.viewers.ViewerComparator;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
import org.eclipse.swt.dnd.Transfer;
|
||||
import org.eclipse.swt.widgets.Composite;
|
||||
|
||||
import flintstones.application.constants.FrameworkConstants;
|
||||
import flintstones.application.perspective.framework.ui.handlers.ModifyProblemElementHandler;
|
||||
import flintstones.entity.problemelement.entities.FakeProblemElement;
|
||||
import flintstones.entity.problemelement.entities.ProblemElement;
|
||||
import flintstones.helper.data.Config;
|
||||
|
||||
public class ProblemElementViewerV2 {
|
||||
|
||||
@Inject
|
||||
ESelectionService selectionService;
|
||||
|
||||
@Inject
|
||||
IEclipseContext context;
|
||||
|
||||
@Inject
|
||||
IEventBroker broker;
|
||||
|
||||
private TreeViewer viewer;
|
||||
private Config config = new Config().defaultEnabled( //
|
||||
"openedOnClick" //
|
||||
, "modifiedOnDoubleClick" //
|
||||
, "isDragAndDropEnabled", //
|
||||
"sendBrokerOnClick" //
|
||||
);
|
||||
|
||||
public void buildProblemElementViewerV2(Composite parent, ProblemElement[] rootElements, String type) {
|
||||
drawViewer(parent, rootElements, type);
|
||||
}
|
||||
|
||||
public ProblemElementViewerV2() {
|
||||
|
||||
}
|
||||
|
||||
public ProblemElementViewerV2 drawViewer(Composite parent, ProblemElement[] rootElements, String type) {
|
||||
|
||||
viewer = new TreeViewer(parent);
|
||||
viewer.setContentProvider(new ProblemElementContentProviderV2(type, rootElements));
|
||||
viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(new ProblemElementLabelProviderV2()));
|
||||
viewer.setAutoExpandLevel(4);
|
||||
|
||||
refresh(rootElements);
|
||||
|
||||
// One click
|
||||
viewer.addSelectionChangedListener(event -> {
|
||||
IStructuredSelection selection = event.getStructuredSelection();
|
||||
selectionService.setSelection(selection.getFirstElement());
|
||||
if(config.is("sendBrokerOnClick")) {
|
||||
broker.post(FrameworkConstants.TOPIC_SELECTION_FRAMEWORK_PROBLEMELEMENT, selection.getFirstElement());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Two click
|
||||
viewer.addDoubleClickListener(event -> {
|
||||
TreeSelection selection = (TreeSelection) event.getSelection();
|
||||
selectionService.setSelection(selection);
|
||||
|
||||
if (selection.getFirstElement() instanceof FakeProblemElement)
|
||||
return;
|
||||
|
||||
if (config.is("modifiedOnDoubleClick")) {
|
||||
ContextInjectionFactory.make(ModifyProblemElementHandler.class, context)
|
||||
.handle((ProblemElement) selection.getFirstElement());
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// Comparator
|
||||
viewer.setComparator(new ViewerComparator() {
|
||||
public int compare(Viewer viewer, Object e1, Object e2) {
|
||||
ProblemElement a = (ProblemElement) e1;
|
||||
ProblemElement b = (ProblemElement) e2;
|
||||
return a.getOrder() > b.getOrder() ? 1 : -1;
|
||||
};
|
||||
});
|
||||
|
||||
if (config.is("isDragAndDropEnabled")) {
|
||||
// Drag & drop
|
||||
int operations = DND.DROP_COPY | DND.DROP_MOVE;
|
||||
Transfer[] transferTypes = new Transfer[] { LocalSelectionTransfer.getTransfer() };
|
||||
|
||||
ProblemElementDragProviderV2 drag = new ProblemElementDragProviderV2(viewer);
|
||||
ProblemElementDropProviderV2 drop = new ProblemElementDropProviderV2(viewer);
|
||||
ContextInjectionFactory.inject(drag, context);
|
||||
ContextInjectionFactory.inject(drop, context);
|
||||
|
||||
viewer.addDragSupport(operations, transferTypes, drag);
|
||||
viewer.addDropSupport(operations, transferTypes, drop);
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
||||
// Config
|
||||
public ProblemElementViewerV2 isOpenedOnClick(boolean val) {
|
||||
config.set("openedOnClick", val);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemElementViewerV2 isModifiedOnDoubleClick(boolean val) {
|
||||
config.set("modifiedOnDoubleClick", val);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemElementViewerV2 isDragAndDropEnabled(boolean val) {
|
||||
config.set("isDragAndDropEnabled", val);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ProblemElementViewerV2 sendBrokerOnClick(boolean val) {
|
||||
config.set("sendBrokerOnClick", val);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void refresh(ProblemElement[] items) {
|
||||
|
||||
viewer.setInput(items);
|
||||
viewer.refresh();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user