Skip to content
This repository was archived by the owner on Oct 7, 2021. It is now read-only.

Commit cf5a3d6

Browse files
committed
Merge branch 'rtotaro/ft/190/TriquetrumCommandLanguageBugFix' of https://github.com/rtotaro/triquetrum into rtotaro/ft/190/TriQuetrumCommandLanguage
2 parents f7b89c4 + ca1244f commit cf5a3d6

File tree

195 files changed

+30921
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+30921
-20
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.DS_Store
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src/main/java"/>
6+
<classpathentry kind="output" path="target/classes"/>
7+
</classpath>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>org.eclipse.triquetrum.commands.api</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.ds.core.builder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.pde.PluginNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
</natures>
33+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: TqCL Api
4+
Bundle-SymbolicName: org.eclipse.triquetrum.commands.api
5+
Bundle-Version: 0.1.0.qualifier
6+
Bundle-Activator: org.eclipse.triquetrum.commands.api.TqCLServices
7+
Bundle-Vendor: Eclipse Triquetrum
8+
Require-Bundle: org.eclipse.core.runtime,
9+
org.eclipse.osgi.services;bundle-version="3.5.100"
10+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
11+
Bundle-ActivationPolicy: lazy
12+
Export-Package: org.eclipse.triquetrum.commands.api,
13+
org.eclipse.triquetrum.commands.api.services
14+
Service-Component: OSGI-INF/librariesProvider.xml
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2017 Totaro Rodolfo
4+
All rights reserved. This program and the accompanying materials
5+
are made available under the terms of the Eclipse Public License v1.0
6+
which accompanies this distribution, and is available at
7+
http://www.eclipse.org/legal/epl-v10.html
8+
9+
Contributors:
10+
Rodolfo Totaro - initial API and implementation and/or initial documentation
11+
-->
12+
13+
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.triquetrum.commands.api">
14+
<implementation class="org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy"/>
15+
<reference bind="addLibraryProvider" cardinality="1..n" interface="org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider" name="TqCLLibraryProvider" policy="dynamic"/>
16+
<service>
17+
<provide interface="org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy"/>
18+
</service>
19+
</scr:component>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
###############################################################################
2+
# Copyright (c) 2017 Totaro Rodolfo
3+
# All rights reserved. This program and the accompanying materials
4+
# are made available under the terms of the Eclipse Public License v1.0
5+
# which accompanies this distribution, and is available at
6+
# http://www.eclipse.org/legal/epl-v10.html
7+
#
8+
# Contributors:
9+
# Rodolfo Totaro - initial API and implementation and/or initial documentation
10+
###############################################################################
11+
output.. = target/classes/
12+
bin.includes = META-INF/,\
13+
.,\
14+
OSGI-INF/librariesProvider.xml
15+
source.. = src/main/java/
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Totaro Rodolfo
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Rodolfo Totaro - initial API and implementation and/or initial documentation
10+
*******************************************************************************/
11+
package org.eclipse.triquetrum.commands.api;
12+
13+
import java.util.Collection;
14+
15+
import org.eclipse.triquetrum.commands.api.services.ModelBuilderService;
16+
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider;
17+
import org.eclipse.triquetrum.commands.api.services.impl.TcQLLibraryProviderProxy;
18+
import org.osgi.framework.BundleActivator;
19+
import org.osgi.framework.BundleContext;
20+
import org.osgi.framework.InvalidSyntaxException;
21+
import org.osgi.framework.ServiceObjects;
22+
import org.osgi.framework.ServiceReference;
23+
24+
public class TqCLServices implements BundleActivator {
25+
26+
private static BundleContext context;
27+
28+
private static TqCLServices instance;
29+
30+
private TcQLLibraryProviderProxy tcQLLibraryProviderProxy;
31+
32+
static BundleContext getContext() {
33+
return context;
34+
}
35+
36+
/*
37+
* (non-Javadoc)
38+
*
39+
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.
40+
* BundleContext)
41+
*/
42+
public void start(BundleContext bundleContext) throws Exception {
43+
TqCLServices.context = bundleContext;
44+
instance=this;
45+
46+
ServiceReference<TcQLLibraryProviderProxy> serviceReference = getContext().getServiceReference(TcQLLibraryProviderProxy.class);
47+
tcQLLibraryProviderProxy = getContext().getService(serviceReference);
48+
}
49+
50+
/*
51+
* (non-Javadoc)
52+
*
53+
* @see
54+
* org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
55+
*/
56+
public void stop(BundleContext bundleContext) throws Exception {
57+
TqCLServices.context = null;
58+
instance=null;
59+
}
60+
61+
public static TqCLServices getInstance() {
62+
return instance;
63+
}
64+
65+
@SuppressWarnings("rawtypes")
66+
public ModelBuilderService getModelBuilderService(Class<?> modelClass) {
67+
try {
68+
Collection<ServiceReference<ModelBuilderService>> serviceReferences = getContext()
69+
.getServiceReferences(ModelBuilderService.class, null);
70+
for (ServiceReference<ModelBuilderService> serviceReference : serviceReferences) {
71+
//TODO:Release service when done
72+
ServiceObjects<ModelBuilderService> serviceObjects = getContext().getServiceObjects(serviceReference);
73+
ModelBuilderService service = serviceObjects.getService();
74+
if (service.getSupportedModelClass() == modelClass) {
75+
return service;
76+
}
77+
}
78+
} catch (InvalidSyntaxException e) {
79+
// TODO Auto-generated catch block
80+
e.printStackTrace();
81+
}
82+
83+
return null;
84+
}
85+
86+
public TqCLLibraryProvider getTqclLibraryProvider()
87+
{
88+
return tcQLLibraryProviderProxy;
89+
}
90+
91+
92+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Totaro Rodolfo
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Rodolfo Totaro - initial API and implementation and/or initial documentation
10+
*******************************************************************************/
11+
package org.eclipse.triquetrum.commands.api.services;
12+
13+
import java.util.ArrayList;
14+
import java.util.List;
15+
16+
public class ActorDescriptor extends EntityDescriptor {
17+
18+
private List<PortDescriptor> ports = new ArrayList<>();
19+
20+
public ActorDescriptor(String sourceLibrary,String displayName, String clazz, String icon) {
21+
super(sourceLibrary,displayName, clazz, icon);
22+
}
23+
24+
@Override
25+
public String getCategory() {
26+
return "Actor";
27+
}
28+
29+
public void addPort(PortDescriptor port)
30+
{
31+
ports.add(port);
32+
}
33+
34+
public List<PortDescriptor> getPorts() {
35+
return ports;
36+
}
37+
38+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*******************************************************************************
2+
* Copyright (c) 2017 Totaro Rodolfo
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Eclipse Public License v1.0
5+
* which accompanies this distribution, and is available at
6+
* http://www.eclipse.org/legal/epl-v10.html
7+
*
8+
* Contributors:
9+
* Rodolfo Totaro - initial API and implementation and/or initial documentation
10+
*******************************************************************************/
11+
package org.eclipse.triquetrum.commands.api.services;
12+
13+
public class DirectorDescriptor extends EntityDescriptor {
14+
15+
public DirectorDescriptor(String sourceLibrary,String displayName, String clazz, String icon) {
16+
super(sourceLibrary,displayName, clazz, icon);
17+
// TODO Auto-generated constructor stub
18+
}
19+
20+
@Override
21+
public String getCategory() {
22+
return "Director";
23+
}
24+
25+
}

0 commit comments

Comments
 (0)