Issue #203 change disposing of the green box in volume browser menus
Former-commit-id:3c956d39cc
[formerlya6af23b84a
] [formerly9de1132ae7
] [formerly9de1132ae7
[formerlyd651a52e44
]] [formerly3c956d39cc
[formerlya6af23b84a
] [formerly9de1132ae7
] [formerly9de1132ae7
[formerlyd651a52e44
]] [formerlyb4e8701480
[formerly9de1132ae7
[formerlyd651a52e44
] [formerlyb4e8701480
[formerly acbed0a965c99b946ede87c5e4bd159bc13855a4]]]]] Former-commit-id:b4e8701480
Former-commit-id:34661bbfc0
[formerly1d0776ecc9
] [formerly7460ec88a2
] [formerly 82a7d8c3fc31d5d9b8c0aebad387ad376d3ec794 [formerly b7c35ce3c6db1fa125e478f709b81d11040cbbd7] [formerly7460ec88a2
[formerly4816f78bc6
]]] Former-commit-id: f428306062626a30148611d20e1656383f2d2ced [formerly fde4372a57091b06e6c85af8054aa3e72285b29b] [formerlyd1c03c44e0
[formerly645f764fd2
]] Former-commit-id:d1c03c44e0
Former-commit-id:dc0b48eccb
This commit is contained in:
parent
d507c4b00e
commit
37d0d9d83a
1 changed files with 12 additions and 7 deletions
|
@ -39,6 +39,8 @@ public class MenuContributionItem extends ContributionItem {
|
|||
|
||||
protected MenuContribution menuContribution;
|
||||
|
||||
protected Image image;
|
||||
|
||||
public MenuContributionItem(MenuContribution contribution) {
|
||||
this.menuContribution = contribution;
|
||||
}
|
||||
|
@ -131,11 +133,18 @@ public class MenuContributionItem extends ContributionItem {
|
|||
widget.dispose();
|
||||
widget = null;
|
||||
}
|
||||
if (image != null) {
|
||||
image.dispose();
|
||||
image = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void markDataAvailable(boolean available) {
|
||||
if (available == true) {
|
||||
createMenuImage();
|
||||
if (image == null) {
|
||||
createMenuImage();
|
||||
}
|
||||
widget.setImage(image);
|
||||
} else {
|
||||
widget.setImage(null);
|
||||
}
|
||||
|
@ -145,16 +154,12 @@ public class MenuContributionItem extends ContributionItem {
|
|||
int imgWidth = 10;
|
||||
int imgHeight = 10;
|
||||
|
||||
Image menuImg = new Image(widget.getDisplay(), imgWidth, imgHeight);
|
||||
image = new Image(widget.getDisplay(), imgWidth, imgHeight);
|
||||
|
||||
GC gc = new GC(menuImg);
|
||||
GC gc = new GC(image);
|
||||
drawImage(gc, imgWidth, imgHeight);
|
||||
|
||||
gc.dispose();
|
||||
|
||||
widget.setImage(menuImg);
|
||||
|
||||
menuImg.dispose();
|
||||
}
|
||||
|
||||
private void drawImage(GC gc, int imgWidth, int imgHeight) {
|
||||
|
|
Loading…
Add table
Reference in a new issue