if (checked) {
int left = toothWidget.getToothImage().getAbsoluteLeft();
int top = toothWidget.getVPanel().getAbsoluteTop();//toothWidget.getToothImage().getAbsoluteTop();
Image im = new Image();
im.setUrl("images/"+ toothWidget.getToothNumber()+ menuItem.getImg());
int offx = left;
int offy = top;
final PopupPanel popup = new PopupPanel();
popup.setStylePrimaryName("transparent");
popup.setPopupPosition(Math.max(offx, 0),Math.max(offy, 0));
//popup.add(im);
ToothWidget wgt = new ToothWidget(toothWidget.getToothNumber(),toothWidget.getToothNumber()+menuItem.getImg(), toothWidget.getTeeth());
toothWidget.getTeeth().getMap().get(toothWidget.getToothNumber()).put(menuItem.getName(), wgt);
wgt.setMenu(toothWidget.getMenu());
wgt.setPanel(popup);
popup.add(wgt);
popup.show();
}
else {
ToothWidget wgt = toothWidget.getTeeth().getMap().get(toothWidget.getToothNumber()).remove(menuItem.getName());
wgt.getPanel().hide();
}
答案 0 :(得分:0)
为什么不使用调试器来确定代码的哪个部分不能按预期工作? 也许你的else-block没有到达,或者toothWidget.gePanel()没有返回你的PopupPanel ..