How to bind keys in dialog? - eclipse-plugin

I'm trying to build wizard dialog based on NewSourceModulePage and NewSourceModuleWizard classes (DLTK).
I don't know how to bind some key to activate textfields and other elements of dialog. In basic SourceModulePage I get two elements: "Source Folder" and "Name".
When I press ALT+d, I can change the source folder, with ALT+o I can the "Browse" button.
How can I obtain this effect for other elements?

Eclipse automatically picks up certain strings and uses these as accelerators. But not on all platforms - e.g. this is not supported on Mac OS X.
You can control the accelerators by including "&" (ampersand) on the strings for tabs in tab-folders and the lead-in labels for controls that can have focus - e.g. Text and Table.

Related

Can I customize the "New File" menu in PhpStorm?

I would like to add some other options, like "PHP Enum" or "PHP Interface" directly to this menu. Also, I would like to put PHP-related options first. It is possible tu customize this in PhpStorm? I'm using last version (2022.3.2) with the new UI enabled.
I tried using Appearance & Behaviour -> Menus & Toolbars but that didn't work for me.
Do you know that you can use the universal PHP Class entry and just change the type of the object (and therefore the file template) there? That can be done right away when typing the file or class name -- just use Arrow Up / Down keys:
(GREEN rectangle area is where that Up / Down key will work; RED rectangle shows my custom file templates)
P.S. The template for PHP Enums is also there, it just the screenshot was taken in a project with PHP 8.0 language level (need 8.1 for enums to appear).
P.P.S. The IDE will remember the last used template when you invoke this dialog again.
https://www.jetbrains.com/help/phpstorm/creating-php-classes.html
You can add new entries to this menu by creating custom File Templates at Settings/Preferences | Editor | File and Code Templates
https://www.jetbrains.com/help/phpstorm/settings-file-and-code-templates.html
Here are my test custom file templates:
And this is how they appear in that menu:
Customizing this menu (removing items, changing their order)
This is not possible at the moment. https://youtrack.jetbrains.com/issue/IDEA-143090 -- watch this ticket (star/vote/comment) to get notified with any progress.

What is MarkSelection in Eclipse, it will be used in what scenario?

I know StructuredSelection will be used when you select a file in Package Explorer for example, and TextSelection will be used when you select some text in Editor, but not clear about MarkSelection, when it will be used?
MarkSelection is generated by TextViewer (so usually a text editor) and reports a change to a 'mark' selection. It will only be sent to selection change listeners for the text viewer.
The TextViewer.setMark method causes the mark selection changed event to be generated. This only seems to be used by incremental search and for marked regions used in Emacs style editing.

Dreamweaver shortcut to swap between source and dependent files

Dreamweaver (CS 5.5) displays source code and dependent files as sub-tabs (?).
You can swap between tabs control+shift+tab, but how to swap between source and dependent files?
This issue has bothered me for a long time now, and I am pleased to say I have found a partial solution to it. There is no keyboard shortcut for switching between related (dependent) files, however there is a shortcut called "Go to Source Code", which by default is Ctrl+Alt+`.
Optional: This shortcut (and any other shortcut) can also be edited via the "Keyboard Shortcuts" menu which can be found under the "Edit" tab. To do so, from within said menu, choose the "Dreamweaver Standard" as the "Current set", and click the most left button amongst the 4 buttons at the top, called "Duplicate set". This will allow you to create a duplicate set of Shortcuts, with a name of your choice. Once that's done, you will be able to find the "Go to Source Code" shortcut by selecting "Document editing" from the "Commands" select box. This shortcut should be the second last. To change the keyboard sequence for it, click on it, insert a new "Press key", click the "Change" button and then the "OK" button to accept the changes.
As for switching to related files, this can be done via View->Related Files. This is clearly not nearly as instant as using a designated keyboard shortcut, but remember, the issue was having to use the mouse in order to switch to related files, and this method allows you to do so by using the keyboard alone (Alt+arrows).

QLineEdit/QLabel won't stay enabled when saving .ui

I have built a .ui-file in Qt Creator that includes a few different stacked containers: a Tool Box that contains QWidgets with QLabels, QLineEdits etc. in various tabs. A few of the widgets are disabled in the beginning and should only be enabled open some other action. To be able to do that by simply calling widget.setEnabled(True) all the items on the widget, that should appear enabled now, must be enabled in QT Creator, is that correct?
My problem is, that a few items on the QWidget do not stay enabled. I can check their properties checkbox for "enabled", but as soon as I navigate to a different tab in the Tool Box and then return to my QWidget, these two items are disabled again. It also doesn't save their status as enabled when I save the file.
What distinguishes the items that do stay enabled from the ones that don't is that for the ones that don't, in the properties editor, the properties "enabled" and "cursor" appear bold, whereas for the others they don't. All other properties appear to be similar and all items are children of the same QWidget.
I tried replacing them with copied versions of another similar item on the same tab, but that doesn't help.

How to automate or programmatically make changes to System Preference settings on Mac OS X

I am trying to figure out how to programmatically change System Preference settings on the Mac OS X. If that is not possible, create some post-installation automation script (using Apple Script or other means) and run it as part of the installer. I am particularly interested in making changes to the "Language & Text" settings which are part of the "personal" settings in System Preferences.
Here is more description of my problem:
I am trying to create an installer for a custom keyboard layout I wrote for Mac OS X. The keyboard layout basically allows people to transliterate ASCII keboard input to foreign letters. The foreign language does not exist on Mac OSX*. I was able to use Apple's PackageMaker to create a basic installer that dumps all the necessary files (.keylayout file, icons and the custom fonts) in their respective directories in the target computer. But there are a couple of personal settings that need to be configured in System Preferences before the keyboard layout can be selected and used. I would like to auto-configure these "one-time" settings for the user during the installation process. Is it possible to make changes to the settings using Cocoa/Objective-C. If not, I would like your help on how I can use Apple Script to automate the configuration. Please include some sample code or pointers to examples if possible. Thank you.
Here are the settings that need to be configured on System Preferences
Select System Preferences --> Language & Text -- Input Sources
Select "The Language Name" from the list
Click on "Keyboard Shortcuts" and enable "Select the previous input source" and "Select next source in Input Menu".
Double click on the shortcut combinations "⌘ space" and change them to "⌘ L" for the "Select the previous input source" and "ctrl⌘L" for "Select next source in Input Menu"
Exit systems preference. Done
NB: *The system language need not be changed. Only the input source (keyboard layout).
See NSUserDefaults. The values you want to set are probably in NSGlobalDomain.