How to enable a menu in Eclipse depending on the EXE file - eclipse

I want to disable a context menu item in Eclipse plugin bases on the EXE file. I mean, I want to enable the menu only when my EXE file is installed in the user's system. Otherwise it should be in disable mode. What is the way to do it?

There are no easy way to do this.
The normal options are
have a special option in the test system (which can be spoofed...)
have a PropertyTester that can test some special different between the systems
The first option is very easy, but can also easily be spoofed.
To do the later, you must
create and declare a PropertyTester
add a activeWhen or visibleWhen expression to the relevant menu entries, which use test expression element to get the value from the property tester

Related

Eclipse content assist (for PHP or anything) not using active working set

The Eclipse content assist for PHP (and I'm assuming for other types as well) isn't using the currently active working set - it's searching ALL files in the project. How do I change it to only use the active working set?
When doing a Ctrl+Shift+R search, it was also looking for all files in the project (not what I wanted), until I clicked the small black triangle in that window and selected the working set I wanted it to use. Now it successfully only shows the files that match my search string in the working set. However, this doesn't change anything in the autocomplete content assist feature (i.e. doing a Ctrl+Space to complete the name of a function or variable). Is there any way to accomplish this?
I'm using Eclipse Indigo release, so it's very recent.
I'm afraid it's not possible the way you put it. Eclipse Working Sets just give you a way to organize your projects.
However you may want to take a look at Mylyn, which is fully integrated with Eclipse platform. Here and here is a nice overview of what you can do with Mylyn. But briefly, what it allows you to do is to create a task and maintain a context associated with it. This way, only the relevant files will be displayed in Project Explorer and autocomplete would suggest you only task-focused options.

Writing a macro-like tool

Recently I've been finding myself doing repetitive tasks. I would click button A, highlight text field A, type in some text, click an APPLY button, click on a drop-down box and select a specific option depending on the item I'm working with, select it and hit APPLY, then repeat this process only a couple hundred to thousand times.
So I thought maybe there's a way I could automate this? Macros then came to mind. However I've never wrote macros before so am not sure of several details such as
-what tools should I even work with?
-how do I determine which button to click?
-ideally, I would want to be able to read input from a text file to specify what should be typed in and which option should be selected from the dropdown list. Is this even possible? It seems like an operation that require some intelligence.
I am not picky on tools nor about cleanliness. I just want to be able to automate the process. It will be for personal use unless I find a convenient way such that others can use it as well.
Some details about the dropdown box: when the box is focused, I can hit the DOWN key to scroll from option to option. The items that I have to associate with these options are named exactly the same, so they appear in the same "index" order (meaning, the first item and first option appear at the top of the list, second item and second option appear after, thid item and third option...etc)
The placement of all of these fields can be fixed, so if I have to manually specify where on the screen I should be clicking, that is also a possibility.
Any idea where I should look?
If you're using Windows, AutoIt is a really nice tool.
It records actions (like a word/excel macro)
It offers a BASIC like language + API which is really easy to program (if you need to)
The API is pretty powerful
Check for Windows with a certain title
Automate klicks
...
You can "compile" your scripts into exe files so you can share your tools
It comes bundled with Scite (a nice text editor) + AutoIt syntax higlighting
But you can use any editor you want
It's well documented
It's Freeware
http://www.autoitscript.com/site/
On the Mac, there is Automator. Java has the Robot class in the basic library, to help with such automation. No doubt there are other similar tools.

Tying a single operation to multiple "when" situations in Eclipse. Is it possible?

I'm looking for a way to tie a certain keyboard shortcut to running an Ant Task in Eclipse.
I'd like to do this from any place in Eclipse. From what I've seen, I could define a hotkey for "Run the last external application", but that obliges me to define a "when", that is, a place I want to be when that hotkey makes sense.
I guess I'll want to run that either when I'm coding or when I have the package-explorer open but Eclipse only seems to allow me to define a "when". Is there a workaround for this?
Better yet, is it possible to define that a certain hotkey combination can be ran from anywhere in Eclipse?
It sounds like you want to use the "In Windows" entry for the "When". "In Windows" should make the shortcut work within any Eclipse window, but not in dialog boxes. If you want it to work in dialogs as well, then pick "In Dialogs and Windows".
Read more about shortcut definitions here. The section labeled "Contexts" corresponds to the "When" field of the Keys preference page.
Update: There is a bug in some versions of Eclipse that cause the key binding described above to open External Tools configuration dialog instead of running the last external tool. The linked bug report indicates that this bug has been fixed in the forthcoming version 3.7.

Workspace Editor Macros in Eclipse

Is there a way to record permanent workspace macros in Eclipse and assign them a shortcut key or template?
I'd like to automate some of the actions I routinely do. Workspace editor templates are not a solution since I need to include some conditional logic as well. For example check what is a symbol to the right/left of the cursor.
See my answer at How can I launch more than one debug session in Eclipse from a single click? . The same plugin can work for you as well.

Is it possible to specify in Eclipse managed projects the path of a library independent of configuration

Within Properties/Settings/Tool Settings, one can specify a Library search path (-L).
For a specific build configuration one can enter
${workspace_loc:/SomeLib/Debug} or ${workspace_loc:/SomeLib/Release}
depending on the configuration.
Is there a variable, like ${workspace_loc} that can be used specify a 'universal' search path. This path would then be correct regardless of the configuration.
Such as:
${workspace_loc:/SomeLib/${config}}
BTW, Is the Eclipse documentation showing a list of all the workspace/project variables?
One thing you can do is create you own string substitution. "You can create and configure simple launch variables which you can reference in launch configurations that support variables".This is done under "Preferences">"Run/Debug">"String Substitution".
As far as list of possible variables goes, I found that if you go to "Run Configurations" and select "Arguments" tab then click on "Variables..." button - you'll get a window with all variables and their descriptions. You can even edit string substitutions from there.
Hope it helped.