Tools__WebBrowserPage.st
changeset 13883 bc11eb135ccd
parent 11789 c6c8e047dc5c
child 15566 184cea584be5
child 17314 f3ab8e4ed8f5
equal deleted inserted replaced
13882:212877cb97bf 13883:bc11eb135ccd
    26 "{ Package: 'stx:libtool' }"
    26 "{ Package: 'stx:libtool' }"
    27 
    27 
    28 "{ NameSpace: Tools }"
    28 "{ NameSpace: Tools }"
    29 
    29 
    30 ApplicationModel subclass:#WebBrowserPage
    30 ApplicationModel subclass:#WebBrowserPage
    31 	instanceVariableNames:'history webKitView urlHolder titleHolder bookmarkHolder
    31 	instanceVariableNames:'history webKitView urlHolder titleHolder linkHolder
    32 		toolBarVisibleHolder bookmarkBarVisibleHolder'
    32 		bookmarkHolder toolBarVisibleHolder bookmarkBarVisibleHolder'
    33 	classVariableNames:''
    33 	classVariableNames:''
    34 	poolDictionaries:''
    34 	poolDictionaries:''
    35 	category:'Interface-Browsers-Web'
    35 	category:'Interface-Browsers-Web'
    36 !
    36 !
    37 
    37 
   426     ^BookmarkList forWebBrowser
   426     ^BookmarkList forWebBrowser
   427 
   427 
   428     "Created: / 08-06-2011 / 12:16:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   428     "Created: / 08-06-2011 / 12:16:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   429 !
   429 !
   430 
   430 
       
   431 linkHolder
       
   432     "return/create the 'linkHolder' value holder (automatically generated)"
       
   433 
       
   434     linkHolder isNil ifTrue:[
       
   435         linkHolder := ValueHolder new.
       
   436         linkHolder addDependent:self.
       
   437     ].
       
   438     ^ linkHolder
       
   439 !
       
   440 
       
   441 linkHolder:something
       
   442     "set the 'linkHolder' value holder (automatically generated)"
       
   443 
       
   444     |oldValue newValue|
       
   445 
       
   446     linkHolder notNil ifTrue:[
       
   447         oldValue := linkHolder value.
       
   448         linkHolder removeDependent:self.
       
   449     ].
       
   450     linkHolder := something.
       
   451     linkHolder notNil ifTrue:[
       
   452         linkHolder addDependent:self.
       
   453     ].
       
   454     newValue := linkHolder value.
       
   455     oldValue ~~ newValue ifTrue:[
       
   456         self update:#value with:newValue from:linkHolder.
       
   457     ].
       
   458 !
       
   459 
   431 titleHolder
   460 titleHolder
   432     "return/create the 'titleHolder' value holder (automatically generated)"
   461     "return/create the 'titleHolder' value holder (automatically generated)"
   433 
   462 
   434     titleHolder isNil ifTrue:[
   463     titleHolder isNil ifTrue:[
   435         titleHolder := ValueHolder new.
   464         titleHolder := ValueHolder new.
   529 
   558 
   530     webKitView isNil ifTrue:[
   559     webKitView isNil ifTrue:[
   531         webKitView := WebKitView new
   560         webKitView := WebKitView new
   532                         url: self urlHolder;
   561                         url: self urlHolder;
   533                         title: self titleHolder;
   562                         title: self titleHolder;
       
   563                         link: self linkHolder;
   534             
   564             
   535                         yourself.
   565                         yourself.
   536     ].
   566     ].
   537     ^webKitView.
   567     ^webKitView.
   538 
   568 
   539     "Created: / 07-06-2011 / 22:50:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   569     "Created: / 07-06-2011 / 22:50:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   540     "Modified: / 08-06-2011 / 14:26:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   541     "Modified: / 18-11-2011 / 15:04:27 / cg"
   570     "Modified: / 18-11-2011 / 15:04:27 / cg"
       
   571     "Modified: / 30-05-2012 / 18:28:27 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   542 ! !
   572 ! !
   543 
   573 
   544 !WebBrowserPage methodsFor:'aspects-queries'!
   574 !WebBrowserPage methodsFor:'aspects-queries'!
   545 
   575 
   546 canGoBackAspect
   576 canGoBackAspect
   575 
   605 
   576     changedObject == urlHolder ifTrue:[
   606     changedObject == urlHolder ifTrue:[
   577          self updateBookmark.
   607          self updateBookmark.
   578          ^ self.
   608          ^ self.
   579     ].
   609     ].
   580     changedObject == titleHolder ifTrue:[
   610 
   581          self updateBookmark.
       
   582          ^ self.
       
   583     ].
       
   584     changedObject == toolBarVisibleHolder ifTrue:[
   611     changedObject == toolBarVisibleHolder ifTrue:[
   585          self updateToollBarAndBookmarkBarVisibility.
   612          self updateToollBarAndBookmarkBarVisibility.
   586          ^ self.
   613          ^ self.
   587     ].
   614     ].
       
   615 
       
   616     changedObject == linkHolder ifTrue:[
       
   617          self updateLink.
       
   618          ^ self.
       
   619     ].
       
   620 
   588     changedObject == bookmarkBarVisibleHolder ifTrue:[
   621     changedObject == bookmarkBarVisibleHolder ifTrue:[
   589          self updateToollBarAndBookmarkBarVisibility.
   622          self updateToollBarAndBookmarkBarVisibility.
   590          ^ self.
   623          ^ self.
   591     ].
   624     ].
   592 
   625 
   593     
   626     
   594 
   627 
   595     super update:something with:aParameter from:changedObject
   628     super update:something with:aParameter from:changedObject
   596 
   629 
   597     "Modified: / 10-06-2011 / 23:53:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   630     "Modified: / 30-05-2012 / 18:28:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   598 !
   631 !
   599 
   632 
   600 updateBookmark
   633 updateBookmark
   601 
   634 
   602     | url title bookmark |
   635     | url title bookmark |
   610         history goTo: self bookmarkHolder value
   643         history goTo: self bookmarkHolder value
   611     ]
   644     ]
   612 
   645 
   613     "Created: / 08-06-2011 / 12:19:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   646     "Created: / 08-06-2011 / 12:19:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   614     "Modified: / 08-06-2011 / 14:55:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   647     "Modified: / 08-06-2011 / 14:55:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
       
   648 !
       
   649 
       
   650 updateLink
       
   651 
       
   652     (masterApplication notNil and:[masterApplication respondsTo: #infoLabelHolder]) ifTrue:[
       
   653         masterApplication infoLabelHolder value: (self linkHolder value ? '')
       
   654 
       
   655     ]
       
   656 
       
   657     "Created: / 30-05-2012 / 18:28:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
   615 !
   658 !
   616 
   659 
   617 updateToollBarAndBookmarkBarVisibility
   660 updateToollBarAndBookmarkBarVisibility
   618     |toolBarVisible toolBar bookmarkBarVisible bookmarkBar pageContent topOffset h|
   661     |toolBarVisible toolBar bookmarkBarVisible bookmarkBar pageContent topOffset h|
   619 
   662 
   742 ! !
   785 ! !
   743 
   786 
   744 !WebBrowserPage class methodsFor:'documentation'!
   787 !WebBrowserPage class methodsFor:'documentation'!
   745 
   788 
   746 version
   789 version
   747     ^ '$Header: /cvs/stx/stx/libtool/Tools__WebBrowserPage.st,v 1.8 2012-09-09 19:02:51 cg Exp $'
   790     ^ '$Header: /cvs/stx/stx/libtool/Tools__WebBrowserPage.st,v 1.9 2014-02-05 19:09:12 cg Exp $'
   748 !
   791 !
   749 
   792 
   750 version_CVS
   793 version_CVS
   751     ^ '$Header: /cvs/stx/stx/libtool/Tools__WebBrowserPage.st,v 1.8 2012-09-09 19:02:51 cg Exp $'
   794     ^ '$Header: /cvs/stx/stx/libtool/Tools__WebBrowserPage.st,v 1.9 2014-02-05 19:09:12 cg Exp $'
   752 !
   795 !
   753 
   796 
   754 version_SVN
   797 version_SVN
   755     ^ '§Id§'
   798     ^ '$Id: Tools__WebBrowserPage.st,v 1.9 2014-02-05 19:09:12 cg Exp $'
   756 ! !
   799 ! !
       
   800