Read Preferences from plug-in

arjomil

Member
How can I read user preferences from plug-in?

plugindoc.pdf say:

IDE_GetPersonalPrefSets
"Returns a list of all personal preference sets.
If you to have the Plug-In to use different preferences depending on the current connection, you can use this function to build a list of possible preference sets."

This function in my plug-in only returns: "Default r-garcia"

What's the meaning of "PrefSet" parameter in "IDE_GetPrefAs.." functions?

Thaks
 
This function returns the (list of) preference sets you have defined. You can use this in other functions as IDE_GetPrefAsString() which has a PrefSet parameter. (This can also be an empty string).

The GetPrefAs functions return values as defined in the preferences dialog.
 
Hi, Marco
I don't understand you. Can you explain it in an example?
How can I read the Syntax Highlighting preferences?
 
Last edited:
Apologies, I made a mistake, the GetPrefAs functions don't return values from the preferences dialog, but values you can define with the SetPrefAs functions. This allows you to store preferences in the same place as PL/SQL Developer does. You can also use the registry or a file of course.

For reading general preferences (as defined in the preferences dialog) you need the IDE_GetGeneralPref function. There is only a single parameter, the name of the preference. In your case, you need the following:

KeywordsEnabled=True
KeywordsBold=True
KeywordsItalic=False
KeywordsColor=8388608
KeywordsBkg=-16777211
CommentEnabled=True
CommentBold=False
CommentItalic=True
CommentColor=255
CommentBkg=-16777211
StringsEnabled=True
StringsBold=False
StringsItalic=False
StringsColor=13209
StringsBkg=-16777211
NumbersEnabled=True
NumbersBold=False
NumbersItalic=False
NumbersColor=16711680
NumbersBkg=-16777211
SymbolsEnabled=True
SymbolsBold=False
SymbolsItalic=False
SymbolsColor=8388608
SymbolsBkg=-16777211
CustomEnabled=True
CustomBold=True
CustomItalic=False
CustomColor=-16777214
CustomBkg=-16777211

The values in the above case are just an example.

Does this help?

 
Back
Top