Settings icons in Java Control for XPages - xpages

I am creating Java Control for XPage using this tutorial. I have successfully created the control but I am unable to set icon for which would show up in the Control palette.
My xsp-config file has the following snippet for icon
<faces-config>
<...>
<component>
<...>
<icon>
<small-icon>/icons/icon16.gif</small-icon>
<large-icon>/icons/icon32.gif</large-icon>
</icon>
</component>
</faces-config>
I stored my icons in folder WebContent > WEB-INF > icons. But it did not work. So I created a created icon folder inside src folder (which is where my Java class files are stored and it is added to Java build path) and stored icons there. But that didn't work either. In both cases I get a red square as icon for my control in the palette.
How can I show icons for my Java Control and where the icons be stored for the same?

Store your icons in folder icons at top level of your project in package explorer.
Then, your xsp config file will work and control's icon will show up.

Related

SVG toolbar icons in VS Code extension

The documentation says you can't reference SVG from markdown, but I didn't see anything saying I couldn't use it for toolbar icons. I've done just that, and an icon that works perfectly in the extension host is missing when I package and install from a VSIX.
Is SVG also disallowed for toolbar icons within an extension? If I must render bitmaps, in what format and at what resolutions? Is there detailed guidance on this that I have failed to read?
SVG is supported.
Files in project-root/src are not bundled. Put the icons anywhere other than the src folder and they will be bundled. (I certainly snatched defeat from the jaws of victory with that one!)

How to use svg icons in a web content of Liferay

I use liferay 7.1 (ga2) and I'm developing a theme (with theme generator). I have a problem with svg icon in a web content.
I added a directory images (in / src), containing a svg directory which in turn contains (a sprite) svg icons.
In a web content, I would like to invoke these svg icons, for example with the HTML statement:
<svg class="icon">
<use xlink:href="./images/svg/sprite.svg#icona1"></use>
</svg>
I tried different path (href). The main problem is that as soon as I save the web content, Liferay automatically translates the previous code into:
<svg class="icon">
</svg>
Therefore, the part relative to the path ('use' tag) is deleted. And the icons, of course, are not visible.
Why?
What should I do to include svg icons in a web content?
Thank you
​​​​​​​Francesco
Your issue has nothing to do with the path or using a Liferay tag or not (tags would not even have any effect if included inside those items via editors). It seems to be a simple editor issue, which is the root cause of your problem.
You will need to configure your editor to accept the use tag and avoid its removal when web content items are cleaned up, prior to saving.
https://www.e-systems.tech/blog/-/blogs/editor-configuration-contributor
#Victor is correct.
I'll also add, these are WYSIWYG Editors, not HTML editors. Source really shouldn't be edited manually. Source View is only there for convenience.
If you want explicit markup, use a Web Content Structure.
ok, I solved.
The problem is not the editor nor liferay.
The problem is that if I compile and build the bootstrap theme, in /dist dir (of bootstrap theme) I have the sprite.svg, while in /src (of bootstrap theme) I have the individual icons.
I loaded the individual icons.
Instead, if I copy the sprite.svg (of bootstrap theme) in /src/images/svg (of liferay theme), then everything is ok. Also from web content.
Thank you all.
Francesco

Openlayers 3 does not display icons in FireFox or Chrome

I have a problem displaying icons on an OpenLayers map when viewing the map in FireFox and Chrome. To isolate this behavior I created an Openlayers 3 script that displays icons on a map by loading data from a KML file. The script I'm using is based upon this Openlayers example:
http://openlayers.org/en/v3.4.0/examples/kml.html
Modifications to this script include reference my KML source file and the type of map to display.
Icons display properly when the kml icon reference url points to Google like:
<Icon>
<href>http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_red.png</href>
</Icon>
But when I change the icon reference to the same icon located on my server, the icon is not visible in Chrome or FireFox.
<Icon>
<href>http://www.photoradius.com/data/assets/icons/mm_20_brown.png</href>
</Icon>
In all of my test cases, the icons display as expected in IE.
For reference, here are example files:
1) Icons display as expected in all browsers:
http://photoradius.com/debugol3/kml_google.htm
icon reference in kml file:
http://maps.gstatic.com/mapfiles/ridefinder-images/mm_20_red.png
2) Icons do NOT display in Chrome or FireFox (but do in IE)
http://photoradius.com/debugol3/kml_local.htm
icon reference in kml file:
http://www.photoradius.com/debugol3/icons/mm_20_brown.png
So the only difference in the two examples I've created is the location of the icon. If the icon is located on the Google server, it is plotted in all browsers. If it resides on my server, only IE plots the icons.
Any advice will be welcome.
Regards.

android studio : dpi folders not showing in my project

in my project, the images folder is displayed according to the image name instead of
drawable
drawbale-hdpi
drawbale-mdpi
drawbale-xdpi
drawbale-xxdpi
I see the folders in most of the tutorial when they create a new project,
and I just follow to start my new project without any setting be changed.
Do I have to change some setting?
From your first screenshot, it seems you're in the Android view of your Project tab. Click the top left drop down (again from the first screenshot), and change it to Project. Then if you would navigate to your res/ folder you would see all of the DPIs first instead.
Additionally, you could also expand the icon1.png in that current Android view as it is a folder. Therein you would find all of your icons matching that name in every DPI you had them available.
Android View's res/ sorts by drawable name.
Project View's res/ sorts by DPI.

JavaFx2 ImageView with icon displays in Scenebuilder but does not display during runtime

In Scenebuilder I added an Imageview to a gridpane and selected an icon as a jpeg image. I stored the icon in My Documents\NetBeansProjects\MyProject.
It shows up fine in Scenebuilder however when I run the program, no icon shows.
In Scenebuilder 1.1 I added an Imageview to a gridpane and selected an icon as a jpeg image. I stored the icon in My Documents\NetBeansProjects\MyProject. It shows up fine in Scenebuilder however when I run the program, no icon shows.
Here is the tag in my fxml file
<ImageView fitHeight="36.28910772144808" fitWidth="96.66667175292969" pickOnBounds="true" preserveRatio="true" GridPane.columnIndex="0" GridPane.rowIndex="0">
<image>
<Image url="#../../my_pic.JPG" />
</image>
</ImageView>
Windows XP, NetBeans 7.1, Java 7
Put all your images in the "src" subdirectory of the project. And then choose them from the Scene Builder.
When you compile your project, the image files in the "src" subdirectory will be included into the jar-file.
Scenebuilder is independent of NetBeans. One has to manually copy over the image files to the src/ folder before running.

Resources