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.166 date: 2018/05/03 09:28:53
user: cg
file: SettingsDialog.st directory: libtool
module: stx stc-classLibrary: libtool
Author:
Christian Penk, eXept Software AG

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.


Related information:

    AbstractLauncherApplication
    defaultSettingsApplicationList

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

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

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
JV@2012-02-07: Changed to save preferences back to file from which
they have been loaded (if known). If no such file is known,
save to DEFAULT USER SETTINGS file (default ~/.smalltalk/settings.rc)

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.


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

o  quickSearchStringHolder

o  selectedItem

o  showNonDefaultSettingsHolder

o  showNonDefaultSettingsMenuItemVisibleHolder

o  subCanvasApplicationHolder

o  whyDisabledInfoHolder

change & update
o  modifiedChanged

o  selectionChanged
hide the DisabledSettingsBox

o  update: something with: aParameter from: changedObject

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

o  postOpenWith: aBuilder
(comment from inherited method)
this is sent after the application's main window is opened.
Can be redefined in subclasses for actions after opening the view.

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  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  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  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  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.1.0.0; WebServer 1.663 at exept.de:8081; Sat, 23 Mar 2019 08:27:56 GMT