forked from eclipse-archived/triquetrum
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eclipse-archived#190 First Implementation of TriQuetrum Command Langu…
…age (TqCL) Signed-off-by: Rodolfo Totaro <[email protected]>
- Loading branch information
Showing
195 changed files
with
30,918 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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/main/java"/> | ||
<classpathentry kind="output" path="target/classes"/> | ||
</classpath> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>org.eclipse.triquetrum.commands.api</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> | ||
</buildSpec> | ||
<natures> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
7 changes: 7 additions & 0 deletions
7
org.eclipse.triquetrum.commands.api/.settings/org.eclipse.jdt.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Manifest-Version: 1.0 | ||
Bundle-ManifestVersion: 2 | ||
Bundle-Name: TqCL Api | ||
Bundle-SymbolicName: org.eclipse.triquetrum.commands.api | ||
Bundle-Version: 0.1.0.qualifier | ||
Bundle-Activator: org.eclipse.triquetrum.commands.api.TqCLServices | ||
Bundle-Vendor: Eclipse Triquetrum | ||
Require-Bundle: org.eclipse.core.runtime, | ||
org.eclipse.osgi.services;bundle-version="3.5.100" | ||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
Bundle-ActivationPolicy: lazy | ||
Export-Package: org.eclipse.triquetrum.commands.api, | ||
org.eclipse.triquetrum.commands.api.services | ||
Service-Component: OSGI-INF/librariesProvider.xml |
8 changes: 8 additions & 0 deletions
8
org.eclipse.triquetrum.commands.api/OSGI-INF/librariesProvider.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.triquetrum.commands.api"> | ||
<implementation class="org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy"/> | ||
<reference bind="addLibraryProvider" cardinality="1..n" interface="org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider" name="TqCLLibraryProvider" policy="dynamic"/> | ||
<service> | ||
<provide interface="org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy"/> | ||
</service> | ||
</scr:component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
output.. = target/classes/ | ||
bin.includes = META-INF/,\ | ||
.,\ | ||
OSGI-INF/librariesProvider.xml | ||
source.. = src/main/java/ |
89 changes: 89 additions & 0 deletions
89
...iquetrum.commands.api/src/main/java/org/eclipse/triquetrum/commands/api/TqCLServices.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Totaro Rodolfo | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Rodolfo Totaro - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
package org.eclipse.triquetrum.commands.api; | ||
|
||
import java.util.Collection; | ||
|
||
import org.eclipse.triquetrum.commands.api.services.ModelBuilderService; | ||
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider; | ||
import org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy; | ||
import org.osgi.framework.BundleActivator; | ||
import org.osgi.framework.BundleContext; | ||
import org.osgi.framework.InvalidSyntaxException; | ||
import org.osgi.framework.ServiceObjects; | ||
import org.osgi.framework.ServiceReference; | ||
|
||
public class TqCLServices implements BundleActivator { | ||
|
||
private static BundleContext context; | ||
|
||
private static TqCLServices instance; | ||
|
||
static BundleContext getContext() { | ||
return context; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework. | ||
* BundleContext) | ||
*/ | ||
public void start(BundleContext bundleContext) throws Exception { | ||
TqCLServices.context = bundleContext; | ||
instance=this; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext) | ||
*/ | ||
public void stop(BundleContext bundleContext) throws Exception { | ||
TqCLServices.context = null; | ||
instance=null; | ||
} | ||
|
||
public static TqCLServices getInstance() { | ||
return instance; | ||
} | ||
|
||
@SuppressWarnings("rawtypes") | ||
public ModelBuilderService getModelBuilderService(Class<?> modelClass) { | ||
try { | ||
Collection<ServiceReference<ModelBuilderService>> serviceReferences = getContext() | ||
.getServiceReferences(ModelBuilderService.class, null); | ||
for (ServiceReference<ModelBuilderService> serviceReference : serviceReferences) { | ||
//TODO:Release service when done | ||
ServiceObjects<ModelBuilderService> serviceObjects = getContext().getServiceObjects(serviceReference); | ||
ModelBuilderService service = serviceObjects.getService(); | ||
if (service.getSupportedModelClass() == modelClass) { | ||
return service; | ||
} | ||
} | ||
} catch (InvalidSyntaxException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
public TqCLLibraryProvider getTqclLibraryProvider() | ||
{ | ||
ServiceReference<TcQLLibraryProviderProxy> serviceReference = getContext().getServiceReference(TcQLLibraryProviderProxy.class); | ||
TcQLLibraryProviderProxy service = getContext().getService(serviceReference); | ||
return service; | ||
} | ||
|
||
|
||
} |
28 changes: 28 additions & 0 deletions
28
...mands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/ActorDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class ActorDescriptor extends EntityDescriptor { | ||
|
||
private List<PortDescriptor> ports = new ArrayList<>(); | ||
|
||
public ActorDescriptor(String sourceLibrary,String displayName, String clazz, String icon) { | ||
super(sourceLibrary,displayName, clazz, icon); | ||
} | ||
|
||
@Override | ||
public String getCategory() { | ||
return "Actor"; | ||
} | ||
|
||
public void addPort(PortDescriptor port) | ||
{ | ||
ports.add(port); | ||
} | ||
|
||
public List<PortDescriptor> getPorts() { | ||
return ports; | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...ds.api/src/main/java/org/eclipse/triquetrum/commands/api/services/DirectorDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
public class DirectorDescriptor extends EntityDescriptor { | ||
|
||
public DirectorDescriptor(String sourceLibrary,String displayName, String clazz, String icon) { | ||
super(sourceLibrary,displayName, clazz, icon); | ||
// TODO Auto-generated constructor stub | ||
} | ||
|
||
@Override | ||
public String getCategory() { | ||
return "Director"; | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
...ands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/EntityDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public abstract class EntityDescriptor { | ||
|
||
private String clazz; | ||
|
||
private String displayName; | ||
|
||
private String icon; | ||
|
||
private String sourceLibrary; | ||
|
||
private List<ParameterDescriptor> parameters = new ArrayList<>(); | ||
|
||
public EntityDescriptor(String sourceLibrary,String displayName, String clazz, String icon) { | ||
super(); | ||
this.sourceLibrary = sourceLibrary; | ||
this.displayName = displayName; | ||
this.clazz = clazz; | ||
this.icon = icon; | ||
} | ||
|
||
|
||
public String getSourceLibrary() { | ||
return sourceLibrary; | ||
} | ||
|
||
public String getClazz() { | ||
return clazz; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public String getIcon() { | ||
return icon; | ||
} | ||
|
||
public abstract String getCategory(); | ||
|
||
|
||
public void addParameter(ParameterDescriptor parameter) { | ||
parameters.add(parameter); | ||
} | ||
|
||
|
||
public List<ParameterDescriptor> getParameters() { | ||
return parameters; | ||
} | ||
|
||
|
||
|
||
} |
38 changes: 38 additions & 0 deletions
38
...s.api/src/main/java/org/eclipse/triquetrum/commands/api/services/ModelBuilderService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Totaro Rodolfo | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Rodolfo Totaro - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
import java.util.Map; | ||
|
||
|
||
public interface ModelBuilderService<CompositeActor,Actor> { | ||
|
||
public Class<?> getSupportedModelClass(); | ||
|
||
public CompositeActor createNewModel(String modelName, String folderPath); | ||
|
||
public boolean insertActor(CompositeActor parent,String actorName,String actorclass,Map<String,String> parameters); | ||
|
||
public boolean insertDirector(CompositeActor actor,String directorName, String entityClass, Map<String, String> params); | ||
|
||
public boolean insertPort(Actor actor, String portClass, String entityClass, Map<String, String> params); | ||
|
||
public boolean insertParameter(Actor actor, String parameterClass, String entityClass, Map<String, String> params); | ||
|
||
public CompositeActor getParent(Actor actor); | ||
|
||
public Actor getChild(CompositeActor parent, String name); | ||
|
||
public boolean connect(CompositeActor currentActor, String from, String to); | ||
|
||
|
||
|
||
} |
26 changes: 26 additions & 0 deletions
26
...s.api/src/main/java/org/eclipse/triquetrum/commands/api/services/ParameterDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
public class ParameterDescriptor extends EntityDescriptor { | ||
|
||
private String defaultValue=""; | ||
|
||
public ParameterDescriptor(String sourceLibrary,String displayName, String clazz, String icon) { | ||
super(sourceLibrary,displayName, clazz, icon); | ||
} | ||
|
||
@Override | ||
public String getCategory() { | ||
return "Parameter"; | ||
} | ||
|
||
public String getDefaultValue() { | ||
return defaultValue; | ||
} | ||
|
||
public void setDefaultValue(String defaultValue) { | ||
this.defaultValue = defaultValue; | ||
} | ||
|
||
|
||
|
||
} |
31 changes: 31 additions & 0 deletions
31
...mmands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/PortDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
public class PortDescriptor extends EntityDescriptor { | ||
|
||
private boolean input; | ||
|
||
private boolean output; | ||
|
||
|
||
public PortDescriptor(String sourceLibrary,String displayName, String clazz, String icon,boolean input,boolean output) { | ||
super(sourceLibrary,displayName, clazz, icon); | ||
this.input = input; | ||
this.output = output; | ||
} | ||
|
||
@Override | ||
public String getCategory() { | ||
return "Port"; | ||
} | ||
|
||
|
||
|
||
public boolean isInput() { | ||
return input; | ||
} | ||
|
||
public boolean isOutput() { | ||
return output; | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...ommands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/TcQLException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2016 Totaro Rodolfo | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
* | ||
* Contributors: | ||
* Rodolfo Totaro - initial API and implementation and/or initial documentation | ||
*******************************************************************************/ | ||
package org.eclipse.triquetrum.commands.api.services; | ||
|
||
public class TcQLException extends Exception { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 8072711939052951422L; | ||
|
||
} |
Oops, something went wrong.