eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'SettingsDialog':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: SettingsDialog


Inheritance:

   Object
   |
   +--Model
      |
      +--ApplicationModel
         |
         +--SettingsDialog

Package:
stx:libtool
Category:
Interface-Smalltalk
Version:
rev: 1.199 date: 2023/09/07 21:11:23
user: stefan
file: SettingsDialog.st directory: libtool
module: stx stc-classLibrary: libtool

Description:


This is an application which presents a hierarchy of settings applications.
It is used (among others) in the launcher's and filebrowser's settings-dialogs.

However, it is rather generic and can be setup for any application's setting dialog.
The actual contents (i.e. the organization tree and tab contents) is provided
by a spec-array (the settingsList).
You will find a default settings list here, but in theory, applications may provide
their own one, or modify a copy of that list for specialized settings dialogs.
See class >> examples, #defaultSettingsApplicationList
and AbstractLauncherApplication >> settingsList for more info.

copyright

COPYRIGHT (c) 2002 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.

Class protocol:

accessing
o  itemClass

application icons
o  defaultSettingsAppIcon

o  settingsFolderIcon
This resource specification was automatically generated
by the ImageEditor of ST/X.

o  settingsIcon

o  settingsIcon2
This resource specification was automatically generated
by the ImageEditor of ST/X.

Usage example(s):

     self settingsIcon2 inspect
     ImageEditor openOnClass:self andSelector:#settingsIcon2
     Icon flushCachedIcons

o  wheelIcon
This resource specification was automatically generated
by the ImageEditor of ST/X.

Usage example(s):

     self wheelIcon inspect
     ImageEditor openOnClass:self andSelector:#wheelIcon
     Icon flushCachedIcons

default settingslist
o  defaultSettingsApplicationList
unless the settingsDialog is opened with an explicit settings list,
this one is used (it is also the one used by the ST/X IDE

defaults
o  autoSaveChangedSettingsOnClose

o  autoSaveChangedSettingsOnClose: aBoolean

o  defaultIcon
(comment from inherited method)
default is: no icon (should be redefined by concrete class if an icon is wanted).

o  expandParents

o  resourcePackName
return the name which is used as the fileNameBase of my resource file.
Here, use the same resources as the Launcher

help specs
o  helpSpec
This resource specification was automatically generated
by the UIHelpTool of ST/X.

initialization
o  initialize
(comment from inherited method)
ApplicationModel initialize

interface specs
o  windowSpec
This resource specification was automatically generated
by the UIPainter of ST/X.

Usage example(s):

     UIPainter new openOnClass:SettingsDialog andSelector:#windowSpec
     SettingsDialog new openInterface:#windowSpec
     SettingsDialog open

menu actions
o  askForFileAndSaveSettings
not canceled

o  currentSettingsFilename

o  saveSettingsAsDefaultSettings

o  saveSettingsTo: file

o  saveSettingsWithoutAskingForFile

menu specs
o  mainMenu
This resource specification was automatically generated
by the MenuEditor of ST/X.

Usage example(s):

     MenuEditor new openOnClass:SettingsDialog andSelector:#mainMenu
     (Menu new fromLiteralArrayEncoding:(SettingsDialog mainMenu)) startUp

startup
o  openWithList: settingsList label: label

o  openWithList: settingsList label: label initialSettingsClass: settingsClassToSelectOrNil
given a list of page-label/class pairs,
open a settings dialog showing that set of items.

Usage example(s):

     |list|

     list := #(          
                #('Tools/Compiler'                      #'AbstractSettingsApplication::GeneralCompilerSettingsAppl'     )
                #('Tools/Compiler/ByteCode'             #'AbstractSettingsApplication::ByteCodeCompilerSettingsAppl'    )
                #('Tools/Compiler/STC'                  #'AbstractSettingsApplication::STCCompilerSettingsAppl'         )
            ).
     self
        openWithList:list
        label:(i'Compiler Settings')
        initialSettingsClass:AbstractSettingsApplication::ByteCodeCompilerSettingsAppl 


Instance protocol:

accessing
o  requestor
return the 'requestor' of the SettingsDialog

o  requestor: something

o  rootItem

o  rootItemLabel

o  rootItemLabel: aString

o  selectedItemsName

o  showRoot: aBoolean

o  subCanvasApplication

actions
o  changeLabelTo: aLabel application: aApplication

o  destroyAll

o  doIndicatorClick: index
handle a click on the indicator

o  doReload
discard button was pressed

o  doSave
accept button was pressed

o  expandItemForApplication: aApplication

o  help

o  reopenLauncher
force the launcher to reopen an instance of itself.
Done whenever relevant look&feel settings are changed
(actually a workaround - a much better solution would be to teach
all smalltalk applications/views to dynamically update their style).

o  sendLoadRequestToAll
ask all subApps to reload their idea of the current settings.
Do this, after userPrefs have been loaded from a file,
while a settingsDialog is open

o  sendSaveRequestToAll
give all subapps a chance to apply any changes.
No longer needed, as we do this at the time the subApp
is changed; so only the current app needs this chance again,
when about to close (seesendSaveRequestToCurrent)

o  sendSaveRequestToCurrent
when about to close the dialog, give the current
subapp a chance to apply any changes

application list access
o  addApplClass: aClassName forApplication: anApplication label: aLabel expand: aBoolean
add an application to the settingsTree, take the icon from the application classes defaultIcon method

o  addApplClass: aClass withName: aName
add an application to the settingsTree, take the icon from the application classes defaultIcon method

o  addApplClass: aClass withName: aName expand: aBoolean
add an application to the settingsTree, take the icon from the application classes defaultIcon method

o  addApplClass: aClass withName: aName icon: icon

o  addApplClass: aClassName withName: aName icon: icon expand: doExpand
(self applicationNames includes:aName) ifTrue:[

o  addIcon: aIcon forCategory: aCategoryName
add a new category Icon for a category

o  applicationNames

o  categoryIcons

o  childrenApplicationItemFor: aApplication fromItem: anItem

o  getAllChildrenAppsForApplication: aApplication

o  getAllChildrenAppsForApplication: aApplication childrenClass: aClass

o  getAllChildrenAppsForApplication: aApplication matchBlock: aMatchBlock

o  getAllChildrenByApplication: aApplication

o  getApplicationsByClass: aClass

o  getItemByApplication: anApplication

o  getNameOfApplication: aApplication

o  installSettingsEntries: aCollection

o  installSettingsEntries: entries expand: expand
Installs given settings list. If expand is true,
dynamic settings list is expanded

o  installSettingsEntry: entry

o  installSettingsEntry: entry expand: expand
a directory entry

o  parentApplicationFor: aApplication

o  remApplClassByName: aName
remove an application from the settingsTree

o  removeAllApplicationsByClass: aClass

o  removeAllSubApplicationsFor: aApp

o  removeApplicationByClass: aClass

o  removeApplicationFromTree: aApplication

o  removeByApplication: aApplication

o  sortSubApplicationsFor: anApplication

application list access-private
o  addCategoriesFor: aName
create all the categories

o  createItemForApplication: anApplication class: aClass label: aLabel icon: anIcon expandParent: expandParent replaceExisting: doReplaceExisting
create an application item in my application list

o  createItemName: aNameString label: aLabel class: aClass icon: anIcon

o  createItemName: aNameString label: aLabel class: aClass icon: anIcon expandParent: expandParent

o  createItemName: aNameString label: untranslatedLabel class: aClass icon: anIcon expandParent: expandParent replaceExisting: doReplaceExisting
create an application item in my application list

o  createItemName: aNameString label: aLabel icon: anIcon
create an application item in my application list

o  createItemName: aNameString label: aLabel icon: anIcon replaceExisting: doReplaceExisting
create an application item in my application list

o  getItemForName: aName

o  realApplications
return a collection of all real (non-folder) applications.
A helper to avoid code duplication

o  realApplicationsDo: aBlock
evaluate aBlock for all real (non-folder) applications.
A helper to avoid code duplication

o  removeItem: anItem
remove an application from the settingsTree

o  treeName: aName butLast: last do: aBlock

o  treeName: aName do: aBlock

aspects
o  applicationList

o  closeButtonVisibleHolder

o  enableHelp

o  enableOK

o  enableReload

o  loadAndSaveSettingsItemVisible
for now, only show these if I have a requestor
(i.e. I am a full settings Dialog as opposed to a DebugView, FileBrowser or other
settingsDialog. I think this has to be reworked...

Usage example(s):

loadAndSaveSettingsItemVisible

o  quickSearchFieldShownHolder
when the search box is opened, warp the focus into the field

o  quickSearchStringHolder

o  selectedItem

o  showNonDefaultSettingsHolder

o  showNonDefaultSettingsMenuItemVisibleHolder

o  subCanvasApplicationHolder

o  whyDisabledInfoHolder

change & update
o  modifiedChanged

o  quickSearchStringHolderChanged
the text in the quick search entry field has changed.
remember the current selection,
update the highlighting of matching fields (and expand corresponding tree nodes),
then reselect (because the treeView is too stupid in loosing the selection,
when expanding/hiding)

o  selectionChanged
settings selection has changed;
first send the previous application a saveRequest;
then construct the new selected application (if not yet done before),
and set it in the right subcanvas

o  update: something with: aParameter from: changedObject
(comment from inherited method)
dependent is notified of some change -
Default is to try update:with:

changed settings highlighting
o  highlightWidgetsWithChangedSettings
whenever an app is selected AND a quick search string is present,
go through the widgets and highlight those which match.
This is done by looking at the helpkey and model aspects for a match

o  showNonDefaultSettingsHolderChanged
the show-non-default settings check box has changed.
remember the current selection,
update the highlighting of matching fields (and expand corresponding tree nodes),
then reselect (because the treeView is too stupid in loosing the selection,
when expanding/hiding)

o  widgetsWithChangedSettingsIn: anApplication
helper:
go through the widgets and find those which have a value different
from the default settings.
This is done by looking at model value (hope they have)

initialization & release
o  closeRequest
This is a hook method.
It will be invoked when your app/dialog-window is about to be closed.
This method has a chance to suppress the close by returning false.
See also #closeDownViews, which is invoked when the close is really done.

o  createRootItem
this is stupidly wrong!

o  initialize
false

o  postBuildSubCanvas: aWidget

o  postBuildWith: aBuilder
(comment from inherited method)
this is sent after an interface is built from a spec,
but only iff the appModel is not the same as the topView's app
(i.e. if it is not a build for the same appModel again).
In the other case, postBuildAsSubcanvasWith is invoked.
Can be redefined in subclasses for additional setup after
the view has been built, but not yet opened.

o  postOpenWith: aBuilder
if there is only one child, select it initially

menu actions
o  askForFileAndSaveSettings

o  loadSettingsFromFile
restore settings from a settings-file.

o  menuCollapseAll

o  menuExpandAll

o  saveSettingsWithoutAskingForFile

opening
o  reopenAfterChangedViewStyleSetting
open the dialog. Take care to redefine some superclass behavior

quick search support
o  getWordMatchPattern
pattern is needed at multiple places

o  getWordMatchPatterns
patterns are needed at multiple places

o  highlightApplicationsForWhich: aBlock
common code for string search and changed-settings search.
Enumerates all applications with aBlock;
if it return true, it will be collectet and highlighted.

o  highlightWidgets: aSetOfWidget
highlight a matching widget

o  highlightWidgetsWithMatchingSearchString
whenever an app is selected AND a quick search string is present,
go through the widgets and highlight those which match.
This is done by looking at the helpkey and model aspects for a match

o  unhighlightFoundItemsFromSearch
undo any highlighting of matching fields (from the previous show matching items)

o  unhighlightWidgets
unhighlight all previously highligted widgets
(restore their previous attributes)

o  widgetsWithMatchingSearchStringIn: anApplication
helper:
go through the widgets and find those which match.
This is done by looking at the helpkey and model aspects for a match

selection
o  selectItem: anEntryInTheSettingsList

o  selectItemWithClass: aClass
select an item based on the sub-settings application class

o  selectItemWithName: aPathString
select an item based on the sub-settings page name.
See standardRawSettingsList for a list of names


Private classes:

    HierarchicalApplicationList
    SettingsFilenameAppl

Examples:


start a Settings Dialog with a language Settings Application under root
  | settingsApp |

  settingsApp := self new.
  settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
              withName:'Language'.
  settingsApp open.
start a Settings Dialog with a language Settings Application under root/Test
  | settingsApp |

  settingsApp := self new.
  settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
              withName:'Test/Language'.
  settingsApp open.
start a Settings Dialog with a language Settings Application under root/Test with an other category test icon
  | settingsApp |

  settingsApp := self new.
  settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
              withName:'Test/Language'.
  settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
  settingsApp open.
start a Settings Dialog with a language and memory Settings Application in different categories
  | settingsApp |

  settingsApp := self new.
  settingsApp addIcon:ToolbarIconLibrary start22x22Icon forCategory:'Test'.
  settingsApp addApplClass:#'AbstractSettingsApplication::LanguageSettingsAppl' 
              withName:'Test/Language'.
  settingsApp addApplClass:#'AbstractSettingsApplication::MemorySettingsAppl' 
              withName:'Test2/Memory'.
  settingsApp open.


ST/X 7.7.0.0; WebServer 1.702 at 20f6060372b9.unknown:8081; Mon, 18 Nov 2024 04:37:01 GMT