SWT DirectoryDialog - get last selected folder - eclipse-plugin

I'm using the org.eclipse.swt.widgets.DirectoryDialog for folder selection. I'm not setting the filter path and I notice the the dialog somehow remembers the last selection. When I select a folder, and then reopen the dialog - it points to the last selected folder.
My question is - can I get this "remembered" last selected folder somehow in SWT or plain Java?
Thanks!
Dinko

No there is nothing for this.
DirectoryDialog is just a thin wrapper around the native open directory dialog. It is the native dialog that is remembering (if it does, this may vary on different platforms).
Looking at the macOS version of DirectoryDialog there is nothing in the Java code that knows about the previous selection.

Related

How to copy search results in IntelliJ to paste them elsewhere?

I would like to remember my team the ports used for debugging, for several projects.
A Ctrl-F in a directory, and I have my results under IntelliJ_2021.1.3 Ultimate I'm using,
but I have no way to paste them, like they are on this window, either with Ctrl-C or Ctrl-Ins , on another location in order to send a mail to my teammates.
Does a workaround exist, or has this feature been implemented in a later version I should try to upgrade to?
I don't think there is a simple and direct way to do what you want. However, there is a workaround:
Run your search, and then from the Find in Files window click the Open in Find Window button:
Right-click anywhere within that Find window listing the occurrences, then select Export to Text File from the context menu:
An Export Preview window will open, showing the search results in expanded hierarchical form, reflecting the structure under the directory you searched. Within that window you can select any contiguous portion of text, then right click and select Copy from the context menu:
You can then paste the selected text into any other window, and massage the results as necessary:
Notes:
This is only a workaround because unfortunately I don't see a way to directly copy the results in your screen shot, in which each line shows a both a search occurrence and its file location. That information is still in the copied text, but it may take a bit of effort to get it in the form you want.
The Copy button in the Export Preview window ignores any text selection and blindly copies everything, so use Copy from the context menu instead if selecting a subset of the text.
I used IntelliJ IDEA 2023.1 EAP (Ultimate Edition). I don't know whether this functionality exists in your version.

How do I open a file with a specific application rather than its default application?

I am trying to open files using a specified executable; just like as if you were to right mouse click on a file then scroll to "Open with"
I tried what kaymaf said and reviewed the docs, but I cannot seem to get this to work.
Dim FI As New FileInfo(GetFileNameFromListViewItem(ListViewCollection.SelectedItems(0)))
Dim GetExif As Process = System.Diagnostics.Process.Start("C:\Users\*username*\Downloads\exiftool.exe", FI.FullName)
This just ends up open the executable and rather than opening the file with the executable.
You would like to open a file with your program using the Windows context menu; and do you want to get an entry in that menu? If that is not correct, the answer can be deleted.
I found this in a German forum, and they refer to this site:
This is the translated text:
One possibility would be that you register your file extension and your program in the system to open this file extension. As soon as the system knows everything, you only need to right-click on the file(s) and in the context menu, in addition to the standard entries, another menu item for opening these files is displayed. If you select this menu item, your program will start automatically if it has not yet started, and you can read out / determine the path to this file or several files in your program and process it accordingly. How it all works is described here: ookii.org/Blog/opening_files_via_idroptarget_in_net
On this page there is also a sample for download (start text files with your own program via an additional entry in the context menu / display paths to the files). It is not a VB, but it should be translatable without any problems. Corresponding information on the page and the comments should be observed.

Outlook VBA: Reset Folder Icon

I've got a vbs module for Outlook 2010 that changes selected folder icons using Folder.SetCustomIcon:
Set folder = GetFolder(FolderPath)
Set myPic = LoadPicture(m_IconPath + FolderColour + ".ico")
If Not (folder Is Nothing) Then
folder.SetCustomIcon myPic
It auto-runs on startup, but occasionally, when I change the icons/folders affected, I run the script manually. However this only sets the folder icons for the new/updated folders. I'd also like it to change the icons for other folders back to the default.
It would be useful to either reset selected folders, or ideally just reset all folder icons prior to running my new customisations, but I can't see any obvious way to do this.
I expect I could identify a folder that never has its folder icon changed, and use Folder.GetCustomIcon to copy the standard icon across - assuming that this will actually return the standard icon; it may only work if the icon has indeed been customised - but either way, it seems inelegant. I'm expect there is a more direct method.
Any suggestions?

How to enable longer file path in IntelliJ's find in path preview panel

Using 'Find in Path' in intelliJ we can preview search results easily by looking into files found. Is it possible to make upper panel (one that displays files found) show longer(deeper) source path.
Currently it shows
parentFolder\fileFound
or
parentsParentFolder\[..]\fileFound
if intelliJ find parentFolder to be a common name.
I want to make preview panel showed me file source up to n-th level like
n-thParentFolder\n-1-thParentFolder\...\parentFolder\fileFound
Is it possible?
EDIT: providing screenshot for better understanding
Looking into screenshot provided, I cannot tell the difference between 1st-4th row and 3th-6th row.
That's not currently possible: https://youtrack.jetbrains.com/issue/IDEA-174542 -- watch this ticket (star/vote/comment) to get notified of any progress.

Force item icon refresh in Finder 10.8.2

Can anyone lead me to any useful link for forcing file icon refresh in new 10.8.2 version of Finder?
I'm working on this problem for last few days and I have tried almost any solution which can
be found on internet, but those are all old samples which are compatible with old versions of Finder and do not work on newer versions of Finder (which are rebuilt on Cocoa framework).
I tried to use few commands from apple script tool to update files in Finder ('update item with necessity'), I tried few plugins from internet (nudge, finder-Refresh...), I also tried support for communication with external Mac application through ScriptingBridge framework (although very useful) but nothing gave me a desired result.
I have noticed that NSWorkspace class contains two methods: iconForFile and setIcon:forFile,
and although I could integrate this two functions in application, iconForFile function is returning image of reduced quality, so I'm stuck in that direction also.
Any idea or suggestion will be highly appreciated.
If you need to update one Application icon, just touch the App.app folder.
Close the finder windows and issue the command:
touch /Applications/App.app
Create a visible file and delete it. This will refresh finder window.
To reset for every application under Mountain Lion, try the following in Terminal:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -kill -seed -r
That will kill all existing objects in launch services and reseed them recursively from the standard locations (/Applications, etc).
If you have a specific application whose data you need to override existing information, you can try:
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -f <path>
Although I've had limited luck with the latter working in some cases, so you may end up doing the former afterwards.
Type into Terminal
killall Finder
Then
killall Dock
I had this problem too. I had a .app i wanted to change the icon of.
Structure of my .app:
...noida.app/
...noida.app/Contents/
...
...noida.app/Contents/Resources
...noida.app/Contents/Resources/myicon.icns
...noida.app/Contents/MacOS
...
...noida.app/Contents/plist.Info
Now I would change the icon in the resources folder. Then I made new files in all folders. It wouldn't work. The only place that i could make a new file tha twould update the icon was in the ...noida.app/ so i made new file at ...noida.app/junk folder and then it updated.
Very interesting.
I was just fighting with this on 10.10 (although it's been a problem for years now) and the only solution I found to force refreshing a bundles icon in the Finder was to:
Open the "Get Info Window" of the bundle you want to update and select the icon by clicking on it.
Paste another image as the icon (you could have copied this from another file or from any other location with this pasteboard data).
Press return and make sure the icon changed in the Finder.
Delete the icon by pressing the delete key.
After that the bundles icon was refreshed to the new .icns file in the bundles resource folder.