List of usage examples for com.google.gwt.dom.client Style clearWidth
public void clearWidth()
From source file:org.opencms.ade.containerpage.client.ui.CmsGroupcontainerEditor.java
License:Open Source License
/** * Closes the dialog.<p>//from w w w. j av a 2 s. c o m * * @param breakingUp <code>true</code> if the group container is to be removed */ protected void closeDialog(boolean breakingUp) { m_controller.stopEditingGroupcontainer(); m_editingPlaceholder.removeFromParent(); m_editorDialog.hide(); RootPanel.get().removeStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing()); if (!breakingUp) { m_groupContainer.clearEditingPlaceholder(); Style style = m_groupContainer.getElement().getStyle(); style.clearPosition(); style.clearTop(); style.clearLeft(); style.clearZIndex(); style.clearWidth(); m_parentContainer.insert(m_groupContainer, m_indexPosition); m_groupContainer.getElementOptionBar().setVisible(true); if (!m_groupContainer.iterator().hasNext()) { // group-container is empty, mark it m_groupContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer()); } } INSTANCE = null; this.removeFromParent(); }
From source file:org.opencms.ade.containerpage.client.ui.groupeditor.A_CmsGroupEditor.java
License:Open Source License
/** * Closes the dialog.<p>/*from ww w. j a v a2 s .c o m*/ * * @param breakingUp <code>true</code> if the group container is to be removed */ protected void closeDialog(boolean breakingUp) { m_controller.stopEditingGroupcontainer(); m_editingPlaceholder.removeFromParent(); m_editorDialog.hide(); RootPanel.get().removeStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().groupcontainerEditing()); if (!breakingUp) { m_groupContainer.clearEditingPlaceholder(); Style style = m_groupContainer.getElement().getStyle(); style.clearPosition(); style.clearTop(); style.clearLeft(); style.clearZIndex(); style.clearWidth(); m_parentContainer.insert(m_groupContainer, m_indexPosition); m_groupContainer.getElementOptionBar().setVisible(true); if (!m_groupContainer.iterator().hasNext()) { // group-container is empty, mark it m_groupContainer.addStyleName(I_CmsLayoutBundle.INSTANCE.containerpageCss().emptyGroupContainer()); } } clearInstance(); removeFromParent(); if (!m_controller.getData().isUseClassicEditor()) { for (Widget element : m_groupContainer) { if (element instanceof CmsContainerPageElementPanel) { ((CmsContainerPageElementPanel) element).removeInlineEditor(); } } } m_controller.reinitializeButtons(); m_controller.reInitInlineEditing(); m_controller.fireEvent(new CmsContainerpageEvent(EventType.elementEdited)); }
From source file:org.waveprotocol.wave.client.doodad.attachment.render.ImageThumbnailWidget.java
License:Apache License
private void setImageSize() { int width = isFullSize ? attachmentWidth : thumbnailWidth; int height = isFullSize ? attachmentHeight : thumbnailHeight; image.setPixelSize(width, height);/*from w w w . j a v a 2 s . co m*/ //TODO(user,danilatos): Whinge about how declarative UI doesn't let us avoid this hack: Style pstyle = image.getElement().getParentElement().getParentElement().getStyle(); if (width == 0) { image.setWidth(""); pstyle.clearWidth(); } else { pstyle.setWidth(width, Unit.PX); } if (height == 0) { image.setHeight(""); pstyle.clearHeight(); } else { pstyle.setHeight(height, Unit.PX); } String url = isFullSize ? attachmentUrl : thumbnailUrl; if (url != null) { if (doubleBufferLoader == null) { doubleBufferLoader = new DoubleBufferImage(spin, errorLabel, image); } doubleBufferLoader.loadImage(url); DOM.setStyleAttribute(image.getElement(), "visibility", ""); } // NOTE(user): IE requires that the imageCaptionContainer element has a width // in order to correctly center the caption. if (DO_FRAME_WIDTH_UPDATE) { captionPanel.getElement().getStyle().setWidth(width, Unit.PX); } }