VDBSourceApplication.st
changeset 16 fc1898815ab6
child 17 c5ee4ea44165
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/VDBSourceApplication.st	Fri Sep 19 10:05:54 2014 +0100
@@ -0,0 +1,115 @@
+"{ Package: 'jv:vdb' }"
+
+VDBAbstractApplication subclass:#VDBSourceApplication
+	instanceVariableNames:'sourceFilenameHolder sourceStringHolder'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'VDB-UI-Others'
+!
+
+!VDBSourceApplication class methodsFor:'interface specs'!
+
+windowSpec
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this!! If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "
+     UIPainter new openOnClass:VDBSourceApplication andSelector:#windowSpec
+     VDBSourceApplication new openInterface:#windowSpec
+     VDBSourceApplication open
+    "
+
+    <resource: #canvas>
+
+    ^ 
+    #(FullSpec
+       name: windowSpec
+       window: 
+      (WindowSpec
+         label: 'Source View'
+         name: 'Source View'
+         min: (Point 10 10)
+         bounds: (Rectangle 0 0 300 300)
+       )
+       component: 
+      (SpecCollection
+         collection: (
+          (TextEditorSpec
+             name: 'SourceView'
+             layout: (LayoutFrame 0 0 0 0 0 1 0 1)
+             model: sourceStringHolder
+             hasHorizontalScrollBar: true
+             hasVerticalScrollBar: true
+             hasKeyboardFocusInitially: false
+             postBuildCallback: postBuildSourceView:
+             viewClassName: 'Tools::CodeView2'
+           )
+          )
+        
+       )
+     )
+! !
+
+!VDBSourceApplication class methodsFor:'plugIn spec'!
+
+aspectSelectors
+    "This resource specification was automatically generated
+     by the UIPainter of ST/X."
+
+    "Do not manually edit this. If it is corrupted,
+     the UIPainter may not be able to read the specification."
+
+    "Return a description of exported aspects;
+     these can be connected to aspects of an embedding application
+     (if this app is embedded in a subCanvas)."
+
+    ^ #(
+        #debuggerHolder
+      ).
+
+! !
+
+!VDBSourceApplication methodsFor:'aspects'!
+
+sourceFilenameHolder
+    "return/create the 'sourceFilenameHolder' value holder (automatically generated)"
+
+    sourceFilenameHolder isNil ifTrue:[
+        sourceFilenameHolder := ValueHolder new.
+    ].
+    ^ sourceFilenameHolder
+!
+
+sourceFilenameHolder:aValueModel
+    "set the 'sourceFilenameHolder' value holder (automatically generated)"
+
+    sourceFilenameHolder := aValueModel.
+!
+
+sourceStringHolder
+    "return/create the 'sourceFilenameHolder' value holder (automatically generated)"
+
+    sourceStringHolder isNil ifTrue:[
+        sourceStringHolder := 
+            PluggableAdaptor 
+                on: self sourceFilenameHolder 
+                getter: [ :model | model value isNil ifTrue:['No source'] ifFalse:[model value asFilename contents asString ] ]  
+    ].
+    ^ sourceStringHolder
+
+    "Created: / 19-09-2014 / 00:03:02 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!VDBSourceApplication methodsFor:'hooks'!
+
+postBuildSourceView: aCodeView2
+    aCodeView2 
+        readOnly: true;
+        services: #()
+
+    "Modified: / 19-09-2014 / 00:18:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+