Skip to content

Commit 01305c1

Browse files
committed
eclipse-archived#190 In progress TqCL-syntax and library services
1 parent 44277cc commit 01305c1

File tree

22 files changed

+901
-779
lines changed

22 files changed

+901
-779
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.eclipse.triquetrum.commands.api.services;
2+
3+
public class ActorDescriptor extends EntityDescriptor {
4+
5+
public ActorDescriptor(String displayName, String clazz, String icon) {
6+
super(displayName, clazz, icon);
7+
}
8+
9+
@Override
10+
public String getCategory() {
11+
return "Actor";
12+
}
13+
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package org.eclipse.triquetrum.commands.api.services;
2+
3+
public class DirectorDescriptor extends EntityDescriptor {
4+
5+
public DirectorDescriptor(String displayName, String clazz, String icon) {
6+
super(displayName, clazz, icon);
7+
// TODO Auto-generated constructor stub
8+
}
9+
10+
@Override
11+
public String getCategory() {
12+
return "Director";
13+
}
14+
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package org.eclipse.triquetrum.commands.api.services;
2+
3+
public abstract class EntityDescriptor {
4+
5+
private String clazz;
6+
7+
private String displayName;
8+
9+
private String icon;
10+
11+
public EntityDescriptor(String displayName, String clazz, String icon) {
12+
super();
13+
this.displayName = displayName;
14+
this.clazz = clazz;
15+
this.icon = icon;
16+
}
17+
18+
public String getClazz() {
19+
return clazz;
20+
}
21+
22+
public String getDisplayName() {
23+
return displayName;
24+
}
25+
26+
public String getIcon() {
27+
return icon;
28+
}
29+
30+
public abstract String getCategory();
31+
32+
33+
34+
}

org.eclipse.triquetrum.commands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/TqCLLibraryProvider.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515

1616
public interface TqCLLibraryProvider {
1717

18-
public List<String> getActors(String library) throws TqCLLibraryException;
18+
public List<ActorDescriptor> getActors(String library) throws TqCLLibraryException;
1919

20-
public List<String> getDirectors(String library) throws TqCLLibraryException;
20+
public List<DirectorDescriptor> getDirectors(String library) throws TqCLLibraryException;
2121

2222
public List<String> getParameterTypes(String library) throws TqCLLibraryException;
2323

org.eclipse.triquetrum.commands.api/src/main/java/org/eclipse/triquetrum/commands/api/services/impl/TcQLLibraryProviderProxy.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.util.Map;
1818
import java.util.Set;
1919

20+
import org.eclipse.triquetrum.commands.api.services.ActorDescriptor;
21+
import org.eclipse.triquetrum.commands.api.services.DirectorDescriptor;
2022
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryException;
2123
import org.eclipse.triquetrum.commands.api.services.TqCLLibraryProvider;
2224

@@ -26,7 +28,7 @@ public class TcQLLibraryProviderProxy implements TqCLLibraryProvider {
2628

2729

2830
@Override
29-
public List<String> getActors(String library) throws TqCLLibraryException {
31+
public List<ActorDescriptor> getActors(String library) throws TqCLLibraryException {
3032
checkLibrary(library);
3133
return libraryProviders.get(library).getActors(library);
3234
}
@@ -39,7 +41,7 @@ private void checkLibrary(String library) throws TqCLLibraryException {
3941
}
4042

4143
@Override
42-
public List<String> getDirectors(String library) throws TqCLLibraryException {
44+
public List<DirectorDescriptor> getDirectors(String library) throws TqCLLibraryException {
4345
checkLibrary(library);
4446
return libraryProviders.get(library).getDirectors(library);
4547
}
@@ -95,11 +97,6 @@ public boolean hasElement(String element) {
9597
return false;
9698
}
9799

98-
public void setLibraryProviders(Collection<TqCLLibraryProvider> libraryProviders) {
99-
for (TqCLLibraryProvider tqCLLibraryProvider : libraryProviders) {
100-
addLibraryProvider(tqCLLibraryProvider);
101-
}
102-
}
103100

104101
public void addLibraryProvider(TqCLLibraryProvider tqCLLibraryProvider) {
105102
Set<String> libraryNames = tqCLLibraryProvider.getLibraryNames();

org.eclipse.triquetrum.commands.xtext.ide/src/main/java-gen/org/eclipse/triquetrum/commands/ide/contentassist/antlr/internal/InternalTqcl.g

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -941,25 +941,25 @@ rule__Category__Alternatives
941941
:
942942
(
943943
{ before(grammarAccess.getCategoryAccess().getActorEnumLiteralDeclaration_0()); }
944-
('actor')
944+
('Actor')
945945
{ after(grammarAccess.getCategoryAccess().getActorEnumLiteralDeclaration_0()); }
946946
)
947947
|
948948
(
949949
{ before(grammarAccess.getCategoryAccess().getParameterEnumLiteralDeclaration_1()); }
950-
('parameter')
950+
('Parameter')
951951
{ after(grammarAccess.getCategoryAccess().getParameterEnumLiteralDeclaration_1()); }
952952
)
953953
|
954954
(
955955
{ before(grammarAccess.getCategoryAccess().getPortEnumLiteralDeclaration_2()); }
956-
('port')
956+
('Port')
957957
{ after(grammarAccess.getCategoryAccess().getPortEnumLiteralDeclaration_2()); }
958958
)
959959
|
960960
(
961961
{ before(grammarAccess.getCategoryAccess().getDirectorEnumLiteralDeclaration_3()); }
962-
('director')
962+
('Director')
963963
{ after(grammarAccess.getCategoryAccess().getDirectorEnumLiteralDeclaration_3()); }
964964
)
965965
;
@@ -4114,9 +4114,9 @@ rule__Insert__NameAssignment_4
41144114
}
41154115
:
41164116
(
4117-
{ before(grammarAccess.getInsertAccess().getNameNamedObjParserRuleCall_4_0()); }
4118-
ruleNamedObj
4119-
{ after(grammarAccess.getInsertAccess().getNameNamedObjParserRuleCall_4_0()); }
4117+
{ before(grammarAccess.getInsertAccess().getNameSTRINGTerminalRuleCall_4_0()); }
4118+
RULE_STRING
4119+
{ after(grammarAccess.getInsertAccess().getNameSTRINGTerminalRuleCall_4_0()); }
41204120
)
41214121
;
41224122
finally {

org.eclipse.triquetrum.commands.xtext.ide/src/main/java-gen/org/eclipse/triquetrum/commands/ide/contentassist/antlr/internal/InternalTqcl.tokens

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
'=>'=29
1111
'>'=33
1212
'?'=34
13+
'Actor'=10
14+
'Director'=13
15+
'Parameter'=11
16+
'Port'=12
1317
'['=27
1418
']'=28
15-
'actor'=10
1619
'as'=18
1720
'connect'=22
18-
'director'=13
1921
'extends'=35
2022
'extension'=43
2123
'go'=24
@@ -25,8 +27,6 @@
2527
'into'=40
2628
'library'=16
2729
'out'=41
28-
'parameter'=11
29-
'port'=12
3030
'set'=21
3131
'static'=42
3232
'super'=37

0 commit comments

Comments
 (0)