diff options
author | Ed Willink | 2016-09-18 10:17:52 +0000 |
---|---|---|
committer | Ed Willink | 2016-09-19 11:20:14 +0000 |
commit | e57e3a73442cc14abcea7b2b5d5269b96bc60fa9 (patch) | |
tree | c405f8b0ff19272690bc48622a7bab0ca35fe445 /plugins | |
parent | 2ab78f88c703412753b45e7b4936a9367a78c4a3 (diff) | |
download | org.eclipse.qvtd-e57e3a73442cc14abcea7b2b5d5269b96bc60fa9.tar.gz org.eclipse.qvtd-e57e3a73442cc14abcea7b2b5d5269b96bc60fa9.tar.xz org.eclipse.qvtd-e57e3a73442cc14abcea7b2b5d5269b96bc60fa9.zip |
[500369] Refresh QVTi outline
Diffstat (limited to 'plugins')
9 files changed, 112 insertions, 17 deletions
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/AddStatement.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/AddStatement.gif Binary files differnew file mode 100644 index 000000000..085b712fb --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/AddStatement.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CheckStatement.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CheckStatement.gif Binary files differnew file mode 100644 index 000000000..d1406db87 --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CheckStatement.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/ConnectionVariable.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/ConnectionVariable.gif Binary files differnew file mode 100644 index 000000000..cb47d00d9 --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/ConnectionVariable.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CorePattern.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CorePattern.gif Binary files differdeleted file mode 100644 index 3aff05a6a..000000000 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CorePattern.gif +++ /dev/null diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CheckVariableStatement.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/DeclareStatement.gif Binary files differindex 4c738fb92..4c738fb92 100644 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/CheckVariableStatement.gif +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/DeclareStatement.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif Binary files differnew file mode 100644 index 000000000..cb47d00d9 --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/GuardVariable.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/LoopVariable.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/LoopVariable.gif Binary files differnew file mode 100644 index 000000000..cb47d00d9 --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/LoopVariable.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/MappingLoop.gif b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/MappingLoop.gif Binary files differnew file mode 100644 index 000000000..e032286b6 --- /dev/null +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/icons/MappingLoop.gif diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java index f3482d3da..ab3063c38 100644 --- a/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java +++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative.ui/src/org/eclipse/qvtd/xtext/qvtimperative/ui/labeling/QVTimperativeLabelProvider.java @@ -24,7 +24,12 @@ import org.eclipse.qvtd.pivot.qvtimperative.MappingCall; import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding; import org.eclipse.qvtd.pivot.qvtimperative.MappingLoop; import org.eclipse.qvtd.pivot.qvtimperative.NewStatement; +import org.eclipse.qvtd.pivot.qvtimperative.AddStatement; +import org.eclipse.qvtd.pivot.qvtimperative.CheckStatement; +import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable; import org.eclipse.qvtd.pivot.qvtimperative.DeclareStatement; +import org.eclipse.qvtd.pivot.qvtimperative.GuardVariable; +import org.eclipse.qvtd.pivot.qvtimperative.LoopVariable; import org.eclipse.qvtd.pivot.qvtimperative.SetStatement; import org.eclipse.qvtd.xtext.qvtbase.ui.labeling.QVTbaseLabelProvider; import org.eclipse.qvtd.xtext.qvtimperativecs.TopLevelCS; @@ -45,9 +50,29 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider super(delegate); } - // protected String image(Direction ele) { - // return QVTCOREBASE_UI_ICONS + "Direction.gif"; - // } + protected String image(AddStatement ele) { + return "AddStatement.gif"; + } + + protected String image(CheckStatement ele) { + return "CheckStatement.gif"; + } + + protected String image(ConnectionVariable ele) { + return "ConnectionVariable.gif"; + } + + protected String image(DeclareStatement ele) { + return QVTIMPERATIVE_UI_ICONS + "DeclareStatement.gif"; + } + + protected String image(GuardVariable ele) { + return "GuardVariable.gif"; + } + + protected String image(LoopVariable ele) { + return "LoopVariable.gif"; + } protected String image(Mapping ele) { return QVTIMPERATIVE_UI_ICONS + "Mapping.gif"; @@ -61,12 +86,12 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider return "MappingCallBinding.gif"; } - protected String image(NewStatement ele) { - return QVTIMPERATIVE_UI_ICONS + "NewStatement.gif"; + protected String image(MappingLoop ele) { + return "MappingLoop.gif"; } - protected String image(DeclareStatement ele) { - return QVTIMPERATIVE_UI_ICONS + "CheckVariableStatement.gif"; + protected String image(NewStatement ele) { + return QVTIMPERATIVE_UI_ICONS + "NewStatement.gif"; } protected String image(SetStatement ele) { @@ -77,20 +102,42 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider return "QVTiModelFile.gif"; } - protected String text(MappingCall ele) { - return NameUtil.getSafeName(ele.getReferredMapping()); - } - - protected String text(MappingCallBinding ele) { - return NameUtil.getSafeName(ele.getBoundVariable()); + protected String text(AddStatement ele) { + assert ele != null; + Namespace namespace = PivotUtil.getNamespace(ele.eContainer()); + if (namespace == null) { + return ""; + } + StringBuilder s = new StringBuilder(); + VariableDeclaration targetVariable = ele.getTargetVariable(); + if (targetVariable != null) { + s.append(PrettyPrinter.printName(targetVariable, namespace)); + } + s.append(" += "); + return s.toString(); } - protected String text(MappingLoop ele) { - return "«for»"; + protected String text(ConnectionVariable ele) { + assert ele != null; + Namespace namespace = PivotUtil.getNamespace(ele.eContainer()); + if (namespace == null) { + return ""; + } + StringBuilder s = new StringBuilder(); + s.append(PrettyPrinter.printName(ele, namespace)); + s.append(" : "); + Type type = ele.getType(); + if (type != null) { + s.append(PrettyPrinter.printType(type, namespace)); + } + return s.toString(); } - protected String text(Predicate ele) { - return "«predicate»"; + protected String text(CheckStatement ele) { + assert ele != null; + StringBuilder s = new StringBuilder(); + s.append(PrettyPrinter.print(ele)); + return s.toString(); } protected String text(DeclareStatement ele) { @@ -110,6 +157,54 @@ public class QVTimperativeLabelProvider extends QVTbaseLabelProvider return s.toString(); } + protected String text(GuardVariable ele) { + assert ele != null; + Namespace namespace = PivotUtil.getNamespace(ele.eContainer()); + if (namespace == null) { + return ""; + } + StringBuilder s = new StringBuilder(); + s.append(PrettyPrinter.printName(ele, namespace)); + s.append(" : "); + Type type = ele.getType(); + if (type != null) { + s.append(PrettyPrinter.printType(type, namespace)); + } + return s.toString(); + } + + protected String text(LoopVariable ele) { + assert ele != null; + Namespace namespace = PivotUtil.getNamespace(ele.eContainer()); + if (namespace == null) { + return ""; + } + StringBuilder s = new StringBuilder(); + s.append(PrettyPrinter.printName(ele, namespace)); + s.append(" : "); + Type type = ele.getType(); + if (type != null) { + s.append(PrettyPrinter.printType(type, namespace)); + } + return s.toString(); + } + + protected String text(MappingCall ele) { + return NameUtil.getSafeName(ele.getReferredMapping()); + } + + protected String text(MappingCallBinding ele) { + return NameUtil.getSafeName(ele.getBoundVariable()); + } + + protected String text(MappingLoop ele) { + return "«for»"; + } + + protected String text(Predicate ele) { + return "«predicate»"; + } + protected String text(SetStatement ele) { assert ele != null; Namespace namespace = PivotUtil.getNamespace(ele.eContainer()); |