updateProfile 指令

請利用 updateProfile 指令來更新現行文件視圖的設定檔。

語法

updateProfile [ all ]

參數

all 使用選用參數 all 來指出您要更新所有目前已開啟的文件視圖設定檔。請注意,如果從未對文件視圖發出過 updateProfile,則發出 updateProfile all 不會影響文件視圖。

狀態

status 參數不會受到這個指令的影響。

說明

updateProfile 指令通常是在建立文件視圖時發出,但也可以隨時發出它,讓文件視圖反應設定檔的變更。

下列是對文件視圖發出 updateProfile 指令時發生的事件順序:

  1. readonly 參數設定為 off
  2. 設定 includedClasses 參數以併入所有類別。
  3. 設定 excludedClasses 參數以免排除任何類別。
  4. 所有登錄的 classes 會取消登錄。
  5. styleAttributes 參數設定的樣式字元會被清除。
  6. popup 參數會重設為 default
  7. expandTabs 參數會重設為 default
  8. fields 參數會重設,以致沒有編輯欄位。
  9. tabs 參數會重設為 default
  10. 基本設定檔會設定為 current.updateProfile.baseProfile 傳回的值。
  11. 如果基本設定檔是 ispfseuxedit,則:
    • prefixArea 設定為 on
    • prefixProtect 設為 off
    否則:
    • prefixArea 重設為 default
    • prefixProtect 設定為 on
    • 顯示任何被先前基本設定檔中的字首指令所排除的字行
  12. 如果基本設定檔是 vi,則:
    • commandLine 設定為 off
    • autoCheck 設定為 off
    否則:
    • commandLine 重設為 default
    • autoCheck 設定為 on
  13. 這個視圖的所有 show 元素都將遭到刪除。
  14. 所有文件元素的現行視圖之 style 參數將會重設。
  15. 所有文件元素的現行視圖之 elementClasses 參數將會重設。
  16. 調色盤會設定為 current.updateProfile.palette 傳回的值。
  17. 內建樣式是根據 current.updateProfile.paletteAttributes style.palette 傳回的值所指派的樣式屬性,其中 style 會隨每一個內建樣式而更換,palettepalette 參數傳回的值。請參閱 styleAttributes 參數,取得有關內建樣式的資訊。
  18. 所有 keys 設定值會被清除。
  19. 所有 mouseEvents 設定值會被清除。
  20. 所有 actions 設定值會被清除。
  21. 會設定以 baseProfile 為基礎的新 keys 設定值。
  22. 會設定以 baseProfile 為基礎的新 mouseEvents 設定值。
  23. 會設定以 current.updateProfile.userActions 為基礎的新 actions 設定值。
  24. 會設定以 current.updateProfile.userKeyActions 為基礎的其他 keys 設定值。
  25. 會設定以 current.updateProfile.userMouseActions 為基礎的其他 mouseEvents 設定值。
  26. 所有 commands 設定值會被清除。
  27. 會設定以 current.updateProfile.userCommands 為基礎的新 commands 設定值。
  28. 會從 current.updateProfile.userProfile 發出使用者設定檔。
  29. 如果現行視圖是剖析器, 則會發出 LpexParser 介面的 resetParser 方法,並捨棄剖析器。
  30. 剖析擱置清單會被清除。
  31. 如果 current.updateProfile.noParser 設為 off, 則從 current.updateProfile.parser 擷取新的剖析器名稱。
  32. 如果剖析器名稱是 associated, 則從 current.updateProfile.parserAssociation.extension 參數擷取剖析器名稱。
  33. 剖析器類別擷取自 current.updateProfile.parserClass.parserName
  34. 會建立剖析器的實例。
  35. 會發出 LpexParser 介面的 totalParse 方法。
  36. 如果文件有 name,就會查詢基礎檔案的唯讀屬性。 如果檔案是唯讀的,這個文件視圖的 readonly 參數會設為 on
  37. 如果有任何 LpexViewListener 物件正在監聽這個視圖, 則會發出 updateProfile 方法。

在變更了一或多個 updateProfile 參數之後,必須發出 updateProfile 指令,才能將變更內容反映在任何作用中的文件視圖中。

請注意,如果您正在建構自己的 LpexView 物件,且您新增動作、指令、按鍵設定或滑鼠事件設定來自訂它, 除非您在 LpexViewListenerupdateProfile 方法內執行這項自訂,否則,updateProfile 指令會除去這些設定值。

範例

updateProfile all 
下列順序會將現行文件視圖的基本設定檔變更為 xedit
set updateProfile.baseProfile xedit
updateProfile 

相關概念
編輯器指令、動作和參數

相關參照
load 指令
parse 指令
actionClass 參數
actions 參數
autoCheck 參數
baseProfile 參數
class 參數
classes 參數
commandClass 參數
commandLine 參數
commands 參數
elementClasses 參數
expandTabs 參數
fields 參數
keyAction 參數
keys 參數
mouseAction 參數
mouseEvents 參數
name 參數
palette 參數
parser 參數
popup 參數
prefixArea 參數
prefixAreaText 參數
prefixProtect 參數
readonly 參數
show 參數
style 參數
styleAttributes 參數
tabs 參數
setParser 動作
預設編輯器指令

updateProfile.baseProfile 參數
updateProfile.extensions 參數
updateProfile.noParser 參數
updateProfile.palette 參數
updateProfile.paletteAttributes 參數
updateProfile.palettes 參數
updateProfile.parser 參數
updateProfile.parserAssociation 參數
updateProfile.parserClass 參數
updateProfile.parsers 參數
updateProfile.userActions 參數
updateProfile.userCommands 參數
updateProfile.userKeyActions 參數
updateProfile.userMouseActions 參數
updateProfile.userProfile 參數