How to exchange ONLY the keybindings between eclipse instances - java

When I exchange the complete preferences, my customized key bindings are exported along with the other stuff, but if i select Keys Preferences from the Export->Preferences menu, only a useless small subset of the shortcuts is exported.
There is a possibility to export all the bindings from the Keys Page which is worse then useless as it suggests a feature thet isn't there.
I don't want to mess up the complete setup, so: is there a way to transfer just the key bindings and nothing else?
Thank you
btw : this post deals with the same topic but isnt helpful for the reasons above.

There is no automatic way as far as I know but the resulting file is XML, so you can export all the preferences and delete everything you don't want.
The result should still load into Eclipse.

Related

Add a custom file type with java application installation

I am trying to have my custom file type .vrs (which for all intents and purposes is an rich text format).
I am pleased with what I have since I am self taught.
But am having difficulties associating that file with my program so that when a user double clicks it, it automatically open my document editor.
All searches so far have come up with either right clicking and setting the association, but this is not what I would need.
I may not have explained as well as needed so think Photoshop's .psd when you install Photoshop all psd files are automatically set to open when you double click them.
Hopefully I have been clear enough for you to help.
Also whilst the question is regarding Java any resource be it for C# C++ etc, would also be appreciated.
Thanks for your time and any responses.
This functionality is system dependent, and in Windows involves the registry. If you really want to delve into this, take a look at this post, which goes into great detail on how to accomplish programmatically setting a file extension association using C++. If this is helpful, please write back telling us how you solved the problem in your individual situation.
If that isn't helpful I would try this link instead, as it links to more resources and demonstrates a little C# code.

Eclipse preference page with multiple arrays

I tried to search the internet for examples for doing that, but can not find a good one. Also I checking eclipse IDE source code, but it's a bit too big to filter out what I need for an example.
What I would need is something similar to Eclipse File Association page below.
My plan is later to replace File types list with a combo and add more values/controls per combo selection.
I would be very thankful for an example or a link to an example that does that or has a same concept with working preference store.
Thank you!
You can take a look at the Google Eclipse plugin source code. I had to achieve something similar to your needs, and inspired myself from there. It is properly designed. You can take a look at the repository right here.
In my case, I needed checkboxes instead of combos, and used a CheckboxTableViewer from the JFace library, there are plenty of example onlines (e.g: JFace snippets).
As Alex said, first, works on Eclipse preferences concept... when you got it, it will just stay some pure UI tasks.
Well, I think that it is nothing more then simple preferences page with two Lists which just represents conformity between file types and editors.
The example how to implement your own preferences page is here: Eclipse Preferences - Tutorial
If you want to have Combo - there is no problem - you just replace upper ListEditor woth your ComboFieldEditor and proceed with adding more conrols. The file associations are stored in Eclipse preferences and you can access them whenever you try to open some file to retrieve corresponding editor.

How can I add a custom warning to Java files in Eclipse?

I'd like to add a custom warning message (i.e. add an entry to the Warnings section of the Problems tab) for .java files in Eclipse.
While I've found information (here and elsewhere) on creating plugins and using markers, I haven't yet found anything which talks about extending the "problem-finding" process. Most of the articles I've found don't discuss when to create markers, only how, and those that do assume that I'm interested in attaching them to a custom build step or custom editor, neither of which seems appropriate for what I'm trying to do.
How can I create a warning which functions like those available via Window > Preferences > Java > Compiler > Errors/Warnings?
I think that a builder might be appropriate for what you want to do. There's a template in the new plugin wizard that creates everything you need for a builder (ex. business logic). Since the builder runs every time the file is modified, you can clear the old warning (code generated for you) and add a new warning (code generated for you) if applicable. This also applies when the file is first created.
You could even look through the code and find hard-coded strings and flag them with warnings if you want.
As for the comments marking translation keys in the code today, those are there to guide NLS tools (you probably already knew that). The idea was to write the code first and then go back later and translate. If a change is made to the code later, the tools can run again and only act on new strings added by the delta.

Scripting Eclipse .. or alternatives

I have written an android application. I would like to be able to customize the app programmatically. For example, change logos/titles within the application.
Assume I have a simple web server that displays a form with fields to input text, upload images etc. Upon submission of this form, I would like to generate an apk file available for download for the user.
Is there a way to script eclipse to achieve this? Is that even where I should be looking? If anyone has done something like this, (or have some ideas), please let me know!
Thanks
Is there a way to script eclipse to achieve this?
Possibly, but I doubt it.
Is that even where I should be looking?
Use Ant. Make a copy of some master project, make your adjustments from the entered data, and run the appropriate ant tasks (e.g., ant release build) to create the APK.
We have put together a system that creates multiple, customised APKs from a single body of source code. The system is not in a state where we can make it available (although we may open source it at some point) but the general structure is described here.
Having said that, the system you describe in your question is much more dynamic than what we need. We only need to create a few (~10) different variants. It strikes me that what you're trying to do would be better solved by having a single APK together with a configuration file. Your webserver would generate the configuration file, not the APK.

How to code startup tips to be easily localized

I'm writing a new Java 6 Swing application and want to have a "Show tips at start-up" feature. I've done this before, but never with localization in mind.
In the past, my tips dialog used an XML file to hold the tips, but I'm afraid this will make things difficult when it comes time to translate these tips into different languages. I've thought about using a .properties file like with other strings in the application, but wonder if this is a maintainable approach. I would like to give the user the ability to add their own tips which will also display in the same dialog.
Is the properties approach the way to go? If I allow users to add their own tips, I'll need some way to make sure the keys (for text retrieval) are unique.
I would say the properties files is the best approach. But i would make the user a screen to add new tips, instead of letting them modify the properties files directly.
To read all the keys, you can use java.util.ResourceBundle you will find a method called getKeys
You should build a screen like this:
(source: cimco-hsm.com)

Categories