Tools__CodeView2SettingsAppl.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 29 Jan 2012 12:53:39 +0000
branchjv
changeset 12123 4bde08cebd48
parent 10902 361a19675c61
child 12125 0c49a3b13e43
permissions -rw-r--r--
trunk branched into /branches/jv

"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
"{ Package: 'stx:libtool' }"

"{ NameSpace: Tools }"

AbstractSettingsApplication subclass:#CodeView2SettingsAppl
	instanceVariableNames:'useCodeView2InTools useCodeView2InDebugger useCodeView2InBrowser
		useCodeView2InToolEnabled useCodeView2InWorkspace
		codeView2AutoIndent'
	classVariableNames:''
	poolDictionaries:''
	category:'Interface-CodeView'
!

!CodeView2SettingsAppl class methodsFor:'documentation'!

copyright
"
 COPYRIGHT (c) 2006 by eXept Software AG
              All Rights Reserved

 This software is furnished under a license and may be used
 only in accordance with the terms of that license and with the
 inclusion of the above copyright notice.   This software may not
 be provided or otherwise made available to, or used by, any
 other person.  No title to or ownership of the software is
 hereby transferred.
"
! !

!CodeView2SettingsAppl 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:Tools::CodeView2SettingsAppl andSelector:#windowSpec
     Tools::CodeView2SettingsAppl new openInterface:#windowSpec
     Tools::CodeView2SettingsAppl open
    "

    <resource: #canvas>

    ^ 
     #(FullSpec
        name: windowSpec
        window: 
       (WindowSpec
          label: 'Code Editor Settings'
          name: 'Code Editor Settings'
          min: (Point 10 10)
          bounds: (Rectangle 0 0 576 300)
        )
        component: 
       (SpecCollection
          collection: (
           (VerticalPanelViewSpec
              name: 'VBox'
              layout: (LayoutFrame 0 0 0 0 0 1 0 1)
              horizontalLayout: fit
              verticalLayout: top
              horizontalSpace: 3
              verticalSpace: 3
              component: 
             (SpecCollection
                collection: (
                 (FramedBoxSpec
                    label: 'Edit Support'
                    name: 'EditSupport'
                    labelPosition: topLeft
                    translateLabel: true
                    component: 
                   (SpecCollection
                      collection: (
                       (VerticalPanelViewSpec
                          name: 'VerticalPanel1'
                          layout: (LayoutFrame 0 0 0 0 0 1 0 1)
                          horizontalLayout: fit
                          verticalLayout: top
                          horizontalSpace: 3
                          verticalSpace: 3
                          component: 
                         (SpecCollection
                            collection: (
                             (CheckBoxSpec
                                label: 'Auto Indent'
                                name: 'CheckBox5'
                                model: codeView2AutoIndent
                                translateLabel: true
                                extent: (Point 540 22)
                              )
                             )
                           
                          )
                        )
                       )
                     
                    )
                    extent: (Point 576 59)
                  )
                 (FramedBoxSpec
                    label: 'Tool Support'
                    name: 'ToolSupport'
                    labelPosition: topLeft
                    translateLabel: true
                    component: 
                   (SpecCollection
                      collection: (
                       (VerticalPanelViewSpec
                          name: 'ToolSupportCheckBox'
                          layout: (LayoutFrame 0 0 0 0 0 1 104 0)
                          horizontalLayout: fit
                          verticalLayout: top
                          horizontalSpace: 3
                          verticalSpace: 3
                          component: 
                         (SpecCollection
                            collection: (
                             (CheckBoxSpec
                                label: 'Use Advanced Code Editor in All Tools (when supported)'
                                name: 'CheckBox1'
                                model: useCodeView2InTools
                                translateLabel: true
                                extent: (Point 540 22)
                              )
                             (DividerSpec
                                name: 'Separator1'
                                extent: (Point 540 4)
                              )
                             (CheckBoxSpec
                                label: 'Use Advanced Code Editor in Class Browser'
                                name: 'CheckBox2'
                                enableChannel: useCodeView2InToolEnabled
                                model: useCodeView2InBrowser
                                translateLabel: true
                                extent: (Point 540 22)
                              )
                             (CheckBoxSpec
                                label: 'Use Advanced Code Editor in Debugger (HIGHLY EXPERIMENTAL!!!!!!)'
                                name: 'CheckBox3'
                                enableChannel: useCodeView2InToolEnabled
                                model: useCodeView2InDebugger
                                translateLabel: true
                                extent: (Point 540 22)
                              )
                             (CheckBoxSpec
                                label: 'Use Advanced Code Editor in Workspace'
                                name: 'CheckBox4'
                                enableChannel: useCodeView2InToolEnabled
                                model: useCodeView2InWorkspace
                                translateLabel: true
                                extent: (Point 540 22)
                              )
                             )
                           
                          )
                          useDynamicPreferredHeight: true
                          usePreferredHeight: true
                        )
                       )
                     
                    )
                    extent: (Point 590 154)
                    useDynamicPreferredHeight: true
                    useDynamicPreferredWidth: true
                    usePreferredHeight: true
                    usePreferredWidth: true
                  )
                 )
               
              )
            )
           )
         
        )
      )

! !

!CodeView2SettingsAppl methodsFor:'aspects'!

codeView2AutoIndent
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    codeView2AutoIndent isNil ifTrue:[
        codeView2AutoIndent := ValueHolder new.
        codeView2AutoIndent onChangeSend:#updateModifiedChannel to:self

    ].
    ^ codeView2AutoIndent

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 07-08-2011 / 12:52:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

useCodeView2InBrowser
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    useCodeView2InBrowser isNil ifTrue:[
        useCodeView2InBrowser := ValueHolder new.
        useCodeView2InBrowser onChangeSend:#updateModifiedChannel to:self

    ].
    ^ useCodeView2InBrowser

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 26-07-2011 / 10:30:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

useCodeView2InDebugger
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    useCodeView2InDebugger isNil ifTrue:[
        useCodeView2InDebugger := ValueHolder new.
        useCodeView2InDebugger onChangeSend:#updateModifiedChannel to:self

    ].
    ^ useCodeView2InDebugger

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 26-07-2011 / 10:30:39 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

useCodeView2InTools
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    useCodeView2InTools isNil ifTrue:[
        useCodeView2InTools := ValueHolder new.
        useCodeView2InTools onChangeSend:#updateModifiedChannel to:self

    ].
    ^ useCodeView2InTools

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

useCodeView2InWorkspace
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    useCodeView2InWorkspace isNil ifTrue:[
        useCodeView2InWorkspace := ValueHolder new.
        useCodeView2InWorkspace onChangeSend:#updateModifiedChannel to:self

    ].
    ^ useCodeView2InWorkspace

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 26-07-2011 / 10:31:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CodeView2SettingsAppl methodsFor:'aspects-enablement'!

useCodeView2InToolEnabled
    "return/create the 'useCodeView2InTools' value holder (automatically generated)"

    useCodeView2InToolEnabled isNil ifTrue:[
        useCodeView2InToolEnabled := 
            (AspectAdaptor forAspect: #not) subjectChannel:
                self useCodeView2InTools


    ].
    ^ useCodeView2InToolEnabled

    "Modified: / 11-03-2010 / 10:09:04 / Jan Vrany <jan.vrany@fit.cvut.cz>"
    "Created: / 26-07-2011 / 10:39:03 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CodeView2SettingsAppl methodsFor:'protocol'!

basicAspects
    ^#( 
        #useCodeView2InTools 
        #useCodeView2InBrowser
        #useCodeView2InDebugger
        #useCodeView2InWorkspace
        "/Editing support
        #codeView2AutoIndent
    )

    "Modified: / 07-08-2011 / 12:48:11 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

basicReadSettings
    self readAspects:self basicAspects from:currentUserPrefs.

    "Modified: / 19-07-2011 / 17:11:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

basicSaveSettings

    self writeAspects:self basicAspects to:currentUserPrefs.

    "Modified: / 26-07-2011 / 10:43:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

helpFilename
    "subclasses must return the relative name of a helpFile
     in the doc/online/<language>/help directory.
     Or nil, if no help is available."

    ^ nil"for now"

    "Modified: / 19-07-2011 / 16:55:16 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CodeView2SettingsAppl methodsFor:'queries'!

hasUnsavedChanges

    (self
        hasChangedAspectIn: self basicAspects
        asComparedTo:currentUserPrefs) ifTrue:[^ true].
    ^ false.

    "Modified: / 19-07-2011 / 17:12:32 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!CodeView2SettingsAppl class methodsFor:'documentation'!

version
    ^ '$Id: Tools__CodeView2SettingsAppl.st 7810 2011-08-12 14:54:02Z vranyj1 $'
!

version_CVS
    ^ '§Header: /cvs/stx/stx/libtool/Tools__CodeView2SettingsAppl.st,v 1.3 2011/08/07 11:59:11 vrany Exp §'
!

version_SVN
    ^ '$Id: Tools__CodeView2SettingsAppl.st 7810 2011-08-12 14:54:02Z vranyj1 $'
! !