Hello everybody,
I have an action implemented and when we press a button we execute it. The thing is that i want to use a Custom button in order to use my particular icon image.
CustomContext cc = new CustomContext(new PictogramElement[] { pe });
(1) This does not work:
if (iCustomFeature instanceof ActionAddAttributeFeature) {
IContextButtonEntry attButton = new ContextButtonEntry(iCustomFeature, context);
attButton.setText("Create attribute");
attButton.setIconId(ImageProvider.IMG_EREFERENCE);
data.getDomainSpecificContextButtons().add(attButton);
}
(2) This works:
if (iCustomFeature instanceof ActionAddAttributeFeature) {
IContextButtonEntry collapseButton = ContextEntryHelper.
createCollapseContextButton(true, iCustomFeature, cc);
data.getDomainSpecificContextButtons().add(collapseButton);
}
Both cases are the same. In the first one we create a custom button and in the second one we create a precreated one. in (2) the button works perfectly (but the icon is the collapse icon and is not what i want) and in (1) the icon appears correctly (the image that I set in the action class) but it appears disabled and I cannot press it.
If someone can help with the solution it would be really appreciated.
Best regards,
Víctor.