Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Button icon disabled(Button icon disabled in some particular cases)
Button icon disabled [message #1226015] Tue, 31 December 2013 12:31 Go to next message
Victor Lopez is currently offline Victor LopezFriend
Messages: 21
Registered: August 2013
Junior Member
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.
Re: Button icon disabled [message #1226033 is a reply to message #1226015] Tue, 31 December 2013 13:30 Go to previous message
Victor Lopez is currently offline Victor LopezFriend
Messages: 21
Registered: August 2013
Junior Member
Sorry I found it.

is:
if (iCustomFeature instanceof ActionAddAttributeFeature) {
    IContextButtonEntry attButton =  new ContextButtonEntry(iCustomFeature, cc);
    attButton.setText("Create attribute");
    attButton.setIconId(ImageProvider.IMG_EREFERENCE);
    data.getDomainSpecificContextButtons().add(attButton);
}


instead of:
if (iCustomFeature instanceof ActionAddAttributeFeature) {
    IContextButtonEntry attButton =  new ContextButtonEntry(iCustomFeature, context);
    attButton.setText("Create attribute");
    attButton.setIconId(ImageProvider.IMG_EREFERENCE);
    data.getDomainSpecificContextButtons().add(attButton);
}
Previous Topic:Generate an image from a diagram
Next Topic:Save button method in code
Goto Forum:
  


Current Time: Sat Aug 08 14:46:38 GMT 2020

Powered by FUDForum. Page generated in 0.02016 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top