Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable icons for custom commands #9

Open
basti1302 opened this issue Feb 27, 2012 · 5 comments
Open

Configurable icons for custom commands #9

basti1302 opened this issue Feb 27, 2012 · 5 comments

Comments

@basti1302
Copy link
Collaborator

No description provided.

@genodeftest
Copy link
Contributor

How about no icons? Most menus in Eclipse don't have menus.

A nice enhancement would be using the operating system's icons. That might be very complicated.

@basti1302
Copy link
Collaborator Author

Well, no icons is what we currently have, right?. It seems I personally can live quite happily without icons on custom commands (note the low prio label).

OS icons: I think that's pretty much out of scope for this plug-in :-)

@genodeftest
Copy link
Contributor

There should be some API somewhere in Eclipse giving access to icons of native applications. This is e.g. used in [ Preferences > General > Editor > File Associations > Add (Editor) > External Programs ] which is part of what StartExplorer resembles.

@genodeftest
Copy link
Contributor

Found in org.eclipse.swt.program.Program.getImageData()

@basti1302
Copy link
Collaborator Author

Nice! I still do not see how we could easily use this. As it is, the user configures a String, that will get executed via Runtime.exec when she activates the custom command. This string could be more or less anything.

If I understand org.eclipse.swt.program.Program correctly, we can get an instance of it by feeding a file extension (like "txt" or "xls") to the static method findProgram (String extension). The menu for the custom commands is created dynamically each time the user opens it on a file. So indeed we could use the extension of the currently selected file and pass it to findProgram. But we still do not know if that makes sense.

For all we know, the custom command could be "rm -rf ${resource_path}" or "scp ${resource_path} [email protected]:/root/${resource_name}" or whatever. IMHO it would be rather pointless to show the icon for the file type for arbitrary commands.

We could, however use this Eclipse API to dynamically show different icons for the standard StartExplorer "Open File With Default Application" command. OTOH, as you pointed out in #1, we might as well drop the open in default application thing completely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants