Browse Source

Fixed Helios workspace

Nicolas Petton 11 years ago
parent
commit
5343fdb6ed

+ 2 - 2
js/Helios-Commands-Core.deploy.js

@@ -592,10 +592,10 @@ smalltalk.method({
 selector: "execute",
 fn: function (){
 var self=this;
-function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+function $HLWorkspace(){return smalltalk.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st($HLCodeWidget())._openAsTab();
+$1=_st($HLWorkspace())._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenWorkspaceCommand)})},
 messageSends: ["openAsTab"]}),

+ 4 - 4
js/Helios-Commands-Core.js

@@ -808,16 +808,16 @@ selector: "execute",
 category: 'executing',
 fn: function (){
 var self=this;
-function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+function $HLWorkspace(){return smalltalk.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
 return smalltalk.withContext(function($ctx1) { 
 var $1;
-$1=_st($HLCodeWidget())._openAsTab();
+$1=_st($HLWorkspace())._openAsTab();
 return $1;
 }, function($ctx1) {$ctx1.fill(self,"execute",{},smalltalk.HLOpenWorkspaceCommand)})},
 args: [],
-source: "execute\x0a\x09^ HLCodeWidget openAsTab",
+source: "execute\x0a\x09^ HLWorkspace openAsTab",
 messageSends: ["openAsTab"],
-referencedClasses: ["HLCodeWidget"]
+referencedClasses: ["HLWorkspace"]
 }),
 smalltalk.HLOpenWorkspaceCommand);
 

+ 94 - 35
js/Helios-Workspace.deploy.js

@@ -623,17 +623,6 @@ messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "displa
 smalltalk.HLCodeWidget);
 
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "canBeOpenAsTab",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return true;
-}, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLCodeWidget.klass)})},
-messageSends: []}),
-smalltalk.HLCodeWidget.klass);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "hintFor:options:",
@@ -789,30 +778,6 @@ return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCod
 messageSends: []}),
 smalltalk.HLCodeWidget.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "tabLabel",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return "Workspace";
-}, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLCodeWidget.klass)})},
-messageSends: []}),
-smalltalk.HLCodeWidget.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "tabPriority",
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=(10);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLCodeWidget.klass)})},
-messageSends: []}),
-smalltalk.HLCodeWidget.klass);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableHintFor:token:",
@@ -1261,3 +1226,97 @@ messageSends: ["browserModel:", "new", "yourself"]}),
 smalltalk.HLSourceCodeWidget.klass);
 
 
+smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "canHaveFocus",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
+messageSends: []}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "codeWidget",
+fn: function (){
+var self=this;
+function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self["@codeWidget"];
+if(($receiver = $2) == nil || $receiver == undefined){
+self["@codeWidget"]=_st($HLCodeWidget())._new();
+$1=self["@codeWidget"];
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
+messageSends: ["ifNil:", "new"]}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "focus",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._codeWidget())._focus();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
+messageSends: ["focus", "codeWidget"]}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderContentOn:",
+fn: function (html){
+var self=this;
+function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
+return smalltalk.withContext(function($ctx1) { 
+_st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
+messageSends: ["with:", "codeWidget"]}),
+smalltalk.HLWorkspace);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "canBeOpenAsTab",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
+messageSends: []}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "tabLabel",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "Workspace";
+}, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
+messageSends: []}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "tabPriority",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=(10);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
+messageSends: []}),
+smalltalk.HLWorkspace.klass);
+
+

+ 129 - 50
js/Helios-Workspace.js

@@ -838,22 +838,6 @@ referencedClasses: ["Smalltalk"]
 smalltalk.HLCodeWidget);
 
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "canBeOpenAsTab",
-category: 'testing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return true;
-}, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLCodeWidget.klass)})},
-args: [],
-source: "canBeOpenAsTab\x0a\x09^ true",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLCodeWidget.klass);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "hintFor:options:",
@@ -1054,40 +1038,6 @@ referencedClasses: []
 }),
 smalltalk.HLCodeWidget.klass);
 
-smalltalk.addMethod(
-smalltalk.method({
-selector: "tabLabel",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-return "Workspace";
-}, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLCodeWidget.klass)})},
-args: [],
-source: "tabLabel\x0a\x09^ 'Workspace'",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLCodeWidget.klass);
-
-smalltalk.addMethod(
-smalltalk.method({
-selector: "tabPriority",
-category: 'accessing',
-fn: function (){
-var self=this;
-return smalltalk.withContext(function($ctx1) { 
-var $1;
-$1=(10);
-return $1;
-}, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLCodeWidget.klass)})},
-args: [],
-source: "tabPriority\x0a\x09^ 10",
-messageSends: [],
-referencedClasses: []
-}),
-smalltalk.HLCodeWidget.klass);
-
 smalltalk.addMethod(
 smalltalk.method({
 selector: "variableHintFor:token:",
@@ -1656,3 +1606,132 @@ referencedClasses: []
 smalltalk.HLSourceCodeWidget.klass);
 
 
+smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "canHaveFocus",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
+args: [],
+source: "canHaveFocus\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "codeWidget",
+category: 'accessing',
+fn: function (){
+var self=this;
+function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
+return smalltalk.withContext(function($ctx1) { 
+var $2,$1;
+$2=self["@codeWidget"];
+if(($receiver = $2) == nil || $receiver == undefined){
+self["@codeWidget"]=_st($HLCodeWidget())._new();
+$1=self["@codeWidget"];
+} else {
+$1=$2;
+};
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
+args: [],
+source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
+messageSends: ["ifNil:", "new"],
+referencedClasses: ["HLCodeWidget"]
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "focus",
+category: 'actions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st(_st(self)._codeWidget())._focus();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
+args: [],
+source: "focus\x0a\x09^ self codeWidget focus",
+messageSends: ["focus", "codeWidget"],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "renderContentOn:",
+category: 'rendering',
+fn: function (html){
+var self=this;
+function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
+return smalltalk.withContext(function($ctx1) { 
+_st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
+return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
+args: ["html"],
+source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
+messageSends: ["with:", "codeWidget"],
+referencedClasses: ["HLContainer"]
+}),
+smalltalk.HLWorkspace);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "canBeOpenAsTab",
+category: 'testing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return true;
+}, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
+args: [],
+source: "canBeOpenAsTab\x0a\x09^ true",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "tabLabel",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+return "Workspace";
+}, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
+args: [],
+source: "tabLabel\x0a\x09^ 'Workspace'",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "tabPriority",
+category: 'accessing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=(10);
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
+args: [],
+source: "tabPriority\x0a\x09^ 10",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLWorkspace.klass);
+
+

+ 1 - 1
st/Helios-Commands-Core.st

@@ -270,7 +270,7 @@ HLOpenCommand subclass: #HLOpenWorkspaceCommand
 !HLOpenWorkspaceCommand methodsFor: 'executing'!
 
 execute
-	^ HLCodeWidget openAsTab
+	^ HLWorkspace openAsTab
 ! !
 
 !HLOpenWorkspaceCommand class methodsFor: 'accessing'!

+ 44 - 14
st/Helios-Workspace.st

@@ -338,14 +338,6 @@ pcKeyMap
 		'Shift-Ctrl-Z' -> 'redo'. 
 		'fallthrough' -> #('basic')
 }
-!
-
-tabLabel
-	^ 'Workspace'
-!
-
-tabPriority
-	^ 10
 ! !
 
 !HLCodeWidget class methodsFor: 'hints'!
@@ -410,12 +402,6 @@ setupKeyMaps
 	<CodeMirror.keyMap['Amber'] = self._keyMap()>
 ! !
 
-!HLCodeWidget class methodsFor: 'testing'!
-
-canBeOpenAsTab
-	^ true
-! !
-
 HLCodeWidget subclass: #HLSourceCodeWidget
 	instanceVariableNames: 'browserModel methodContents'
 	package: 'Helios-Workspace'!
@@ -596,3 +582,47 @@ canBeOpenAsTab
 	^ false
 ! !
 
+HLWidget subclass: #HLWorkspace
+	instanceVariableNames: 'codeWidget'
+	package: 'Helios-Workspace'!
+
+!HLWorkspace methodsFor: 'accessing'!
+
+codeWidget
+	^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]
+! !
+
+!HLWorkspace methodsFor: 'actions'!
+
+focus
+	^ self codeWidget focus
+! !
+
+!HLWorkspace methodsFor: 'rendering'!
+
+renderContentOn: html
+	html with: (HLContainer with: self codeWidget)
+! !
+
+!HLWorkspace methodsFor: 'testing'!
+
+canHaveFocus
+	^ true
+! !
+
+!HLWorkspace class methodsFor: 'accessing'!
+
+tabLabel
+	^ 'Workspace'
+!
+
+tabPriority
+	^ 10
+! !
+
+!HLWorkspace class methodsFor: 'testing'!
+
+canBeOpenAsTab
+	^ true
+! !
+