handling events in Package explorer Eclipse - eclipse-plugin

I want to stop user from modifying selected file in the package explorer while my plugin is running.
A custom message should popup if the user tries to change the file.

Implement your own editor launcher (IEditorLauncher), which would show this message and associate it with the files you don't want to be modified.
See an example in this SO question.
Another possible approach is to simply now show these files in Package explorer (similary to hiding .class files by Java plugin).

Related

View file in project view Intellij

I have started using Intellij and I am trying to find a feature that was in eclipse. I often navigate to a file either through the code or through a CTRL-N search. When I have the file I found open, I want to see which project and which folder of the project the file is in. I found a way to open the file in Windows Explorer which tells me what I want but I would rather stay in intellij and see the folders on the left expanded to the location of the file. Does this exist in intellij?
Thanks
On the heading of Project Explorer panel their will be a circle with 4 lines inside it.
Press that it will take you to the place where you file is inside the project
Image upload not working thats why explaination

Photoshop - simple Open File action on MAC

Could anyone send the ATN file with only one action -> opening PSD file on Mac?
I've made an action with a lot of steps, it's working good but only on Windows. There is no relative paths in PS actions, and i have no friend that has Mac. Could anyone prepare ATN file (so i will be able to copy "open psd file" step)?
Regards,
Luke
Short answer: this won't work. Even though Photoshop has "shortcuts" paths that are similar for both OSX and Windown (like ~/Desktop is a shortcut for desktop folder no matter of OS and username), Actions don't seem to recognize them. Furthermore, if you record an Open Action on Windows or Mac and open it in a different OS, you'll get a File or folder not found message for this step:
Here're two examples. In bot cases the top Action was made in Windows and the bottom one on Mac. This is a Mac screenshot:
and Windows:
Notice how Action1 on the Mac screenshot has File or folder not found message and on Windows there's the same message for Action2 from fromMac set.
Here's what you can do though.
insert Open as a Menu Item. This way user will be asked for a file you need every time a user calls the Action.
give the file you need to open as a pattern file (.pat) and ask a user to install it. This way you can fill a document with it using the Fill command.
most powerful: use a script. You can convert your action to a script file using the xtools: there's a script within it called ActionToJavascript: this will give you a .jsx file that you can use in Photoshop and that will work exactly as your action. And in this script you can specify a path for your action. Like here I'm specifying a file on my Desktop:
And this script will work on Mac.

Making .exe to be run on another computer without installation

Is there any way to make an .exe file run on another computer without installation ? .
The app is quite simple without any resources except one picture.
It has one form, one button and on Form_Load it needs to show picture.
Do I need to make an installation for that ?
No, what you need to do is to first add the picture to the project (on the menu system click Project | Add Existing Item . . .) if you haven't done that yet, and then click on the file in Solution Explorer and set its Build Action in the Properties Window to "Resource." This will ensure the picture is written into the exe file when you build the application, and you won't have to worry about copying it along with the application.
Select the "Release" build configuration, and then click Build | Rebuild on the menu system to have your application copied to the Bin\Release folder of your project folder. From here you can copy and run it on any computer that has .NET installed.

How do I share IntelliJ Run/Debug configurations between projects?

I have many different versions of my app. Each one is a separate IntelliJ project. Every time I open a new one, the list of configurations starts blank:
The annoying thing about this is I deploy to 1 VM and I have to copy and paste the debug configurations each time I want to test a different version. IntelliJ makes this dialog modal per IntelliJ Instance, so I can't copy and paste the fields between Project Instances.
I end up taking a screenshot of one configuration and copying the fields by hand into the other project. It's a pretty primitive solution. Is there a more convenient way to get a run configuration from one project to another?
I'm using IntelliJ 13 on Windows 7.
Can I share settings for IntelliJ Idea across different projects? may have the answer to this, but the question is different. It's about window layout. Therefore I don't consider it a duplicate.
The best way to do this is to click the "share" checkmark next to Name field when you edit/create the configuration. You can get to this Dialog with Run > Edit Configurations.
The share check-mark pulls the setting out of your workspace.xml and instead puts it in the directory .idea\runConfigurations. This is designed so you can share the setting with others.
You could copy this file and put it in the same location in all your idea projects.
However, in the future, you might want to consider using source control branches for app versions rather than separate projects. IntelliJ handles these very well.
UPDATE (June 2021):
IntelliJ now puts this in the .run folder as its own file, no longer in .idea/runConfigurations.
Run configurations are stored in .idea/workspace.xml by default. First alternative is to share this file but it is not feasible because you also share a lot of unnecessary configurations.
As already said, the first step is to check "share" option to separate run configurations from workspace.xml.
After that, I recommend adding runConfigurations to source control. But the main problem is, probably you have already marked .idea folder as ignored.
You can unignore the folder by configuring your source control system. For example, if you are using git, you can change .gitignore file as follows:
.idea/*
!/.idea/runConfigurations
don't forget adding * after .idea/
As the last step, add your run configurations to source control and enjoy your shared configurations!
goto
Run > Edit Configuration > create or select existing configuration you want to use > click save and persist it on file system > click on share check mark
now copy this file from
PROJECT_ROOT_DIRECTORY/.idea/runConfigurations/ConfigurationName.xml
to your NEW_PROJECT_ROOT_DIRECTORY/.idea/runConfigurations at the same place and it is available now to your run configuration
You should copy the folder
~/your-old-project/.idea/runConfigurations
to
~/your-new-project/.idea/
That's the folder that contains the run configurations.
An update for this question with the new IntelliJ updates:
Now you can "Store as project file" which will create a folder named ".run" and export your setting to that folder. In the example below, I did it for all my test settings. This removes the requirement of editing .gitignore since files are now not outside of ./idea
This is not exactly an answer to your question but it answers a question similar to your question and one that I had, and I'm assuming others might as well.
That is, How to save unit and instrumentation test run configurations? I usually right-click on the test directory which brings up a menu with the option to Run whatever is in that directory. AndroidStudio then creates a run configuration on the fly and in the Run Configuration drop-down menu a new option will appear, "Save new configuration?" or something similar.
Clicking that option brings up the Run Configuration menu and at that point I check the Share box as many others have already mentioned. This then will prompt the version control system to ask me if I want to add this new run configuration file. If you haven't registered your version control system you can find the new files under .idea/runConfigurations.

Open txt file in wix when clicking btn

I have a wix project to which I added a custom window that checks the dependencies needed to run the app. This window comes up right after the License Agreement. Everything works fine, the dependencies are checked through custom actions and in case they are not fulfilled hyperlinks to official websites appear if the windows installer is above version5.
In case of a lower version I would like to click on a btn "Show dependencies" and to show the txt file with the links. I have the custom action below that open notepad and the property that contains the file.
Code:
<Property Id="FXDEP" Value="$(sys.CURRENTDIR)\Resources\Files\FxDependencies.txt" />
<Property Id='NOTEPAD'>NOTEPAD.EXE</Property>
<CustomAction Id='LaunchDependencies' Property='NOTEPAD' ExeCommand='[FXDEP]' Return='asyncNoWait' />
The problem is that on the dev machine it works since it finds the path, but on other of course it fails.
How should I tell wix to maintain this file and open it?
I tried putting the file into
<Binary Id="FxDependencies.txt" SourceFile="$(sys.CURRENTDIR)\Resources\Files\FxDependencies.txt" />
but the custom action does not recognize it.
You seem to be trying to open the file that resides in the source of your installation. You use the same values for FxDependencies.txt and FXDEP.
Your text file with dependencies resides in Binary table of the installer, to use it you have to extract it into a temporary directory, and then launch Notepad to display it.
To do it, you would have to write several custom actions:
The first CA extract the file into a temporary directory, and saves the path into a property, FXDEPTEMPPATH.
The second CA uses FXDEPTEMPPATH to display it in Notepad.
Another option is to write a small application (.exe) that would contain your FxDependencies.txt, in resources for example. You add this .exe into Binary table of MSI, and launch it instead of Notepad from the installer. In this case MSI will automatically extract the exe into a temporary directory and start it. In your application you create a new text file in temporary directory, by extracting the information from resources, and then launch Notepad to display it.
Edit: There's a number of ways to read a file from the Binary table. See these links for examples:
BinaryWrite from Msiext.
Reading from the Binary Table based on WiX source code.
Streaming a File from the Binary Table.
Write the code yourself:
Open a database view of the active database with MsiGetActiveDatabase and MsiDatabaseOpenView;
Read the binary stream with MsiRecordReadStream.
I would suggest you to create folder in custom action.
So,
Validate pre-requisites
Check windows installer version
If version is less than 5, call a custom action to create folder ($(sys.CURRENTDIR)\Resources\Files\)
Then on button click you can call the custom action to launch txt file