List of usage examples for com.google.gwt.dom.client Style setHeight
public void setHeight(double value, Unit unit)
From source file:com.codenvy.ide.client.elements.widgets.branch.BranchViewImpl.java
License:Open Source License
private void resizeBodyPanel() { Style style = body.getElement().getStyle(); if (westTitlePanel.isVisible()) { style.setHeight(100, PCT); style.setWidth(width - HORIZONTAL_TITLE_WIDTH - BORDER_SIZE, PX); }/* w w w . j av a 2s . c o m*/ if (topTitlePanel.isVisible()) { style.setHeight(height - VERTICAL_TITLE_WIDTH - BORDER_SIZE, PX); style.setWidth(100, PCT); } }
From source file:com.codenvy.ide.client.elements.widgets.element.ElementViewImpl.java
License:Open Source License
@Nonnull private FlowPanel createHeaderPanel() { FlowPanel header = new FlowPanel(); header.addStyleName(editorCSS.elementHeaderPanel()); Style style = header.getElement().getStyle(); style.setWidth(100, PCT);/* w w w . j a v a 2 s.c o m*/ style.setHeight(19, PX); header.add(createInnerHeaderPanel()); return header; }
From source file:com.codenvy.ide.client.elements.widgets.element.ElementViewImpl.java
License:Open Source License
@Nonnull private FlowPanel createInnerHeaderPanel() { FlowPanel innerHeaderPanel = new FlowPanel(); innerHeaderPanel.addStyleName(editorCSS.elementHeaderInnerPanel()); Style style = innerHeaderPanel.getElement().getStyle(); style.setWidth(100, PCT);/* w w w . j ava 2s .c o m*/ style.setHeight(19, PX); headerTitle = createHeaderTitle(); innerHeaderPanel.add(headerTitle); return innerHeaderPanel; }
From source file:com.codenvy.ide.client.elements.widgets.element.ElementViewImpl.java
License:Open Source License
@Nonnull private Label createIconTitle() { Label title = createTitle();//from w w w.j av a 2 s. c o m Style style = title.getElement().getStyle(); style.setHeight(15, PX); style.setWidth(100, PCT); return title; }
From source file:com.codenvy.ide.client.elements.widgets.element.ElementViewImpl.java
License:Open Source License
private void resizeIconPanel() { Style style = iconPanel.getElement().getStyle(); if (headerPanel.isVisible()) { style.setHeight(height - 19, PX); } else {//from ww w. j a va2s . com style.setHeight(100, PCT); } }
From source file:com.eas.widgets.boxes.DecoratorBox.java
public DecoratorBox(HasValue<T> aDecorated) { super();/*from ww w . j a v a 2 s.c om*/ decorated = aDecorated; if (decorated instanceof HasValue<?>) { decorated.addValueChangeHandler(new ValueChangeHandler<T>() { @Override public void onValueChange(ValueChangeEvent<T> event) { setClearButtonVisible(nullable && event.getValue() != null); } }); } if (decorated instanceof HasDecorations) { HasWidgets container = ((HasDecorations) decorated).getContainer(); ((Widget) container).addStyleName("decorator"); container.add(selectButton); container.add(clearButton); initWidget((Widget) decorated); } else { CommonResources.INSTANCE.commons().ensureInjected(); ((Widget) decorated).getElement().addClassName(CommonResources.INSTANCE.commons().borderSized()); Style style = ((Widget) decorated).getElement().getStyle(); style.setMargin(0, Style.Unit.PX); style.setPosition(Style.Position.ABSOLUTE); style.setDisplay(Style.Display.INLINE_BLOCK); style.setLeft(0, Style.Unit.PX); style.setTop(0, Style.Unit.PX); style.setHeight(100, Style.Unit.PCT); style.setWidth(100, Style.Unit.PCT); style.setOutlineStyle(Style.OutlineStyle.NONE); FlowPanel panel = new FlowPanel(); panel.addStyleName("decorator"); initWidget(panel); panel.add((Widget) decorated); panel.add(selectButton); panel.add(clearButton); } ((Widget) decorated).addStyleName("decorator-content"); selectButton.getElement().addClassName("decorator-select"); selectButton.getElement().getStyle().setDisplay(Style.Display.NONE); selectButton.getElement().getStyle().setHeight(100, Style.Unit.PCT); selectButton.getElement().getStyle().setPosition(Style.Position.RELATIVE); clearButton.getElement().addClassName("decorator-clear"); clearButton.getElement().getStyle().setDisplay(Style.Display.NONE); clearButton.getElement().getStyle().setHeight(100, Style.Unit.PCT); clearButton.getElement().getStyle().setPosition(Style.Position.RELATIVE); selectButton.addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { selectValue(); } }, ClickEvent.getType()); clearButton.addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { clearValue(); setFocus(true); } }, ClickEvent.getType()); organizeButtonsContent(); getElement().<XElement>cast().addResizingTransitionEnd(this); if (decorated instanceof HasValue<?>) { changeValueHandler = decorated.addValueChangeHandler(new ValueChangeHandler<T>() { @Override public void onValueChange(ValueChangeEvent<T> event) { fireValueChangeEvent(); } }); } if (decorated instanceof HasKeyDownHandlers) { keyDownHandler = ((HasKeyDownHandlers) decorated).addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { KeyDownEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this); } }); } if (decorated instanceof HasKeyUpHandlers) { keyUpHandler = ((HasKeyUpHandlers) decorated).addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { KeyUpEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this); } }); } if (decorated instanceof HasKeyPressHandlers) { keyPressHandler = ((HasKeyPressHandlers) decorated).addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { KeyPressEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this); } }); } if (decorated instanceof HasFocusHandlers) { focusHandler = ((HasFocusHandlers) decorated).addFocusHandler(new FocusHandler() { @Override public void onFocus(FocusEvent event) { FocusEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this); } }); } if (decorated instanceof HasBlurHandlers) { blurHandler = ((HasBlurHandlers) decorated).addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { BlurEvent.fireNativeEvent(event.getNativeEvent(), DecoratorBox.this); } }); } }
From source file:com.ephesoft.gxt.admin.client.presenter.document.DocumentTypeMenuPresenter.java
License:Open Source License
public void showTestClassificationView() { if (controller.getSelectedBatchClass().isDirty()) { applyBatchClassBeforeOperation(//from w ww . j a v a 2 s .co m LocaleDictionary.getConstantValue(BatchClassConstants.TEST_CLASSIFICATION)); view.enableAllOtherMenuItems(true); view.setTestClassificationButtonDown(false); } else { testClassificationDialogWindow = new DialogWindow(new GrayWindowAppearance(), true, controller.getTestClassifyTypeView().getClassificationTypesComboBox()); testClassificationDialogWindow.addStyleName("testClassificationDialogWindow"); testClassificationDialogWindow.addStyleName("testExtractionDialogWindow"); BatchClassManagementEventBus.fireEvent(new ClearTestClassificationGridEvent()); BatchClassManagementEventBus.fireEvent(new TestClassificationDownloadEnableEvent(false)); BatchClassManagementEventBus.fireEvent(new TestClassificationClearMenuItemEnableEvent()); TestClassificationLayout testClassificationLayout = controller.getTestClassificationLayout(); testClassificationDialogWindow .setFocusWidget(controller.getTestClassifyTypeView().getClassificationTypesComboBox()); testClassificationDialogWindow.add(testClassificationLayout); testClassificationDialogWindow.setBorders(false); testClassificationDialogWindow.setModal(false); testClassificationDialogWindow.setWidth(getOffsetWidth()); final Element element = testClassificationDialogWindow.getElement(); final Style style = element.getStyle(); style.setHeight(getOffsetHeight(), Unit.PX); // testClassificationDialogWindow.setHeight(getOffsetHeight()); testClassificationDialogWindow.setPosition(getAbsoluteLeft(), getAbsoluteTop()); testClassificationDialogWindow.setOnEsc(false); testClassificationDialogWindow.setResizable(false); testClassificationDialogWindow.setClosable(false); testClassificationDialogWindow.setDraggable(false); testClassificationDialogWindow.setHeaderVisible(false); testClassificationDialogWindow.setPredefinedButtons(); controller.resizeGrid(getOffsetHeight(), getOffsetWidth()); BatchClassManagementEventBus.fireEvent(new BCMTreeMaskEvent(true)); testClassificationDialogWindow.show(); } }
From source file:com.ephesoft.gxt.admin.client.presenter.document.DocumentTypeMenuPresenter.java
License:Open Source License
@EventHandler public void beforeDialogWindowResize(DialogWindowResizeEvent beforeResize) { if (null != testExtractionDialogWindow && testExtractionDialogWindow.isVisible()) { testExtractionDialogWindow.setResizable(true); // final Element element = testExtractionDialogWindow.getElement(); // final Style style = element.getStyle(); // style.setHeight(getOffsetHeight(), Unit.PX); testExtractionDialogWindow.setHeight(getOffsetHeight()); testExtractionDialogWindow.setWidth(getOffsetWidth()); testExtractionDialogWindow.setPosition(getAbsoluteLeft(), getAbsoluteTop()); controller.setBorderLayoutContainer(getOffsetHeight(), getOffsetWidth()); testExtractionDialogWindow.setResizable(false); }//from w w w .j a va 2 s. c om if (null != testClassificationDialogWindow && testClassificationDialogWindow.isVisible()) { testClassificationDialogWindow.setResizable(true); final Element element = testClassificationDialogWindow.getElement(); final Style style = element.getStyle(); style.setHeight(getOffsetHeight(), Unit.PX); // testClassificationDialogWindow.setHeight(getOffsetHeight()); testClassificationDialogWindow.setWidth(getOffsetWidth()); testClassificationDialogWindow.setPosition(getAbsoluteLeft(), getAbsoluteTop()); testClassificationDialogWindow.setResizable(false); controller.resizeGrid(getOffsetHeight(), getOffsetWidth()); } }
From source file:com.ephesoft.gxt.core.client.ui.widget.MultiFileUploader.java
License:Open Source License
private void setDimension(final Widget parent) { if (null != parent) { final Element element = dragDropLabel.getElement(); final Style style = element.getStyle(); final int height = parent.getOffsetHeight() - UPLOADER_BUTTON_HEIGHT - 2; final int heightToAssign = (height / 2) - FONT_SIZE; style.setHeight(heightToAssign, Unit.PX); style.setFontSize(FONT_SIZE, Unit.PX); style.setPaddingTop(heightToAssign, Unit.PX); style.setLineHeight(1, Unit.PX); dragDropLabel.setWidth("99%"); style.setLeft(6, Unit.PX);//from www . j a v a2 s.c om isInitialized = true; Style uploadProgressStyle = uploadProgress.getElement().getStyle(); uploadProgressStyle.setMarginTop(height / 2, Unit.PX); } }
From source file:com.google.gerrit.client.diff.OverviewBar.java
License:Apache License
void update(ScrollInfo si) { double viewHeight = si.getClientHeight(); double r = ratio(si); com.google.gwt.dom.client.Style style = viewport.getElement().getStyle(); style.setTop(si.getTop() * r, Unit.PX); style.setHeight(Math.max(10, viewHeight * r), Unit.PX); getElement().getStyle().setHeight(viewHeight, Unit.PX); for (MarkHandle info : diff) { info.position(r);/*from w w w .j av a 2 s .c om*/ } for (MarkHandle info : comments) { info.position(r); } }