@Override public void setHeightUndefined() { setHeight(-1, Unit.PIXELS); }
/** * @see org.opencms.ui.shared.rpc.I_CmsMaxHeightServerRpc#fixHeight(int) */ public void fixHeight(int height) { if (height < 1) { m_component.setHeightUndefined(); } else { m_component.setHeight(height, Unit.PIXELS); } for (Runnable handler : m_heightChangeHandlers) { handler.run(); } }
@Override public void setSizeFull() { setWidth(100, Unit.PERCENTAGE); setHeight(100, Unit.PERCENTAGE); }
@Override public void setHeight(float height, Unit unit) { super.setHeight(height, unit); if (container != null) { if (height < 0) { container.setHeightUndefined(); field.setHeightUndefined(); if (inputWrapper != null) { inputWrapper.setHeightUndefined(); } } else { container.setHeight(100, Unit.PERCENTAGE); field.setHeight(100, Unit.PERCENTAGE); if (inputWrapper != null) { inputWrapper.setHeight(100, Unit.PERCENTAGE); } } } }
/** * Reads the size of this component from the given design attributes. If the * attributes do not contain relevant size information, defaults is * consulted. * * @param attributes * the design attributes */ private void readSize(Attributes attributes) { // read width if (attributes.hasKey("width-auto") || attributes.hasKey("size-auto")) { this.setWidth(null); } else if (attributes.hasKey("width-full") || attributes.hasKey("size-full")) { this.setWidth("100%"); } else if (attributes.hasKey("width")) { this.setWidth(attributes.get("width")); } // read height if (attributes.hasKey("height-auto") || attributes.hasKey("size-auto")) { this.setHeight(null); } else if (attributes.hasKey("height-full") || attributes.hasKey("size-full")) { this.setHeight("100%"); } else if (attributes.hasKey("height")) { this.setHeight(attributes.get("height")); } }
/** * {@inheritDoc} * <p> * <em>Note:</em> This method will change the widget's size in the browser * only if {@link #getHeightMode()} returns {@link HeightMode#CSS}. * * @see #setHeightMode(HeightMode) */ @Override public void setHeight(float height, Unit unit) { super.setHeight(height, unit); }
@Override public void setHeight(float height, Unit unit) { /* * child tree repaints may be needed, due to our fall back support for * invalid relative sizes */ Collection<Component> dirtyChildren = null; boolean childrenMayBecomeUndefined = false; if (getHeight() == SIZE_UNDEFINED && height != SIZE_UNDEFINED) { // children currently in invalid state may need repaint dirtyChildren = getInvalidSizedChildren(true); } else if ((height == SIZE_UNDEFINED && getHeight() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE && getHeightUnits() != Unit.PERCENTAGE && !ComponentSizeValidator .parentCanDefineHeight(this))) { /* * relative height children may get to invalid state if height * becomes invalid. Height may also become invalid if units become * percentage due to the fallback support. */ childrenMayBecomeUndefined = true; dirtyChildren = getInvalidSizedChildren(true); } super.setHeight(height, unit); repaintChangedChildTrees(dirtyChildren, childrenMayBecomeUndefined, true); }
@Override public void setHeight(float height, Unit unit) { /* * child tree repaints may be needed, due to our fall back support for * invalid relative sizes */ boolean dirtyChild = false; boolean childrenMayBecomeUndefined = false; if (getHeight() == SIZE_UNDEFINED && height != SIZE_UNDEFINED) { // children currently in invalid state may need repaint dirtyChild = getInvalidSizedChild(true); } else if ((height == SIZE_UNDEFINED && getHeight() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE && getHeightUnits() != Unit.PERCENTAGE && !ComponentSizeValidator .parentCanDefineHeight(this))) { /* * relative height children may get to invalid state if height * becomes invalid. Height may also become invalid if units become * percentage due to the fallback support. */ childrenMayBecomeUndefined = true; dirtyChild = getInvalidSizedChild(true); } super.setHeight(height, unit); repaintChangedChildTree(dirtyChild, childrenMayBecomeUndefined, true); }
@Override public B fullHeight() { getInstance().setHeight(100, Unit.PERCENTAGE); return builder(); }
@Override public B fullHeight() { getInstance().setHeight(100, Unit.PERCENTAGE); return builder(); }
@Override public B height(String height) { getInstance().setHeight(height); return builder(); }
@Override public B height(float height, Unit unit) { getInstance().setHeight(height, unit); return builder(); }
@Override public B height(String height) { getInstance().setHeight(height); return builder(); }
@Override public B height(float height, Unit unit) { getInstance().setHeight(height, unit); return builder(); }
/** * Returns metadata popup. * * @param entity * entity for which metadata data is displayed * @param metaDatakey * metadata key to be selected * @return @link{CommonDialogWindow} */ public CommonDialogWindow getWindow(final E entity, final String metaDatakey) { selectedEntity = entity; metadataWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW) .caption(getMetadataCaption()).content(this).cancelButtonClickListener(event -> onCancel()) .id(UIComponentIdProvider.METADATA_POPUP_ID).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); metadataWindow.setHeight(550, Unit.PIXELS); metadataWindow.setWidth(800, Unit.PIXELS); metadataWindow.getMainLayout().setSizeFull(); metadataWindow.getButtonsLayout().setHeight("45px"); setUpDetails(entity.getId(), metaDatakey); return metadataWindow; }
/** * Returns metadata popup. * * @param entity * entity for which metadata data is displayed * @param metaDatakey * metadata key to be selected * @return @link{CommonDialogWindow} */ public CommonDialogWindow getWindow(final E entity, final String metaDatakey) { selectedEntity = entity; metadataWindow = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW) .caption(getMetadataCaption()).content(this).cancelButtonClickListener(event -> onCancel()) .id(UIComponentIdProvider.METADATA_POPUP_ID).layout(mainLayout).i18n(i18n) .saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow(); metadataWindow.setHeight(550, Unit.PIXELS); metadataWindow.setWidth(800, Unit.PIXELS); metadataWindow.getMainLayout().setSizeFull(); metadataWindow.getButtonsLayout().setHeight("45px"); setUpDetails(entity.getId(), metaDatakey); return metadataWindow; }
component.setEnabled(hasPermission("EDIT")); if (component.isReadOnly() || !component.isEnabled()) { component.setHeight(null);
if (width != null) layout.setWidth(width); String height = config.getString(LayoutBuilder.HEIGHT, null); if (height != null) layout.setHeight(height);
if (width != null) layout.setWidth(width); String height = config.getString(LayoutBuilder.HEIGHT, null); if (height != null) layout.setHeight(height);