From 523ba7ac5cfd70a1d062fdde99c583a720d235ab Mon Sep 17 00:00:00 2001 From: Andre Bossert Date: Tue, 27 Dec 2016 21:45:12 +0100 Subject: [PATCH] #97 Possibility to use custom icons added internal handling and override of images / icons Signed-off-by: Andre Bossert --- plugin/build.properties | 4 +- plugin/{icons => images}/clipboard.png | Bin plugin/{icons => images}/clipboard1.png | Bin plugin/{icons => images}/default.png | Bin plugin/{icons => images}/easyshell.png | Bin plugin/{icons => images}/eclipse.png | Bin plugin/{icons => images}/explore.png | Bin plugin/{icons => images}/explore1.png | Bin plugin/{icons => images}/explore2.png | Bin plugin/{icons => images}/macosx/explore.png | Bin plugin/{icons/unknown.png => images/none.png} | Bin plugin/{icons => images}/open.png | Bin plugin/{icons => images}/run.png | Bin plugin/{icons => images}/run1.png | Bin plugin/{icons => images}/run2.gif | Bin plugin/{icons => images}/user.png | Bin .../{icons => images}/windows/easyshell.png | Bin .../gif/console_view.gif | Bin .../gif/copy.gif | Bin .../gif/copy_edit.gif | Bin .../gif/copy_edit_co.gif | Bin .../gif/cpyqual_menu.gif | Bin .../gif/easyshell.gif | Bin .../gif/eclipse.gif | Bin .../gif/editor.gif | Bin .../gif/editor_area.gif | Bin .../gif/environment_obj.gif | Bin .../gif/exclusion_filter_attrib.gif | Bin .../gif/external_tools.gif | Bin .../gif/file_obj.gif | Bin .../gif/filenav_nav.gif | Bin .../gif/fldr_obj.gif | Bin .../gif/folder.gif | Bin .../gif/goto_input.gif | Bin .../gif/help.gif | Bin .../gif/home_nav.gif | Bin .../gif/prompt.gif | Bin .../gif/properties.gif | Bin .../gif/run.gif | Bin .../gif/run_exc.gif | Bin .../macosx/10.png | Bin .../macosx/Musett-Antares-IMac-OSX.ico | Bin .../macosx/Terminal-Befehle-Ubuntu-Linux.png | Bin .../macosx/Terminalicon.png | Bin .../macosx/allmyfiles.png | Bin .../macosx/allmyfiles@2x.png | Bin .../macosx/finder.png | Bin .../macosx/finder@2x.png | Bin .../macosx/finder_16x16.png | Bin .../macosx/icon_terminal_2x.jpg | Bin .../macosx/mac-terminal-icon-4519.png | Bin .../macosx/terminal-app-icon-OS-X.png | Bin .../macosx/terminal-icon-osx-150x150.png | Bin .../macosx/terminal.png | Bin .../terminal_icons_by_isgie-d2xgmyw.png | Bin .../macosx/url 2.png | Bin .../macosx/url.png | Bin .../macosx/url@2x 2.png | Bin .../macosx/url@2x.png | Bin .../png/console_view.png | Bin .../png/copy.png | Bin .../png/copy_edit.png | Bin .../png/copy_edit_co.png | Bin .../png/copyviewtoclipboard_tsk.png | Bin .../png/cpyqual_menu.png | Bin .../png/easyshell.png | Bin .../png/easyshell2.png | Bin .../png/easyshell_new.png | Bin .../png/easyshell_old.png | Bin .../png/eclipse.png | Bin .../png/editor_area.png | Bin .../png/environment_obj.png | Bin .../png/exclusion_filter_attrib.png | Bin .../png/external_tools.png | Bin .../png/file-new-16x16.png | Bin .../png/file_obj.png | Bin .../png/filenav_nav.png | Bin .../png/fldr_obj.png | Bin .../png/folder.png | Bin .../png/goto_input.png | Bin .../png/help.png | Bin .../png/home_nav.png | Bin .../png/prompt.png | Bin .../png/prompt2.png | Bin .../png/prompt_old.png | Bin .../png/prompt_old2.png | Bin .../png/properties.png | Bin .../png/run_exc.png | Bin .../test/Command Prompt.png | Bin .../test/Prompt.png | Bin .../test/Terminal (2).png | Bin .../test/Terminal (3).png | Bin .../test/app_terminal.png | Bin .../test/app_terminal_16x16.png | Bin .../test/terminal (1).png | Bin .../test/terminal-19.png | Bin .../test/terminal-icon.png | Bin .../test/terminal.gif | Bin .../test/terminal.png | Bin .../test/terminal.svg | 0 .../test/terminal_16x16.png | Bin plugin/plugin.xml | 6 +- .../eclipse/easyshell/plugin/Activator.java | 19 ++-- .../eclipse/easyshell/plugin/Constants.java | 25 +++-- .../easyshell/plugin/UIMessages.properties | 16 +-- .../plugin/commands/DefineCommands.java | 2 +- .../plugin/commands/ExecuteCommandDialog.java | 3 +- .../commands/ExecuteCommandLabelProvider.java | 8 +- .../easyshell/plugin/legacy/PrefsV1_4.java | 8 +- .../easyshell/plugin/legacy/PrefsV1_5.java | 8 +- .../easyshell/plugin/misc/UtilsUI.java | 29 +++++- .../plugin/preferences/CommandData.java | 91 +++++++----------- .../plugin/preferences/CommandDataDialog.java | 5 +- .../preferences/CommandDataLabelProvider.java | 2 +- .../plugin/preferences/MenuData.java | 57 +++++++++-- .../plugin/preferences/MenuDataDialog.java | 42 ++++---- .../preferences/MenuDataLabelProvider.java | 41 +++----- .../easyshell/plugin/types/Category.java | 16 +-- .../easyshell/plugin/types/Version.java | 3 +- 119 files changed, 208 insertions(+), 177 deletions(-) rename plugin/{icons => images}/clipboard.png (100%) rename plugin/{icons => images}/clipboard1.png (100%) rename plugin/{icons => images}/default.png (100%) rename plugin/{icons => images}/easyshell.png (100%) rename plugin/{icons => images}/eclipse.png (100%) rename plugin/{icons => images}/explore.png (100%) rename plugin/{icons => images}/explore1.png (100%) rename plugin/{icons => images}/explore2.png (100%) rename plugin/{icons => images}/macosx/explore.png (100%) rename plugin/{icons/unknown.png => images/none.png} (100%) rename plugin/{icons => images}/open.png (100%) rename plugin/{icons => images}/run.png (100%) rename plugin/{icons => images}/run1.png (100%) rename plugin/{icons => images}/run2.gif (100%) rename plugin/{icons => images}/user.png (100%) rename plugin/{icons => images}/windows/easyshell.png (100%) rename plugin/{icons_example => images_not_used}/gif/console_view.gif (100%) rename plugin/{icons_example => images_not_used}/gif/copy.gif (100%) rename plugin/{icons_example => images_not_used}/gif/copy_edit.gif (100%) rename plugin/{icons_example => images_not_used}/gif/copy_edit_co.gif (100%) rename plugin/{icons_example => images_not_used}/gif/cpyqual_menu.gif (100%) rename plugin/{icons_example => images_not_used}/gif/easyshell.gif (100%) rename plugin/{icons_example => images_not_used}/gif/eclipse.gif (100%) rename plugin/{icons_example => images_not_used}/gif/editor.gif (100%) rename plugin/{icons_example => images_not_used}/gif/editor_area.gif (100%) rename plugin/{icons_example => images_not_used}/gif/environment_obj.gif (100%) rename plugin/{icons_example => images_not_used}/gif/exclusion_filter_attrib.gif (100%) rename plugin/{icons_example => images_not_used}/gif/external_tools.gif (100%) rename plugin/{icons_example => images_not_used}/gif/file_obj.gif (100%) rename plugin/{icons_example => images_not_used}/gif/filenav_nav.gif (100%) rename plugin/{icons_example => images_not_used}/gif/fldr_obj.gif (100%) rename plugin/{icons_example => images_not_used}/gif/folder.gif (100%) rename plugin/{icons_example => images_not_used}/gif/goto_input.gif (100%) rename plugin/{icons_example => images_not_used}/gif/help.gif (100%) rename plugin/{icons_example => images_not_used}/gif/home_nav.gif (100%) rename plugin/{icons_example => images_not_used}/gif/prompt.gif (100%) rename plugin/{icons_example => images_not_used}/gif/properties.gif (100%) rename plugin/{icons_example => images_not_used}/gif/run.gif (100%) rename plugin/{icons_example => images_not_used}/gif/run_exc.gif (100%) rename plugin/{icons_example => images_not_used}/macosx/10.png (100%) rename plugin/{icons_example => images_not_used}/macosx/Musett-Antares-IMac-OSX.ico (100%) rename plugin/{icons_example => images_not_used}/macosx/Terminal-Befehle-Ubuntu-Linux.png (100%) rename plugin/{icons_example => images_not_used}/macosx/Terminalicon.png (100%) rename plugin/{icons_example => images_not_used}/macosx/allmyfiles.png (100%) rename plugin/{icons_example => images_not_used}/macosx/allmyfiles@2x.png (100%) rename plugin/{icons_example => images_not_used}/macosx/finder.png (100%) rename plugin/{icons_example => images_not_used}/macosx/finder@2x.png (100%) rename plugin/{icons_example => images_not_used}/macosx/finder_16x16.png (100%) rename plugin/{icons_example => images_not_used}/macosx/icon_terminal_2x.jpg (100%) rename plugin/{icons_example => images_not_used}/macosx/mac-terminal-icon-4519.png (100%) rename plugin/{icons_example => images_not_used}/macosx/terminal-app-icon-OS-X.png (100%) rename plugin/{icons_example => images_not_used}/macosx/terminal-icon-osx-150x150.png (100%) rename plugin/{icons_example => images_not_used}/macosx/terminal.png (100%) rename plugin/{icons_example => images_not_used}/macosx/terminal_icons_by_isgie-d2xgmyw.png (100%) rename plugin/{icons_example => images_not_used}/macosx/url 2.png (100%) rename plugin/{icons_example => images_not_used}/macosx/url.png (100%) rename plugin/{icons_example => images_not_used}/macosx/url@2x 2.png (100%) rename plugin/{icons_example => images_not_used}/macosx/url@2x.png (100%) rename plugin/{icons_example => images_not_used}/png/console_view.png (100%) rename plugin/{icons_example => images_not_used}/png/copy.png (100%) rename plugin/{icons_example => images_not_used}/png/copy_edit.png (100%) rename plugin/{icons_example => images_not_used}/png/copy_edit_co.png (100%) rename plugin/{icons_example => images_not_used}/png/copyviewtoclipboard_tsk.png (100%) rename plugin/{icons_example => images_not_used}/png/cpyqual_menu.png (100%) rename plugin/{icons_example => images_not_used}/png/easyshell.png (100%) rename plugin/{icons_example => images_not_used}/png/easyshell2.png (100%) rename plugin/{icons_example => images_not_used}/png/easyshell_new.png (100%) rename plugin/{icons_example => images_not_used}/png/easyshell_old.png (100%) rename plugin/{icons_example => images_not_used}/png/eclipse.png (100%) rename plugin/{icons_example => images_not_used}/png/editor_area.png (100%) rename plugin/{icons_example => images_not_used}/png/environment_obj.png (100%) rename plugin/{icons_example => images_not_used}/png/exclusion_filter_attrib.png (100%) rename plugin/{icons_example => images_not_used}/png/external_tools.png (100%) rename plugin/{icons_example => images_not_used}/png/file-new-16x16.png (100%) rename plugin/{icons_example => images_not_used}/png/file_obj.png (100%) rename plugin/{icons_example => images_not_used}/png/filenav_nav.png (100%) rename plugin/{icons_example => images_not_used}/png/fldr_obj.png (100%) rename plugin/{icons_example => images_not_used}/png/folder.png (100%) rename plugin/{icons_example => images_not_used}/png/goto_input.png (100%) rename plugin/{icons_example => images_not_used}/png/help.png (100%) rename plugin/{icons_example => images_not_used}/png/home_nav.png (100%) rename plugin/{icons_example => images_not_used}/png/prompt.png (100%) rename plugin/{icons_example => images_not_used}/png/prompt2.png (100%) rename plugin/{icons_example => images_not_used}/png/prompt_old.png (100%) rename plugin/{icons_example => images_not_used}/png/prompt_old2.png (100%) rename plugin/{icons_example => images_not_used}/png/properties.png (100%) rename plugin/{icons_example => images_not_used}/png/run_exc.png (100%) rename plugin/{icons_example => images_not_used}/test/Command Prompt.png (100%) rename plugin/{icons_example => images_not_used}/test/Prompt.png (100%) rename plugin/{icons_example => images_not_used}/test/Terminal (2).png (100%) rename plugin/{icons_example => images_not_used}/test/Terminal (3).png (100%) rename plugin/{icons_example => images_not_used}/test/app_terminal.png (100%) rename plugin/{icons_example => images_not_used}/test/app_terminal_16x16.png (100%) rename plugin/{icons_example => images_not_used}/test/terminal (1).png (100%) rename plugin/{icons_example => images_not_used}/test/terminal-19.png (100%) rename plugin/{icons_example => images_not_used}/test/terminal-icon.png (100%) rename plugin/{icons_example => images_not_used}/test/terminal.gif (100%) rename plugin/{icons_example => images_not_used}/test/terminal.png (100%) rename plugin/{icons_example => images_not_used}/test/terminal.svg (100%) rename plugin/{icons_example => images_not_used}/test/terminal_16x16.png (100%) diff --git a/plugin/build.properties b/plugin/build.properties index 35119812..10ed8f39 100644 --- a/plugin/build.properties +++ b/plugin/build.properties @@ -1,11 +1,11 @@ -bin.includes = icons/,\ +bin.includes = images/,\ plugin.xml,\ META-INF/,\ target/easyshell-library.jar,\ src/de/anbos/eclipse/easyshell/plugin/UIMessages.properties,\ releases/,\ scripts/ -src.includes = icons/,\ +src.includes = images/,\ manpages/,\ releases/CHANGES.TXT,\ releases/README.TXT,\ diff --git a/plugin/icons/clipboard.png b/plugin/images/clipboard.png similarity index 100% rename from plugin/icons/clipboard.png rename to plugin/images/clipboard.png diff --git a/plugin/icons/clipboard1.png b/plugin/images/clipboard1.png similarity index 100% rename from plugin/icons/clipboard1.png rename to plugin/images/clipboard1.png diff --git a/plugin/icons/default.png b/plugin/images/default.png similarity index 100% rename from plugin/icons/default.png rename to plugin/images/default.png diff --git a/plugin/icons/easyshell.png b/plugin/images/easyshell.png similarity index 100% rename from plugin/icons/easyshell.png rename to plugin/images/easyshell.png diff --git a/plugin/icons/eclipse.png b/plugin/images/eclipse.png similarity index 100% rename from plugin/icons/eclipse.png rename to plugin/images/eclipse.png diff --git a/plugin/icons/explore.png b/plugin/images/explore.png similarity index 100% rename from plugin/icons/explore.png rename to plugin/images/explore.png diff --git a/plugin/icons/explore1.png b/plugin/images/explore1.png similarity index 100% rename from plugin/icons/explore1.png rename to plugin/images/explore1.png diff --git a/plugin/icons/explore2.png b/plugin/images/explore2.png similarity index 100% rename from plugin/icons/explore2.png rename to plugin/images/explore2.png diff --git a/plugin/icons/macosx/explore.png b/plugin/images/macosx/explore.png similarity index 100% rename from plugin/icons/macosx/explore.png rename to plugin/images/macosx/explore.png diff --git a/plugin/icons/unknown.png b/plugin/images/none.png similarity index 100% rename from plugin/icons/unknown.png rename to plugin/images/none.png diff --git a/plugin/icons/open.png b/plugin/images/open.png similarity index 100% rename from plugin/icons/open.png rename to plugin/images/open.png diff --git a/plugin/icons/run.png b/plugin/images/run.png similarity index 100% rename from plugin/icons/run.png rename to plugin/images/run.png diff --git a/plugin/icons/run1.png b/plugin/images/run1.png similarity index 100% rename from plugin/icons/run1.png rename to plugin/images/run1.png diff --git a/plugin/icons/run2.gif b/plugin/images/run2.gif similarity index 100% rename from plugin/icons/run2.gif rename to plugin/images/run2.gif diff --git a/plugin/icons/user.png b/plugin/images/user.png similarity index 100% rename from plugin/icons/user.png rename to plugin/images/user.png diff --git a/plugin/icons/windows/easyshell.png b/plugin/images/windows/easyshell.png similarity index 100% rename from plugin/icons/windows/easyshell.png rename to plugin/images/windows/easyshell.png diff --git a/plugin/icons_example/gif/console_view.gif b/plugin/images_not_used/gif/console_view.gif similarity index 100% rename from plugin/icons_example/gif/console_view.gif rename to plugin/images_not_used/gif/console_view.gif diff --git a/plugin/icons_example/gif/copy.gif b/plugin/images_not_used/gif/copy.gif similarity index 100% rename from plugin/icons_example/gif/copy.gif rename to plugin/images_not_used/gif/copy.gif diff --git a/plugin/icons_example/gif/copy_edit.gif b/plugin/images_not_used/gif/copy_edit.gif similarity index 100% rename from plugin/icons_example/gif/copy_edit.gif rename to plugin/images_not_used/gif/copy_edit.gif diff --git a/plugin/icons_example/gif/copy_edit_co.gif b/plugin/images_not_used/gif/copy_edit_co.gif similarity index 100% rename from plugin/icons_example/gif/copy_edit_co.gif rename to plugin/images_not_used/gif/copy_edit_co.gif diff --git a/plugin/icons_example/gif/cpyqual_menu.gif b/plugin/images_not_used/gif/cpyqual_menu.gif similarity index 100% rename from plugin/icons_example/gif/cpyqual_menu.gif rename to plugin/images_not_used/gif/cpyqual_menu.gif diff --git a/plugin/icons_example/gif/easyshell.gif b/plugin/images_not_used/gif/easyshell.gif similarity index 100% rename from plugin/icons_example/gif/easyshell.gif rename to plugin/images_not_used/gif/easyshell.gif diff --git a/plugin/icons_example/gif/eclipse.gif b/plugin/images_not_used/gif/eclipse.gif similarity index 100% rename from plugin/icons_example/gif/eclipse.gif rename to plugin/images_not_used/gif/eclipse.gif diff --git a/plugin/icons_example/gif/editor.gif b/plugin/images_not_used/gif/editor.gif similarity index 100% rename from plugin/icons_example/gif/editor.gif rename to plugin/images_not_used/gif/editor.gif diff --git a/plugin/icons_example/gif/editor_area.gif b/plugin/images_not_used/gif/editor_area.gif similarity index 100% rename from plugin/icons_example/gif/editor_area.gif rename to plugin/images_not_used/gif/editor_area.gif diff --git a/plugin/icons_example/gif/environment_obj.gif b/plugin/images_not_used/gif/environment_obj.gif similarity index 100% rename from plugin/icons_example/gif/environment_obj.gif rename to plugin/images_not_used/gif/environment_obj.gif diff --git a/plugin/icons_example/gif/exclusion_filter_attrib.gif b/plugin/images_not_used/gif/exclusion_filter_attrib.gif similarity index 100% rename from plugin/icons_example/gif/exclusion_filter_attrib.gif rename to plugin/images_not_used/gif/exclusion_filter_attrib.gif diff --git a/plugin/icons_example/gif/external_tools.gif b/plugin/images_not_used/gif/external_tools.gif similarity index 100% rename from plugin/icons_example/gif/external_tools.gif rename to plugin/images_not_used/gif/external_tools.gif diff --git a/plugin/icons_example/gif/file_obj.gif b/plugin/images_not_used/gif/file_obj.gif similarity index 100% rename from plugin/icons_example/gif/file_obj.gif rename to plugin/images_not_used/gif/file_obj.gif diff --git a/plugin/icons_example/gif/filenav_nav.gif b/plugin/images_not_used/gif/filenav_nav.gif similarity index 100% rename from plugin/icons_example/gif/filenav_nav.gif rename to plugin/images_not_used/gif/filenav_nav.gif diff --git a/plugin/icons_example/gif/fldr_obj.gif b/plugin/images_not_used/gif/fldr_obj.gif similarity index 100% rename from plugin/icons_example/gif/fldr_obj.gif rename to plugin/images_not_used/gif/fldr_obj.gif diff --git a/plugin/icons_example/gif/folder.gif b/plugin/images_not_used/gif/folder.gif similarity index 100% rename from plugin/icons_example/gif/folder.gif rename to plugin/images_not_used/gif/folder.gif diff --git a/plugin/icons_example/gif/goto_input.gif b/plugin/images_not_used/gif/goto_input.gif similarity index 100% rename from plugin/icons_example/gif/goto_input.gif rename to plugin/images_not_used/gif/goto_input.gif diff --git a/plugin/icons_example/gif/help.gif b/plugin/images_not_used/gif/help.gif similarity index 100% rename from plugin/icons_example/gif/help.gif rename to plugin/images_not_used/gif/help.gif diff --git a/plugin/icons_example/gif/home_nav.gif b/plugin/images_not_used/gif/home_nav.gif similarity index 100% rename from plugin/icons_example/gif/home_nav.gif rename to plugin/images_not_used/gif/home_nav.gif diff --git a/plugin/icons_example/gif/prompt.gif b/plugin/images_not_used/gif/prompt.gif similarity index 100% rename from plugin/icons_example/gif/prompt.gif rename to plugin/images_not_used/gif/prompt.gif diff --git a/plugin/icons_example/gif/properties.gif b/plugin/images_not_used/gif/properties.gif similarity index 100% rename from plugin/icons_example/gif/properties.gif rename to plugin/images_not_used/gif/properties.gif diff --git a/plugin/icons_example/gif/run.gif b/plugin/images_not_used/gif/run.gif similarity index 100% rename from plugin/icons_example/gif/run.gif rename to plugin/images_not_used/gif/run.gif diff --git a/plugin/icons_example/gif/run_exc.gif b/plugin/images_not_used/gif/run_exc.gif similarity index 100% rename from plugin/icons_example/gif/run_exc.gif rename to plugin/images_not_used/gif/run_exc.gif diff --git a/plugin/icons_example/macosx/10.png b/plugin/images_not_used/macosx/10.png similarity index 100% rename from plugin/icons_example/macosx/10.png rename to plugin/images_not_used/macosx/10.png diff --git a/plugin/icons_example/macosx/Musett-Antares-IMac-OSX.ico b/plugin/images_not_used/macosx/Musett-Antares-IMac-OSX.ico similarity index 100% rename from plugin/icons_example/macosx/Musett-Antares-IMac-OSX.ico rename to plugin/images_not_used/macosx/Musett-Antares-IMac-OSX.ico diff --git a/plugin/icons_example/macosx/Terminal-Befehle-Ubuntu-Linux.png b/plugin/images_not_used/macosx/Terminal-Befehle-Ubuntu-Linux.png similarity index 100% rename from plugin/icons_example/macosx/Terminal-Befehle-Ubuntu-Linux.png rename to plugin/images_not_used/macosx/Terminal-Befehle-Ubuntu-Linux.png diff --git a/plugin/icons_example/macosx/Terminalicon.png b/plugin/images_not_used/macosx/Terminalicon.png similarity index 100% rename from plugin/icons_example/macosx/Terminalicon.png rename to plugin/images_not_used/macosx/Terminalicon.png diff --git a/plugin/icons_example/macosx/allmyfiles.png b/plugin/images_not_used/macosx/allmyfiles.png similarity index 100% rename from plugin/icons_example/macosx/allmyfiles.png rename to plugin/images_not_used/macosx/allmyfiles.png diff --git a/plugin/icons_example/macosx/allmyfiles@2x.png b/plugin/images_not_used/macosx/allmyfiles@2x.png similarity index 100% rename from plugin/icons_example/macosx/allmyfiles@2x.png rename to plugin/images_not_used/macosx/allmyfiles@2x.png diff --git a/plugin/icons_example/macosx/finder.png b/plugin/images_not_used/macosx/finder.png similarity index 100% rename from plugin/icons_example/macosx/finder.png rename to plugin/images_not_used/macosx/finder.png diff --git a/plugin/icons_example/macosx/finder@2x.png b/plugin/images_not_used/macosx/finder@2x.png similarity index 100% rename from plugin/icons_example/macosx/finder@2x.png rename to plugin/images_not_used/macosx/finder@2x.png diff --git a/plugin/icons_example/macosx/finder_16x16.png b/plugin/images_not_used/macosx/finder_16x16.png similarity index 100% rename from plugin/icons_example/macosx/finder_16x16.png rename to plugin/images_not_used/macosx/finder_16x16.png diff --git a/plugin/icons_example/macosx/icon_terminal_2x.jpg b/plugin/images_not_used/macosx/icon_terminal_2x.jpg similarity index 100% rename from plugin/icons_example/macosx/icon_terminal_2x.jpg rename to plugin/images_not_used/macosx/icon_terminal_2x.jpg diff --git a/plugin/icons_example/macosx/mac-terminal-icon-4519.png b/plugin/images_not_used/macosx/mac-terminal-icon-4519.png similarity index 100% rename from plugin/icons_example/macosx/mac-terminal-icon-4519.png rename to plugin/images_not_used/macosx/mac-terminal-icon-4519.png diff --git a/plugin/icons_example/macosx/terminal-app-icon-OS-X.png b/plugin/images_not_used/macosx/terminal-app-icon-OS-X.png similarity index 100% rename from plugin/icons_example/macosx/terminal-app-icon-OS-X.png rename to plugin/images_not_used/macosx/terminal-app-icon-OS-X.png diff --git a/plugin/icons_example/macosx/terminal-icon-osx-150x150.png b/plugin/images_not_used/macosx/terminal-icon-osx-150x150.png similarity index 100% rename from plugin/icons_example/macosx/terminal-icon-osx-150x150.png rename to plugin/images_not_used/macosx/terminal-icon-osx-150x150.png diff --git a/plugin/icons_example/macosx/terminal.png b/plugin/images_not_used/macosx/terminal.png similarity index 100% rename from plugin/icons_example/macosx/terminal.png rename to plugin/images_not_used/macosx/terminal.png diff --git a/plugin/icons_example/macosx/terminal_icons_by_isgie-d2xgmyw.png b/plugin/images_not_used/macosx/terminal_icons_by_isgie-d2xgmyw.png similarity index 100% rename from plugin/icons_example/macosx/terminal_icons_by_isgie-d2xgmyw.png rename to plugin/images_not_used/macosx/terminal_icons_by_isgie-d2xgmyw.png diff --git a/plugin/icons_example/macosx/url 2.png b/plugin/images_not_used/macosx/url 2.png similarity index 100% rename from plugin/icons_example/macosx/url 2.png rename to plugin/images_not_used/macosx/url 2.png diff --git a/plugin/icons_example/macosx/url.png b/plugin/images_not_used/macosx/url.png similarity index 100% rename from plugin/icons_example/macosx/url.png rename to plugin/images_not_used/macosx/url.png diff --git a/plugin/icons_example/macosx/url@2x 2.png b/plugin/images_not_used/macosx/url@2x 2.png similarity index 100% rename from plugin/icons_example/macosx/url@2x 2.png rename to plugin/images_not_used/macosx/url@2x 2.png diff --git a/plugin/icons_example/macosx/url@2x.png b/plugin/images_not_used/macosx/url@2x.png similarity index 100% rename from plugin/icons_example/macosx/url@2x.png rename to plugin/images_not_used/macosx/url@2x.png diff --git a/plugin/icons_example/png/console_view.png b/plugin/images_not_used/png/console_view.png similarity index 100% rename from plugin/icons_example/png/console_view.png rename to plugin/images_not_used/png/console_view.png diff --git a/plugin/icons_example/png/copy.png b/plugin/images_not_used/png/copy.png similarity index 100% rename from plugin/icons_example/png/copy.png rename to plugin/images_not_used/png/copy.png diff --git a/plugin/icons_example/png/copy_edit.png b/plugin/images_not_used/png/copy_edit.png similarity index 100% rename from plugin/icons_example/png/copy_edit.png rename to plugin/images_not_used/png/copy_edit.png diff --git a/plugin/icons_example/png/copy_edit_co.png b/plugin/images_not_used/png/copy_edit_co.png similarity index 100% rename from plugin/icons_example/png/copy_edit_co.png rename to plugin/images_not_used/png/copy_edit_co.png diff --git a/plugin/icons_example/png/copyviewtoclipboard_tsk.png b/plugin/images_not_used/png/copyviewtoclipboard_tsk.png similarity index 100% rename from plugin/icons_example/png/copyviewtoclipboard_tsk.png rename to plugin/images_not_used/png/copyviewtoclipboard_tsk.png diff --git a/plugin/icons_example/png/cpyqual_menu.png b/plugin/images_not_used/png/cpyqual_menu.png similarity index 100% rename from plugin/icons_example/png/cpyqual_menu.png rename to plugin/images_not_used/png/cpyqual_menu.png diff --git a/plugin/icons_example/png/easyshell.png b/plugin/images_not_used/png/easyshell.png similarity index 100% rename from plugin/icons_example/png/easyshell.png rename to plugin/images_not_used/png/easyshell.png diff --git a/plugin/icons_example/png/easyshell2.png b/plugin/images_not_used/png/easyshell2.png similarity index 100% rename from plugin/icons_example/png/easyshell2.png rename to plugin/images_not_used/png/easyshell2.png diff --git a/plugin/icons_example/png/easyshell_new.png b/plugin/images_not_used/png/easyshell_new.png similarity index 100% rename from plugin/icons_example/png/easyshell_new.png rename to plugin/images_not_used/png/easyshell_new.png diff --git a/plugin/icons_example/png/easyshell_old.png b/plugin/images_not_used/png/easyshell_old.png similarity index 100% rename from plugin/icons_example/png/easyshell_old.png rename to plugin/images_not_used/png/easyshell_old.png diff --git a/plugin/icons_example/png/eclipse.png b/plugin/images_not_used/png/eclipse.png similarity index 100% rename from plugin/icons_example/png/eclipse.png rename to plugin/images_not_used/png/eclipse.png diff --git a/plugin/icons_example/png/editor_area.png b/plugin/images_not_used/png/editor_area.png similarity index 100% rename from plugin/icons_example/png/editor_area.png rename to plugin/images_not_used/png/editor_area.png diff --git a/plugin/icons_example/png/environment_obj.png b/plugin/images_not_used/png/environment_obj.png similarity index 100% rename from plugin/icons_example/png/environment_obj.png rename to plugin/images_not_used/png/environment_obj.png diff --git a/plugin/icons_example/png/exclusion_filter_attrib.png b/plugin/images_not_used/png/exclusion_filter_attrib.png similarity index 100% rename from plugin/icons_example/png/exclusion_filter_attrib.png rename to plugin/images_not_used/png/exclusion_filter_attrib.png diff --git a/plugin/icons_example/png/external_tools.png b/plugin/images_not_used/png/external_tools.png similarity index 100% rename from plugin/icons_example/png/external_tools.png rename to plugin/images_not_used/png/external_tools.png diff --git a/plugin/icons_example/png/file-new-16x16.png b/plugin/images_not_used/png/file-new-16x16.png similarity index 100% rename from plugin/icons_example/png/file-new-16x16.png rename to plugin/images_not_used/png/file-new-16x16.png diff --git a/plugin/icons_example/png/file_obj.png b/plugin/images_not_used/png/file_obj.png similarity index 100% rename from plugin/icons_example/png/file_obj.png rename to plugin/images_not_used/png/file_obj.png diff --git a/plugin/icons_example/png/filenav_nav.png b/plugin/images_not_used/png/filenav_nav.png similarity index 100% rename from plugin/icons_example/png/filenav_nav.png rename to plugin/images_not_used/png/filenav_nav.png diff --git a/plugin/icons_example/png/fldr_obj.png b/plugin/images_not_used/png/fldr_obj.png similarity index 100% rename from plugin/icons_example/png/fldr_obj.png rename to plugin/images_not_used/png/fldr_obj.png diff --git a/plugin/icons_example/png/folder.png b/plugin/images_not_used/png/folder.png similarity index 100% rename from plugin/icons_example/png/folder.png rename to plugin/images_not_used/png/folder.png diff --git a/plugin/icons_example/png/goto_input.png b/plugin/images_not_used/png/goto_input.png similarity index 100% rename from plugin/icons_example/png/goto_input.png rename to plugin/images_not_used/png/goto_input.png diff --git a/plugin/icons_example/png/help.png b/plugin/images_not_used/png/help.png similarity index 100% rename from plugin/icons_example/png/help.png rename to plugin/images_not_used/png/help.png diff --git a/plugin/icons_example/png/home_nav.png b/plugin/images_not_used/png/home_nav.png similarity index 100% rename from plugin/icons_example/png/home_nav.png rename to plugin/images_not_used/png/home_nav.png diff --git a/plugin/icons_example/png/prompt.png b/plugin/images_not_used/png/prompt.png similarity index 100% rename from plugin/icons_example/png/prompt.png rename to plugin/images_not_used/png/prompt.png diff --git a/plugin/icons_example/png/prompt2.png b/plugin/images_not_used/png/prompt2.png similarity index 100% rename from plugin/icons_example/png/prompt2.png rename to plugin/images_not_used/png/prompt2.png diff --git a/plugin/icons_example/png/prompt_old.png b/plugin/images_not_used/png/prompt_old.png similarity index 100% rename from plugin/icons_example/png/prompt_old.png rename to plugin/images_not_used/png/prompt_old.png diff --git a/plugin/icons_example/png/prompt_old2.png b/plugin/images_not_used/png/prompt_old2.png similarity index 100% rename from plugin/icons_example/png/prompt_old2.png rename to plugin/images_not_used/png/prompt_old2.png diff --git a/plugin/icons_example/png/properties.png b/plugin/images_not_used/png/properties.png similarity index 100% rename from plugin/icons_example/png/properties.png rename to plugin/images_not_used/png/properties.png diff --git a/plugin/icons_example/png/run_exc.png b/plugin/images_not_used/png/run_exc.png similarity index 100% rename from plugin/icons_example/png/run_exc.png rename to plugin/images_not_used/png/run_exc.png diff --git a/plugin/icons_example/test/Command Prompt.png b/plugin/images_not_used/test/Command Prompt.png similarity index 100% rename from plugin/icons_example/test/Command Prompt.png rename to plugin/images_not_used/test/Command Prompt.png diff --git a/plugin/icons_example/test/Prompt.png b/plugin/images_not_used/test/Prompt.png similarity index 100% rename from plugin/icons_example/test/Prompt.png rename to plugin/images_not_used/test/Prompt.png diff --git a/plugin/icons_example/test/Terminal (2).png b/plugin/images_not_used/test/Terminal (2).png similarity index 100% rename from plugin/icons_example/test/Terminal (2).png rename to plugin/images_not_used/test/Terminal (2).png diff --git a/plugin/icons_example/test/Terminal (3).png b/plugin/images_not_used/test/Terminal (3).png similarity index 100% rename from plugin/icons_example/test/Terminal (3).png rename to plugin/images_not_used/test/Terminal (3).png diff --git a/plugin/icons_example/test/app_terminal.png b/plugin/images_not_used/test/app_terminal.png similarity index 100% rename from plugin/icons_example/test/app_terminal.png rename to plugin/images_not_used/test/app_terminal.png diff --git a/plugin/icons_example/test/app_terminal_16x16.png b/plugin/images_not_used/test/app_terminal_16x16.png similarity index 100% rename from plugin/icons_example/test/app_terminal_16x16.png rename to plugin/images_not_used/test/app_terminal_16x16.png diff --git a/plugin/icons_example/test/terminal (1).png b/plugin/images_not_used/test/terminal (1).png similarity index 100% rename from plugin/icons_example/test/terminal (1).png rename to plugin/images_not_used/test/terminal (1).png diff --git a/plugin/icons_example/test/terminal-19.png b/plugin/images_not_used/test/terminal-19.png similarity index 100% rename from plugin/icons_example/test/terminal-19.png rename to plugin/images_not_used/test/terminal-19.png diff --git a/plugin/icons_example/test/terminal-icon.png b/plugin/images_not_used/test/terminal-icon.png similarity index 100% rename from plugin/icons_example/test/terminal-icon.png rename to plugin/images_not_used/test/terminal-icon.png diff --git a/plugin/icons_example/test/terminal.gif b/plugin/images_not_used/test/terminal.gif similarity index 100% rename from plugin/icons_example/test/terminal.gif rename to plugin/images_not_used/test/terminal.gif diff --git a/plugin/icons_example/test/terminal.png b/plugin/images_not_used/test/terminal.png similarity index 100% rename from plugin/icons_example/test/terminal.png rename to plugin/images_not_used/test/terminal.png diff --git a/plugin/icons_example/test/terminal.svg b/plugin/images_not_used/test/terminal.svg similarity index 100% rename from plugin/icons_example/test/terminal.svg rename to plugin/images_not_used/test/terminal.svg diff --git a/plugin/icons_example/test/terminal_16x16.png b/plugin/images_not_used/test/terminal_16x16.png similarity index 100% rename from plugin/icons_example/test/terminal_16x16.png rename to plugin/images_not_used/test/terminal_16x16.png diff --git a/plugin/plugin.xml b/plugin/plugin.xml index 46fb4b07..6d3b8156 100644 --- a/plugin/plugin.xml +++ b/plugin/plugin.xml @@ -128,7 +128,7 @@ = Version.v2_0_003.getId()) { basicData.setUseWorkingDirectory(Boolean.valueOf(tokenizer.nextToken()).booleanValue()); basicData.setWorkingDirectory(tokenizer.nextToken()); @@ -299,6 +267,9 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni categoryStr = "categoryUser"; } setCategory(Category.getFromEnum(categoryStr)); + if (version.getId() >= Version.v2_1_005.getId()) { + imageIdStr = tokenizer.nextToken(); + } setCommandType(CommandType.getFromEnum(tokenizer.nextToken())); } else { basicData.setUseWorkingDirectory(false); @@ -307,6 +278,7 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni setCategory(Category.getFromDeprecatedCommandTypeEnum(commandTypeStr)); setCommandType(CommandType.getFromDeprecatedCommandTypeEnum(commandTypeStr)); } + setImageId(imageIdStr); // go on compatible String commandTokenizer = CommandTokenizer.commandTokenizerSpaces.toString(); if (version.getId() >= Version.v2_1_001.getId()) { @@ -350,6 +322,9 @@ public String serialize(Version version, String delimiter) { ret += Boolean.toString(basicData.isUseWorkingDirectory()) + delimiter; ret += basicData.getWorkingDirectory() + delimiter; ret += getCategory().toString() + delimiter; + if (version.getId() >= Version.v2_1_005.getId()) { + ret += getImageIdOwn() + delimiter; + } } ret += getCommandType().toString() + delimiter; if (version.getId() >= Version.v2_1_001.getId()) { diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataDialog.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataDialog.java index d77ddcab..cbb52dab 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataDialog.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataDialog.java @@ -30,7 +30,6 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; @@ -441,7 +440,7 @@ public void widgetDefaultSelected(SelectionEvent e) { private void createCategoryCombo(Composite parent) { // draw label UtilsUI.createLabel(parent, Activator.getResourceString("easyshell.command.editor.dialog.label.combo.category"), Activator.getResourceString("easyshell.command.editor.dialog.label.tooltip.category")); - categoryImage = UtilsUI.createImageLabel(parent, Category.categoryDefault.getIcon()); + categoryImage = UtilsUI.createImageLabel(parent, Category.categoryUnknown.getImageId()); // draw combo categoryCombo = new Combo(parent,SWT.BORDER | SWT.READ_ONLY); categoryCombo.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.combo.tooltip.category")); @@ -452,7 +451,7 @@ private void createCategoryCombo(Composite parent) { @Override public void widgetSelected(SelectionEvent e) { String text = categoryCombo.getItem(categoryCombo.getSelectionIndex()); - categoryImage.setImage(new Image(null, Activator.getImageDescriptor(Category.getFromName(text).getIcon()).getImageData())); + categoryImage.setImage(Activator.getImage(Category.getFromName(text).getImageId())); } @Override public void widgetDefaultSelected(SelectionEvent e) { diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataLabelProvider.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataLabelProvider.java index 6d254297..d0a30e95 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataLabelProvider.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandDataLabelProvider.java @@ -26,7 +26,7 @@ public Image getColumnImage(Object element, int columnIndex) { CommandData data = (CommandData)element; switch(columnIndex) { case 0: - return new Image(null, Activator.getImageDescriptor(data.getCategory().getIcon()).getImageData()); + return Activator.getImage(data.getImageId()); default: return null; } diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuData.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuData.java index 049a273b..e3dacfab 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuData.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuData.java @@ -14,6 +14,7 @@ import java.util.StringTokenizer; import java.util.UUID; +import de.anbos.eclipse.easyshell.plugin.Constants; import de.anbos.eclipse.easyshell.plugin.exceptions.UnknownCommandID; import de.anbos.eclipse.easyshell.plugin.types.Category; import de.anbos.eclipse.easyshell.plugin.types.MenuNameType; @@ -26,18 +27,20 @@ public class MenuData extends Data { private boolean enabled = true; private MenuNameType nameType = MenuNameType.menuNameTypeUnknown; private String namePattern = ""; + private String imageId = Constants.IMAGE_NONE; // copy of or reference to command private String commandId = null; - public MenuData(String id, boolean enabled, MenuNameType nameType, String namePattern, String commandId) { + public MenuData(String id, boolean enabled, MenuNameType nameType, String namePattern, String imageId, String commandId) { super(id); setEnabled(enabled); setNameType(nameType); setNamePattern(namePattern); + setImageId(imageId); setCommandId(commandId); } - public MenuData(String newId, String commandId) { + public MenuData(String newId, String commandId) { super(newId); setNameType(MenuNameType.menuNameTypeGeneric1); setCommandId(commandId); @@ -90,6 +93,22 @@ public String toString() { return getNameExpanded(); } + public String getImageId() { + if (!imageId.equals(Constants.IMAGE_NONE)) { + return imageId; + } else { + try { + return getCommandData().getImageId(); + } catch (UnknownCommandID e) { + return Constants.IMAGE_NONE; + } + } + } + + public String getImageIdOwn() { + return imageId; + } + public String getCommandId() { return commandId; } @@ -128,12 +147,15 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni nameType = MenuNameType.getFromEnum(tokenizer.nextToken()); } String namePatternReaded = tokenizer.nextToken(); + String imageIdStr = Constants.IMAGE_NONE; // ------------------------------------------------- - // read new id + // read new imageId and commandId if (version.getId() >= Version.v2_0_003.getId()) { + if (version.getId() >= Version.v2_1_005.getId()) { + imageIdStr = tokenizer.nextToken(); + } // read the new one setCommandId(tokenizer.nextToken()); - setNameType(nameType); } else { // read previous command data members CommandData oldData = new CommandData(); @@ -141,9 +163,7 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni setCommandId(oldData.getId()); // menu name type handling // set name type and read the old name as pattern and convert to new - if (version.getId() >= Version.v2_0_002.getId()) { - setNameType(nameType); - } else { + if (version.getId() < Version.v2_0_002.getId()) { // check if readed name is the same, like expanded from patterns for (MenuNameType type : MenuNameType.getAsList()) { setNamePattern(type.getPattern()); // set temporary @@ -152,9 +172,9 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni break; } } - setNameType(nameType); } } + setNameType(nameType); if (nameType == MenuNameType.menuNameTypeUser) { setNamePattern(namePatternReaded); } else if (version.getId() < Version.v2_0_004.getId()) { @@ -163,6 +183,7 @@ public boolean deserialize(Version version, String value, StringTokenizer tokeni setNameTypeFromCategory(); } } + setImageId(imageIdStr); return true; } @@ -179,6 +200,9 @@ public String serialize(Version version, String delimiter) { } ret += getNamePattern() + delimiter; if (version.getId() >= Version.v2_0_003.getId()) { + if (version.getId() >= Version.v2_1_005.getId()) { + ret += getImageIdOwn() + delimiter; + } ret += getCommandId() + delimiter; } else { try { @@ -211,6 +235,14 @@ public void setNamePattern(String namePattern) { } } + public void setImageId(String imageId) { + if (imageId != null) { + this.imageId = imageId; + } else { + this.imageId = Constants.IMAGE_NONE; + } + } + public void setCommandId(String commandId) { this.commandId = commandId; } @@ -225,6 +257,15 @@ public CommandData getCommandData() throws UnknownCommandID { } } + public String getCommand() { + try { + return getCommandData().getCommand(); + } catch (UnknownCommandID e) { + e.logInternalError(); + return "Unknown ID: " + e.getID(); + } + } + public void setNameTypeFromCategory() { try { setNameTypeFromCategory(getCommandData().getCategory()); diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataDialog.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataDialog.java index acea4bb4..006f4672 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataDialog.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataDialog.java @@ -68,6 +68,7 @@ public class MenuDataDialog extends StatusDialog { private Combo nameTypeCombo; private Text namePatternText; ContentProposalAdapter namePatternTextAssist; + private Button categoryImageButton; private Text menuNameText; private Text commandText; @@ -172,7 +173,7 @@ public Group createGroupMenu(Composite parent) { pageGroupMenu.setText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.menu")); pageGroupMenu.setToolTipText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.tooltip.menu")); GridLayout layoutMenu = new GridLayout(); - layoutMenu.numColumns = 2; + layoutMenu.numColumns = 3; layoutMenu.makeColumnsEqualWidth = false; layoutMenu.marginWidth = 5; layoutMenu.marginHeight = 4; @@ -195,12 +196,7 @@ public void createCommandControls(Composite parent) { // create input commandText field String commandStr; - try { - commandStr = menuData.getCommandData().getCommand(); - } catch (UnknownCommandID e1) { - e1.logInternalError(); - commandStr = "Unknown ID: " + e1.getID(); - } + commandStr = menuData.getCommand(); commandText = UtilsUI.createTextField(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.command"), Activator.getResourceString("easyshell.menu.editor.dialog.label.tooltip.command"), commandStr, false, false); //createLabel(parent, "");createLabel(parent, ""); @@ -212,9 +208,9 @@ public void createCommandControls(Composite parent) { public void createNameControls(Composite parent) { // type combo - createNameTypeCombo(parent);//UtilsUI.createLabel(parent, "", null); + createNameTypeCombo(parent); // create input nameText field - namePatternText = UtilsUI.createTextField(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.pattern"), Activator.getResourceString("easyshell.menu.editor.dialog.label.tooltip.pattern"), menuData.getNamePattern(), false, true); + namePatternText = UtilsUI.createTextField(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.pattern"), Activator.getResourceString("easyshell.menu.editor.dialog.label.tooltip.pattern"), menuData.getNamePattern(), true, true); namePatternTextAssist = addContentAssistExtended(namePatternText); namePatternText.addModifyListener(new ModifyListener() { @Override @@ -227,10 +223,21 @@ public void modifyText(ModifyEvent e) { } } }); - //UtilsUI.createLabel(parent, "", null); // create output menuNameText field - menuNameText = UtilsUI.createTextField(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.name"), Activator.getResourceString("easyshell.menu.editor.dialog.label.tooltip.name"), menuData.getNameExpanded(), false, false); - //UtilsUI.createLabel(parent, "", null); + UtilsUI.createLabel(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.name"), Activator.getResourceString("easyshell.menu.editor.dialog.label.tooltip.name")); + //categoryImage = UtilsUI.createImageLabel(parent, Category.categoryDefault.getIcon()); + categoryImageButton = UtilsUI.createImageButton(parent, Category.categoryDefault.getImageId()); + categoryImageButton.addSelectionListener(new SelectionListener() { + @Override + public void widgetSelected(SelectionEvent e) { + //imageDialog(); + } + @Override + public void widgetDefaultSelected(SelectionEvent e) { + // TODO Auto-generated method stub + } + }); + menuNameText = UtilsUI.createTextField(parent, null, null, menuData.getNameExpanded(), false, false); } private void createRemoveButton(Composite parent) { @@ -499,7 +506,6 @@ private void createEnabledCheckBox(Composite parent) { enabledCheckBox = new Button(parent,SWT.CHECK); enabledCheckBox.setSelection(this.menuData.isEnabled()); UtilsUI.createLabel(parent, "", null); - //UtilsUI.createLabel(parent, "", null); } private String[] getAllNameTypesAsComboNames() { @@ -536,7 +542,6 @@ public void keyReleased(KeyEvent ke) { } }); searchText.setToolTipText(Activator.getResourceString("easyshell.command.page.text.tooltip.search")); - //createLabel(parent, ""); } private void createCommandCombo(Composite parent) { @@ -555,13 +560,15 @@ public void selectionChanged(TypedComboBox typedComboBox, CommandDa } String commandStr = null; PresetType presetType = PresetType.presetPlugin; + Category category = Category.categoryUnknown; try { - commandStr = menuData.getCommandData().getCommand(); + commandStr = menuData.getCommand(); presetType = menuData.getCommandData().getPresetType(); + category = menuData.getCommandData().getCategory(); } catch (UnknownCommandID e) { e.logInternalError(); - commandStr = "Unknown ID: " + e.getID(); } + categoryImageButton.setImage(Activator.getImage(category.getImageId())); commandText.setText(commandStr); boolean presetSelected = presetType == PresetType.presetPlugin; removeButton.setEnabled(!presetSelected); @@ -586,7 +593,7 @@ public String getListLabel(CommandData element) { @Override public Image getImage(CommandData element) { - return element.getCategoryImage(); + return Activator.getImage(element.getImageId()); } }); @@ -622,6 +629,7 @@ public void modifyText(ModifyEvent e) { private void createNameTypeCombo(Composite parent) { UtilsUI.createLabel(parent, Activator.getResourceString("easyshell.menu.editor.dialog.label.combo.pattern"), Activator.getResourceString("easyshell.menu.editor.dialog.combo.tooltip.pattern")); + UtilsUI.createLabel(parent, "", null); // draw combo nameTypeCombo = new Combo(parent,SWT.BORDER | SWT.READ_ONLY); nameTypeCombo.setToolTipText(Activator.getResourceString("easyshell.menu.editor.dialog.combo.tooltip.pattern")); diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataLabelProvider.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataLabelProvider.java index 1290c249..c268c7f9 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataLabelProvider.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuDataLabelProvider.java @@ -16,8 +16,6 @@ import org.eclipse.swt.graphics.Image; import de.anbos.eclipse.easyshell.plugin.Activator; -import de.anbos.eclipse.easyshell.plugin.Constants; -import de.anbos.eclipse.easyshell.plugin.exceptions.UnknownCommandID; public class MenuDataLabelProvider extends LabelProvider implements ITableLabelProvider { @@ -26,17 +24,12 @@ public Image getColumnImage(Object element, int columnIndex) { return null; } MenuData data = (MenuData)element; - try { - switch(columnIndex) { - case 0: - return new Image(null, Activator.getImageDescriptor(data.getCommandData().getCategory().getIcon()).getImageData()); - default: - return null; - } - } catch (UnknownCommandID e) { - e.logInternalError(); - return new Image(null, Activator.getImageDescriptor(Constants.IMAGE_ECLIPSE).getImageData()); - } + switch(columnIndex) { + case 0: + return Activator.getImage(data.getImageId()); + default: + return null; + } } public String getColumnText(Object element, int columnIndex) { @@ -44,20 +37,14 @@ public String getColumnText(Object element, int columnIndex) { return ""; //$NON-NLS-1$ } MenuData data = (MenuData)element; - try { - switch(columnIndex) { - case 0: - return data.getNameExpanded(); - case 1: - return data.getCommandData().getCommand(); - default: - return ""; //$NON-NLS-1$ - } - } catch (UnknownCommandID e) { - e.logInternalError(); - return "Unknown ID: " + e.getID(); - } - + switch(columnIndex) { + case 0: + return data.getNameExpanded(); + case 1: + return data.getCommand(); + default: + return ""; //$NON-NLS-1$ + } } } diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Category.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Category.java index 30d141e4..96b6fa69 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Category.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Category.java @@ -19,7 +19,7 @@ import de.anbos.eclipse.easyshell.plugin.Constants; public enum Category { - categoryUnknown(-1, "Unknown", Constants.IMAGE_UNKNOWN), + categoryUnknown(-1, "Unknown", Constants.IMAGE_NONE), categoryDefault(0, "Default", Constants.IMAGE_DEFAULT), categoryOpen(1, "Open", Constants.IMAGE_OPEN), categoryRun(2, "Run", Constants.IMAGE_RUN), @@ -29,12 +29,12 @@ public enum Category { // attributes private final int id; private final String name; - private final String icon; + private final String imageId; // construct - Category(int id, String name, String icon) { + Category(int id, String name, String imageId) { this.id = id; this.name = name; - this.icon = icon; + this.imageId = imageId; } public int getId() { return id; @@ -42,8 +42,8 @@ public int getId() { public String getName() { return name; } - public String getIcon() { - return icon; + public String getImageId() { + return imageId; } public static Category getFromId(int id) { Category ret = categoryUnknown; @@ -102,11 +102,11 @@ public static String[] getNamesAsArray() { } return arr; } - public static List getIconsAsList() { + public static List getImageIdsAsList() { List list = new ArrayList(); for(int i = 0; i < Category.values().length; i++) { if (Category.values()[i] != categoryUnknown) { - list.add(Category.values()[i].getIcon()); + list.add(Category.values()[i].getImageId()); } } return list; diff --git a/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Version.java b/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Version.java index 1e4a9771..a7828865 100644 --- a/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Version.java +++ b/plugin/src/de/anbos/eclipse/easyshell/plugin/types/Version.java @@ -28,7 +28,8 @@ public enum Version { v2_1_001(8, "v2.1 alpha 1"), v2_1_002(9, "v2.1 alpha 2"), v2_1_003(10, "v2.1 beta 1 / 2"), - v2_1_004(11, "v2.1 beta 3"); + v2_1_004(11, "v2.1 beta 3"), + v2_1_005(12, "v2.1 RC1"); // actual version is always the last one! public static Version actual = Version.values()[Version.values().length-1]; // attributes