Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Scout/HowTo/3.7/Add an icon"
(New page: ===== Add the icon file to the project ===== In the shared project (e.g. tutorialMiniCrm.shared.tutorialMiniCrm) add the icon file to the resources/icons folder. Scout supports a lot of...) |
Dev.jmini.fr (Talk | contribs) m (+images) |
||
Line 31: | Line 31: | ||
import tutorialMiniCrm.shared.tutorialMiniCrm.Icons; | import tutorialMiniCrm.shared.tutorialMiniCrm.Icons; | ||
− | Of course the new icon is listed in the icon editor in the Scout SDK (Project > Shared > Icons > Scout Object Properties > Open icons editor). It is also available in the icon chooser field in order to configure quickly your GUI. | + | Of course the new icon is listed in the icon editor in the Scout SDK (Project > Shared > Icons > Scout Object Properties > Open icons editor). |
+ | |||
+ | [[Image:IconEditor.png]] | ||
+ | |||
+ | It is also available in the icon chooser field in order to configure quickly your GUI. | ||
+ | |||
+ | [[Image:IconChooser.png]] | ||
[[Category:Scout_How_To]] | [[Category:Scout_How_To]] |
Revision as of 04:40, 17 June 2010
Add the icon file to the project
In the shared project (e.g. tutorialMiniCrm.shared.tutorialMiniCrm) add the icon file to the resources/icons folder.
Scout supports a lot of picture format. You can use a PNG file that has a size of 16*16 pixels.
Link your file to your application
Open the Icons class in the shared project (e.g. tutorialMiniCrm.shared.tutorialMiniCrm.Icons) and add a new line like this:
public static final String UserHome ="home_red";
- Name of the constant is the name that you will use in your application. (e.g. UserHome)
- Value is the name of your file without the extension. (e.g. home_red.png)
Use your icon
When you need to provide an Icon you can now use the Icons class. For example:
@Override protected String getConfiguredIconId(){ return Icons.UserHome; }
With the appropriate import:
import tutorialMiniCrm.shared.tutorialMiniCrm.Icons;
Of course the new icon is listed in the icon editor in the Scout SDK (Project > Shared > Icons > Scout Object Properties > Open icons editor).
It is also available in the icon chooser field in order to configure quickly your GUI.