public code v1
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
|
||||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>flintstones.group</groupId>
|
||||
<artifactId>flintstones.bundles</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>flintstones.entity.domain</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<packaging>eclipse-plugin</packaging>
|
||||
<name>[bundle] Domain</name>
|
||||
</project>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>flintstones.entity.domain</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ManifestBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.SchemaBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.pde.ds.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.pde.PluginNature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1779484362561</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,2 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding/<project>=UTF-8
|
||||
@@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
@@ -0,0 +1,15 @@
|
||||
Manifest-Version: 1.0
|
||||
Bundle-ManifestVersion: 2
|
||||
Bundle-Name: Domain
|
||||
Bundle-SymbolicName: flintstones.entity.domain;singleton:=true
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Automatic-Module-Name: flintstones.entity.domain
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Require-Bundle: org.eclipse.e4.core.services,
|
||||
flintstones.helper.data.wxml,
|
||||
org.apache.commons.lang,
|
||||
flintstones.entity.common;visibility:=reexport,
|
||||
flintstones.entity.extensionenum,
|
||||
flintstones.model.ui.service
|
||||
Export-Package: flintstones.entity.domain,
|
||||
flintstones.entity.domain.messages
|
||||
@@ -0,0 +1,5 @@
|
||||
source.. = src/
|
||||
output.. = bin/
|
||||
bin.includes = META-INF/,\
|
||||
.,\
|
||||
plugin.xml
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?eclipse version="3.4"?>
|
||||
<plugin>
|
||||
<extension-point id="flintstones.entity.domain" name="Domain EP" schema="schema/flintstones.entity.domain.exsd"/>
|
||||
<extension-point id="flintstones.entity.domain.domain_category" name="Domain Category" schema="schema/flintstones.entity.domain.domain_category.exsd"/>
|
||||
<extension-point id="flintstones.entity.domain.fastadd" name="Fast Create Domain" schema="schema/flintstones.entity.domain.fastadd.exsd"/>
|
||||
</plugin>
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="flintstones.entity.domain" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="flintstones.entity.domain" id="flintstones.entity.domain.domain_category" name="Domain Category"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<choice>
|
||||
<element ref="domain_category"/>
|
||||
</choice>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="xid" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="domain_category">
|
||||
<complexType>
|
||||
<attribute name="uid" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="label" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
@@ -0,0 +1,131 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="flintstones.entity.domain" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="flintstones.entity.domain" id="flintstones.entity.domain" name="Domain EP"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<include schemaLocation="flintstones.entity.domain.domain_category.exsd"/>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<choice>
|
||||
<element ref="domain"/>
|
||||
</choice>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="xid" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="domain">
|
||||
<complexType>
|
||||
<attribute name="uid" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="implementation" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="flintstones.entity.domain.Domain:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="label" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="category" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="identifier" basedOn="flintstones.entity.domain.domain_category/domain_category/@uid"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
@@ -0,0 +1,129 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!-- Schema file written by PDE -->
|
||||
<schema targetNamespace="flintstones.entity.domain" xmlns="http://www.w3.org/2001/XMLSchema">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.schema plugin="flintstones.entity.domain" id="flintstones.entity.domain.fastadd" name="Fast Create Domain"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter description of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<element name="extension">
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.element />
|
||||
</appinfo>
|
||||
</annotation>
|
||||
<complexType>
|
||||
<choice minOccurs="1" maxOccurs="unbounded">
|
||||
<element ref="domain_instance"/>
|
||||
</choice>
|
||||
<attribute name="point" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="xid" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="name" type="string">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<element name="domain_instance">
|
||||
<complexType>
|
||||
<attribute name="label" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute translatable="true"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="domain_id" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="identifier" basedOn="flintstones.entity.domain/domain/@uid"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="implementation" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
<appinfo>
|
||||
<meta.attribute kind="java" basedOn="flintstones.entity.domain.DomainInstance:"/>
|
||||
</appinfo>
|
||||
</annotation>
|
||||
</attribute>
|
||||
<attribute name="uid" type="string" use="required">
|
||||
<annotation>
|
||||
<documentation>
|
||||
|
||||
</documentation>
|
||||
</annotation>
|
||||
</attribute>
|
||||
</complexType>
|
||||
</element>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="since"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter the first release in which this extension point appears.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="examples"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter extension point usage example here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="apiinfo"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter API information here.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
<annotation>
|
||||
<appinfo>
|
||||
<meta.section type="implementation"/>
|
||||
</appinfo>
|
||||
<documentation>
|
||||
[Enter information about supplied implementation of this extension point.]
|
||||
</documentation>
|
||||
</annotation>
|
||||
|
||||
|
||||
</schema>
|
||||
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
*
|
||||
*/
|
||||
package flintstones.entity.domain;
|
||||
|
||||
import flintstones.entity.common.interfaces.IdentifiedEntity;
|
||||
import flintstones.entity.common.interfaces.TypedEntity;
|
||||
import flintstones.entity.extensionenum.ExtensionEnum;
|
||||
import flintstones.helper.data.wxml.WNode;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.xml.stream.XMLStreamException;
|
||||
import javax.xml.stream.XMLStreamWriter;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
/**
|
||||
* The Domain Class.
|
||||
*/
|
||||
public abstract class Domain implements Cloneable, Comparable<Domain>, IdentifiedEntity, TypedEntity {
|
||||
|
||||
/** The domain name. */
|
||||
private String name = null; // Must be null
|
||||
|
||||
/** The Constant EXTENSION_POINT. */
|
||||
public static final String EXTENSION_POINT = "flintstones.entity.domain"; //$NON-NLS-1$
|
||||
public static final String EXTENSION_POINT_CATEGORY="flintstones.entity.domain.domain_category";
|
||||
|
||||
/**
|
||||
* The Enum Fields.
|
||||
*/
|
||||
public static enum Fields implements ExtensionEnum {
|
||||
/** The Domain. */
|
||||
Domain,
|
||||
/** The id. */
|
||||
uid,
|
||||
/** The name. */
|
||||
name,
|
||||
/** The type. */
|
||||
category,
|
||||
|
||||
label,
|
||||
|
||||
/** The implementation. */
|
||||
implementation,
|
||||
/** The type. */
|
||||
type // is now label?
|
||||
};
|
||||
|
||||
/**
|
||||
* Instantiates a new domain.
|
||||
*/
|
||||
public Domain() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name.
|
||||
*
|
||||
* @param name the new name
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Midpoint.
|
||||
*
|
||||
* @return the midpoint
|
||||
*/
|
||||
public abstract double midpoint();
|
||||
|
||||
/**
|
||||
* Format description domain.
|
||||
*
|
||||
* @return the string
|
||||
*/
|
||||
public abstract String formatDescriptionDomain();
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final HashCodeBuilder hcb = new HashCodeBuilder(17, 31);
|
||||
hcb.append(this.name);
|
||||
hcb.append(this.type);
|
||||
return hcb.toHashCode();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
||||
if (this == obj)
|
||||
return true;
|
||||
|
||||
if (obj == null)
|
||||
return false;
|
||||
|
||||
if (obj.getClass() != this.getClass())
|
||||
return false;
|
||||
|
||||
final Domain other = (Domain) obj;
|
||||
|
||||
final EqualsBuilder eb = new EqualsBuilder();
|
||||
eb.append(this.name, other.name);
|
||||
eb.append(this.type, other.type);
|
||||
|
||||
return eb.isEquals();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Object#clone()
|
||||
*/
|
||||
@Override
|
||||
public Object clone() {
|
||||
Domain result = null;
|
||||
|
||||
try {
|
||||
result = (Domain) super.clone();
|
||||
} catch (CloneNotSupportedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int compareTo(Domain domain) {
|
||||
|
||||
if (this.name == null)
|
||||
return -1;
|
||||
|
||||
return this.name.compareTo(domain.getName());
|
||||
}
|
||||
|
||||
/**
|
||||
* Write.
|
||||
*
|
||||
* @param writer the writer
|
||||
* @throws XMLStreamException the XML stream exception
|
||||
*/
|
||||
public abstract void write(XMLStreamWriter writer) throws XMLStreamException;
|
||||
|
||||
/**
|
||||
* Read.
|
||||
*
|
||||
* @param node the node
|
||||
*/
|
||||
public abstract void read(WNode node);
|
||||
|
||||
|
||||
/* IdentifiedEntity implementation */
|
||||
private String serviceId = null;
|
||||
|
||||
@Override
|
||||
public final String getId() {
|
||||
return serviceId;
|
||||
};
|
||||
|
||||
@Override
|
||||
public final void updateId() {
|
||||
serviceId = calculateId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final String calculateId() {
|
||||
return UUID.randomUUID().toString();
|
||||
}
|
||||
|
||||
/* TypedEntity implementation */
|
||||
private String type;
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package flintstones.entity.domain;
|
||||
|
||||
public abstract class DomainInstance {
|
||||
|
||||
private String type;
|
||||
private String label;
|
||||
private Domain domain;
|
||||
|
||||
public String getType() {return type; }
|
||||
|
||||
public void setType(String type) {this.type = type;}
|
||||
|
||||
public String getLabel() {return label; }
|
||||
|
||||
public void setLabel(String label) {this.label = label;}
|
||||
|
||||
public void setCleanDomain(Domain d) {domain = d;}
|
||||
|
||||
protected Domain getDomain() { return domain;}
|
||||
|
||||
public abstract Domain getInstance();
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package flintstones.entity.domain;
|
||||
|
||||
public class DomainInstanceMockup extends DomainMockup {
|
||||
|
||||
private String fastId;
|
||||
|
||||
public DomainInstanceMockup(String category) {
|
||||
super(category);
|
||||
}
|
||||
|
||||
public DomainInstanceMockup(String fastId, String id, String label, String category) {
|
||||
super(id, label, category);
|
||||
this.fastId = fastId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImage() {
|
||||
if(id == null)
|
||||
return domains.get(0).getImage();
|
||||
|
||||
return "domain/" + id + ".png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return category;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCategory() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getFastId() {return fastId; }
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package flintstones.entity.domain;
|
||||
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DomainMockup {
|
||||
|
||||
protected String id;
|
||||
protected String label;
|
||||
protected String category;
|
||||
|
||||
ArrayList<DomainMockup> domains = new ArrayList<>();
|
||||
|
||||
public DomainMockup(String category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public void addDomain(DomainMockup domain) {
|
||||
domains.add(domain);
|
||||
}
|
||||
|
||||
public DomainMockup[] getChildren() {
|
||||
|
||||
if(label != null || id != null)
|
||||
return new DomainMockup[0];
|
||||
|
||||
return domains.toArray(new DomainMockup[0]);
|
||||
}
|
||||
|
||||
public DomainMockup(String id, String label, String category) {
|
||||
this.id = id;
|
||||
this.label = label;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return id != null ? label : category;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
|
||||
public String getImage() {
|
||||
if(id == null)
|
||||
return domains.get(0).getImage();
|
||||
|
||||
return "domain/" + id + ".png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
String template = "[{0}] {1} {2}";
|
||||
return MessageFormat.format(template, category, label, id);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// This file has been auto-generated
|
||||
package flintstones.entity.domain.messages;
|
||||
|
||||
import org.eclipse.e4.core.services.nls.Message;
|
||||
|
||||
@Message
|
||||
@SuppressWarnings("javadoc")
|
||||
public class Messages {
|
||||
|
||||
public String Domain_entity;
|
||||
public String Domain_entities;
|
||||
public String Domain_count;
|
||||
public String Domain_type_entities;
|
||||
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Domain_entity=Domain
|
||||
Domain_entities=Domains
|
||||
Domain_count=The number of domains
|
||||
Domain_type_entities=The domains of type
|
||||
Domain_type=The type of domain
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Domain_entity=Dominio
|
||||
Domain_entities=Dominios
|
||||
Domain_count=El número de dominios
|
||||
Domain_type_entities=Los dominios de tipo
|
||||
Domain_type=El tipo de dominio
|
||||
Reference in New Issue
Block a user