Browse Source

fixes issue #855

Nicolas Petton 10 years ago
parent
commit
bf0c9e2ef1

+ 3 - 0
src/Helios-Announcements.js

@@ -360,6 +360,9 @@ smalltalk.addClass('HLFocusRequested', globals.HLAnnouncement, [], 'Helios-Annou
 smalltalk.addClass('HLClassesFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 
+smalltalk.addClass('HLDocumentationFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
+
+
 smalltalk.addClass('HLMethodsFocusRequested', globals.HLFocusRequested, [], 'Helios-Announcements');
 
 

+ 4 - 0
src/Helios-Announcements.st

@@ -188,6 +188,10 @@ HLFocusRequested subclass: #HLClassesFocusRequested
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!
 
+HLFocusRequested subclass: #HLDocumentationFocusRequested
+	instanceVariableNames: ''
+	package: 'Helios-Announcements'!
+
 HLFocusRequested subclass: #HLMethodsFocusRequested
 	instanceVariableNames: ''
 	package: 'Helios-Announcements'!

+ 39 - 3
src/Helios-Browser.js

@@ -707,6 +707,23 @@ referencedClasses: ["HLClassesFocusRequested"]
 }),
 globals.HLBrowserModel);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "focusOnDocumentation",
+protocol: 'actions',
+fn: function (){
+var self=this;
+function $HLDocumentationFocusRequested(){return globals.HLDocumentationFocusRequested||(typeof HLDocumentationFocusRequested=="undefined"?nil:HLDocumentationFocusRequested)}
+return smalltalk.withContext(function($ctx1) { 
+_st(self._announcer())._announce_(_st($HLDocumentationFocusRequested())._new());
+return self}, function($ctx1) {$ctx1.fill(self,"focusOnDocumentation",{},globals.HLBrowserModel)})},
+args: [],
+source: "focusOnDocumentation\x0a\x09self announcer announce: HLDocumentationFocusRequested new",
+messageSends: ["announce:", "announcer", "new"],
+referencedClasses: ["HLDocumentationFocusRequested"]
+}),
+globals.HLBrowserModel);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "focusOnMethods",
@@ -2256,17 +2273,20 @@ fn: function (){
 var self=this;
 function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
 function $HLEditComment(){return globals.HLEditComment||(typeof HLEditComment=="undefined"?nil:HLEditComment)}
+function $HLDocumentationFocusRequested(){return globals.HLDocumentationFocusRequested||(typeof HLDocumentationFocusRequested=="undefined"?nil:HLDocumentationFocusRequested)}
 return smalltalk.withContext(function($ctx1) { 
 var $1,$2;
 $1=_st(self._model())._announcer();
 _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
 $ctx1.sendIdx["on:send:to:"]=1;
-$2=_st($1)._on_send_to_($HLEditComment(),"onEditDocumentation",self);
+_st($1)._on_send_to_($HLEditComment(),"onEditDocumentation",self);
+$ctx1.sendIdx["on:send:to:"]=2;
+$2=_st($1)._on_send_to_($HLDocumentationFocusRequested(),"onDocumentationFocusRequested",self);
 return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},globals.HLDocumentationWidget)})},
 args: [],
-source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLEditComment\x0a\x09\x09send: #onEditDocumentation\x0a\x09\x09to: self",
+source: "observeModel\x0a\x09self model announcer \x0a\x09\x09on: HLClassSelected\x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLEditComment\x0a\x09\x09send: #onEditDocumentation\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLDocumentationFocusRequested\x0a\x09\x09send: #onDocumentationFocusRequested\x0a\x09\x09to: self",
 messageSends: ["on:send:to:", "announcer", "model"],
-referencedClasses: ["HLClassSelected", "HLEditComment"]
+referencedClasses: ["HLClassSelected", "HLEditComment", "HLDocumentationFocusRequested"]
 }),
 globals.HLDocumentationWidget);
 
@@ -2332,6 +2352,22 @@ referencedClasses: []
 }),
 globals.HLDocumentationWidget);
 
+smalltalk.addMethod(
+smalltalk.method({
+selector: "onDocumentationFocusRequested",
+protocol: 'reactions',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+self._focus();
+return self}, function($ctx1) {$ctx1.fill(self,"onDocumentationFocusRequested",{},globals.HLDocumentationWidget)})},
+args: [],
+source: "onDocumentationFocusRequested\x0a\x09self focus",
+messageSends: ["focus"],
+referencedClasses: []
+}),
+globals.HLDocumentationWidget);
+
 smalltalk.addMethod(
 smalltalk.method({
 selector: "onEditDocumentation",

+ 12 - 0
src/Helios-Browser.st

@@ -263,6 +263,10 @@ focusOnClasses
 	self announcer announce: HLClassesFocusRequested new
 !
 
+focusOnDocumentation
+	self announcer announce: HLDocumentationFocusRequested new
+!
+
 focusOnMethods
 	self announcer announce: HLMethodsFocusRequested new
 !
@@ -775,6 +779,10 @@ observeModel
 		
 		on: HLEditComment
 		send: #onEditDocumentation
+		to: self;
+		
+		on: HLDocumentationFocusRequested
+		send: #onDocumentationFocusRequested
 		to: self
 !
 
@@ -817,6 +825,10 @@ onClassSelected: anAnnouncement
 	self refresh
 !
 
+onDocumentationFocusRequested
+	self focus
+!
+
 onEditDocumentation
 	self 
 		request: self model selectedClass theNonMetaClass name, ' comment'

+ 49 - 0
src/Helios-Commands-Browser.js

@@ -123,6 +123,55 @@ referencedClasses: []
 globals.HLGoToClassesCommand.klass);
 
 
+smalltalk.addClass('HLGoToDocumentationCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "execute",
+protocol: 'executing',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
+_st(self._model())._focusOnDocumentation();
+return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToDocumentationCommand)})},
+args: [],
+source: "execute\x0a\x09self model focusOnDocumentation",
+messageSends: ["focusOnDocumentation", "model"],
+referencedClasses: []
+}),
+globals.HLGoToDocumentationCommand);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "d";
+},
+args: [],
+source: "key\x0a\x09^ 'd'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGoToDocumentationCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "Documentation";
+},
+args: [],
+source: "label\x0a\x09^ 'Documentation'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLGoToDocumentationCommand.klass);
+
+
 smalltalk.addClass('HLGoToMethodsCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
 smalltalk.addMethod(
 smalltalk.method({

+ 20 - 0
src/Helios-Commands-Browser.st

@@ -49,6 +49,26 @@ label
 	^ 'Classes'
 ! !
 
+HLBrowserGoToCommand subclass: #HLGoToDocumentationCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Browser'!
+
+!HLGoToDocumentationCommand methodsFor: 'executing'!
+
+execute
+	self model focusOnDocumentation
+! !
+
+!HLGoToDocumentationCommand class methodsFor: 'accessing'!
+
+key
+	^ 'd'
+!
+
+label
+	^ 'Documentation'
+! !
+
 HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Browser'!

+ 52 - 0
src/Helios-Commands-Core.js

@@ -768,6 +768,58 @@ referencedClasses: []
 globals.HLOpenBrowserCommand.klass);
 
 
+smalltalk.addClass('HLOpenSUnitCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
+smalltalk.addMethod(
+smalltalk.method({
+selector: "execute",
+protocol: 'executing',
+fn: function (){
+var self=this;
+function $HLSUnit(){return globals.HLSUnit||(typeof HLSUnit=="undefined"?nil:HLSUnit)}
+return smalltalk.withContext(function($ctx1) { 
+var $1;
+$1=_st($HLSUnit())._openAsTab();
+return $1;
+}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLOpenSUnitCommand)})},
+args: [],
+source: "execute\x0a\x09^ HLSUnit openAsTab",
+messageSends: ["openAsTab"],
+referencedClasses: ["HLSUnit"]
+}),
+globals.HLOpenSUnitCommand);
+
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "key",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "s";
+},
+args: [],
+source: "key\x0a\x09^ 's'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLOpenSUnitCommand.klass);
+
+smalltalk.addMethod(
+smalltalk.method({
+selector: "label",
+protocol: 'accessing',
+fn: function (){
+var self=this;
+return "SUnit";
+},
+args: [],
+source: "label\x0a\x09^ 'SUnit'",
+messageSends: [],
+referencedClasses: []
+}),
+globals.HLOpenSUnitCommand.klass);
+
+
 smalltalk.addClass('HLOpenWorkspaceCommand', globals.HLOpenCommand, [], 'Helios-Commands-Core');
 smalltalk.addMethod(
 smalltalk.method({

+ 20 - 0
src/Helios-Commands-Core.st

@@ -253,6 +253,26 @@ label
 	^ 'Browser'
 ! !
 
+HLOpenCommand subclass: #HLOpenSUnitCommand
+	instanceVariableNames: ''
+	package: 'Helios-Commands-Core'!
+
+!HLOpenSUnitCommand methodsFor: 'executing'!
+
+execute
+	^ HLSUnit openAsTab
+! !
+
+!HLOpenSUnitCommand class methodsFor: 'accessing'!
+
+key
+	^ 's'
+!
+
+label
+	^ 'SUnit'
+! !
+
 HLOpenCommand subclass: #HLOpenWorkspaceCommand
 	instanceVariableNames: ''
 	package: 'Helios-Commands-Core'!