Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2017-07-18 12:22:43 +0000
committerJuergen Haug2017-07-18 12:22:43 +0000
commite53af21ef530a7bd976c5a3d761bbca892c9fbfe (patch)
treeee37163a1e74ef267ea53c27a17e201d5705b603 /plugins/org.eclipse.etrice.core.room
parente4dec8f093de150cbba61b3b329b111b58c9fb64 (diff)
downloadorg.eclipse.etrice-e53af21ef530a7bd976c5a3d761bbca892c9fbfe.tar.gz
org.eclipse.etrice-e53af21ef530a7bd976c5a3d761bbca892c9fbfe.tar.xz
org.eclipse.etrice-e53af21ef530a7bd976c5a3d761bbca892c9fbfe.zip
[core] RoomFragmentProvider is more reusable
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room')
-rw-r--r--plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomFragmentProvider.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomFragmentProvider.java b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomFragmentProvider.java
index d772b0c89..cb6bd6997 100644
--- a/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomFragmentProvider.java
+++ b/plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/naming/RoomFragmentProvider.java
@@ -141,16 +141,20 @@ public class RoomFragmentProvider extends FSMFragmentProvider {
@Override
public String getFragment(EObject obj, Fallback fallback) {
- String path = roomPathProvider.doSwitch(obj);
- if (path!=null)
- return obj.eClass().getName()+TYPE_SEP+path;
+ String path = getFragment(obj);
+ if (path != null)
+ return path;
return fallback.getFragment(obj);
}
+
+ protected String getFragment(EObject obj) {
+ String path = roomPathProvider.doSwitch(obj);
+ return (path != null) ? obj.eClass().getName()+TYPE_SEP+path : null;
+ }
@Override
- public EObject getEObject(Resource resource, String fragment,
- Fallback fallback) {
+ public EObject getEObject(Resource resource, String fragment, Fallback fallback) {
if (!resource.getContents().isEmpty()) {
RoomModel model = (RoomModel) resource.getContents().get(0);
@@ -219,7 +223,7 @@ public class RoomFragmentProvider extends FSMFragmentProvider {
return false;
}
- private EObject getEObject(RoomModel model, String fragment) {
+ protected EObject getEObject(RoomModel model, String fragment) {
int begin = 0;
int end = fragment.indexOf(TYPE_SEP);
if (end<0)

Back to the top