// special case that uses another method. Really should fix the
// Util.setWidthExcludingPaddingAndBorder method but that will
// probably break additional cases
- int requestedPixelWidth = Integer.parseInt(width.substring(0, width
- .length() - 2));
+ int requestedPixelWidth = Integer.parseInt(width.substring(0,
+ width.length() - 2));
int paddingBorder = Util.measureHorizontalPaddingAndBorder(
getElement(), 0);
int w = requestedPixelWidth - paddingBorder;
itemHTML.append(moreItemText);
moreItem = new CustomMenuItem(itemHTML.toString(), emptyCommand);
- collapsedRootItems = new VMenuBar(true, (VMenuBar) client
- .getPaintable(uidlId));
+ collapsedRootItems = new VMenuBar(true,
+ (VMenuBar) client.getPaintable(uidlId));
moreItem.setSubMenu(collapsedRootItems);
moreItem.addStyleName(CLASSNAME + "-more-menuitem");
}
itemHTML.append("<span class=\"" + CLASSNAME
+ "-menuitem-caption\">");
if (item.hasAttribute("icon")) {
- itemHTML
- .append("<img src=\""
- + client.translateVaadinUri(item
- .getStringAttribute("icon"))
- + "\" class=\"" + Icon.CLASSNAME
- + "\" alt=\"\" />");
+ itemHTML.append("<img src=\""
+ + client.translateVaadinUri(item
+ .getStringAttribute("icon"))
+ + "\" class=\"" + Icon.CLASSNAME + "\" alt=\"\" />");
}
itemHTML.append(Util.escapeHTML(itemText) + "</span>");
if (items.contains(item)) {
int index = items.indexOf(item);
- DOM.removeChild(getContainerElement(), DOM.getChild(
- getContainerElement(), index));
+ DOM.removeChild(getContainerElement(),
+ DOM.getChild(getContainerElement(), index));
items.remove(index);
}
}
popup.show();
if (left + popup.getOffsetWidth() >= RootPanel.getBodyElement()
- .getOffsetWidth()
- - shadowSpace) {
+ .getOffsetWidth() - shadowSpace) {
if (subMenu) {
left = item.getParentMenu().getAbsoluteLeft()
- popup.getOffsetWidth() - shadowSpace;
}
if (popup.getElement().getStyle().getProperty("width") == null
- || popup.getElement().getStyle().getProperty(
- "width") == "") {
+ || popup.getElement().getStyle()
+ .getProperty("width") == "") {
popup.setWidth(popup.getOffsetWidth() + "px");
}
popup.getElement().getStyle().setProperty("zoom", "1");
* .gwt.event.dom.client.KeyPressEvent)
*/
public void onKeyPress(KeyPressEvent event) {
- if (handleNavigation(event.getNativeEvent().getKeyCode(), event
- .isControlKeyDown()
- || event.isMetaKeyDown(), event.isShiftKeyDown())) {
+ if (handleNavigation(event.getNativeEvent().getKeyCode(),
+ event.isControlKeyDown() || event.isMetaKeyDown(),
+ event.isShiftKeyDown())) {
event.preventDefault();
}
}
* .event.dom.client.KeyDownEvent)
*/
public void onKeyDown(KeyDownEvent event) {
- if (handleNavigation(event.getNativeEvent().getKeyCode(), event
- .isControlKeyDown()
- || event.isMetaKeyDown(), event.isShiftKeyDown())) {
+ if (handleNavigation(event.getNativeEvent().getKeyCode(),
+ event.isControlKeyDown() || event.isMetaKeyDown(),
+ event.isShiftKeyDown())) {
event.preventDefault();
}
}
* .dom.client.FocusEvent)
*/
public void onFocus(FocusEvent event) {
- // Focus the first element directly, so the keyboard focus becomes
- // visible
- setSelected(items.get(0));
+
}
private final String SUBPART_PREFIX = "item";