public void setSubType(int type) { inputSize = type == FormType.LARGE_CENTER || type == FormType.SMALL_CENTER ? ColumnSize.MD_12.getCssName() : ColumnSize.MD_6.getCssName(); sectionSize = type == FormType.FULL ? ColumnSize.MD_6.getCssName() : ColumnSize.MD_12.getCssName(); sectionPerRow = type == FormType.FULL ? 2 : 1; setButtonStyle("btn-lg"); headingSize = 4; if (type == FormType.HALF) { root.setStyleName(ColumnSize.MD_6.getCssName()); } else if (type == FormType.HALF_CENTER) { root.setStyleName("col-lg-6 col-lg-offset-3 col-md-8 col-md-offset-2"); setButtonStyle("btn-lg btn-block"); } else if (type == FormType.SMALL_CENTER) { root.setStyleName("col-md-4 col-md-offset-4"); setButtonStyle("btn-lg btn-block"); } else if (type == FormType.MEDIUM_CENTER) { root.setStyleName("col-md-8 col-md-offset-2"); } else if (type == FormType.LARGE_CENTER) { root.setStyleName("col-md-10 col-md-offset-1"); setButtonStyle(null); } else if (type == FormType.SMALL_LEFT) { root.setStyleName("col-md-5 col-lg-4"); setButtonStyle("btn-lg btn-block"); headingSize = 6; } else if (type == FormType.SMALL_RIGHT) { root.setStyleName("col-lg-5 col-lg-offset-6 col-md-7 col-md-offset-4"); setButtonStyle("btn-lg btn-block"); headingSize = 6; } }
public PageFormAppearance() { FlowPanel panel = new FlowPanel(); panel.getElement().setAttribute("role", "form"); heading = Document.get().createHElement(3); panel.getElement().appendChild(heading); main = panel; inputPanel = new FlowPanel(); panel.add(inputPanel); inputSize = ColumnSize.MD_12.getCssName(); buttonStyle = ButtonSize.LARGE.getCssName(); }