List of usage examples for com.google.gwt.user.client.ui Widget addStyleName
public void addStyleName(String style)
From source file:org.kuali.student.common.ui.client.configurable.mvc.FieldDescriptor.java
License:Educational Community License
protected void addStyleToWidget(Widget w) { if (fieldKey != null && !fieldKey.isEmpty() && w != null) { String style = this.fieldKey.replaceAll("/", "-"); w.addStyleName(style); }/* w ww .jav a 2 s . co m*/ }
From source file:org.kuali.student.common.ui.client.configurable.mvc.impl.DefaultWidgetFactoryImpl.java
License:Educational Community License
protected Widget _getWidget(WidgetConfigInfo config) { Widget result = null; if (!config.canView) { result = new KSPlaceholder(); result.setVisible(config.canView); } else if (!config.canEdit && (config.lookupMeta == null || config.lookupMeta.getWidget() == null)) { if (config.type == DataType.BOOLEAN) { result = new BooleanDisplayLabel(); } else {// w ww . j av a2s. com result = new KSLabel(); } } else { if (config.lookupMeta != null && config.lookupMeta.getWidget() != null) { //All repeating fields should use the KSSelectedList for multiplicities (Except checkboxes) if (config.metadata != null && MetadataInterrogator.isRepeating(config.metadata) && !LookupMetadata.Widget.CHECKBOX_LIST.equals(config.lookupMeta.getWidget())) { result = new KSSelectedList(config); } else { result = GWT.create(KSPicker.class); ((KSPicker) result).init(config); } } else { switch (config.type) { case BOOLEAN: result = new KSCheckBox(); break; case DATE: // fall through case TRUNCATED_DATE: result = new KSDatePicker(); break; case DATA: if (config.isRichText) { result = new KSRichEditor(); break; } default: if (config.isMultiLine) { result = new KSTextArea(); result.addStyleName("ks-textarea-width"); if (config.maxLength != null) { ((KSTextArea) (result)).setMaxLength(config.maxLength); if (config.maxLength < 250) { result.addStyleName("ks-textarea-small-height"); } else if (config.maxLength < 500) { result.addStyleName("ks-textarea-medium-height"); } else { result.addStyleName("ks-textarea-large-height"); } } else { result.addStyleName("ks-textarea-medium-height"); } } else { KSTextBox text = new KSTextBox(); //text.removeStyleName("KS-Textbox"); if (config.maxLength != null) { text.setMaxLength(config.maxLength); if (config.maxLength < 5) { switch (config.maxLength) { case 1: text.addStyleName("ks-one-width"); break; case 2: text.addStyleName("ks-two-width"); break; case 3: text.addStyleName("ks-three-width"); break; case 4: text.addStyleName("ks-four-width"); break; } } else if (config.maxLength < 23) { text.addStyleName("ks-small-width"); } else if (config.maxLength < 35) { text.addStyleName("ks-medium-width"); } else if (config.maxLength < 60) { text.addStyleName("ks-large-width"); } else { text.addStyleName("ks-extra-large-width"); } } else { text.addStyleName("ks-medium-width"); } result = text; } } } } return result; }
From source file:org.kuali.student.common.ui.client.configurable.mvc.sections.ValidationMessagePanel.java
License:Educational Community License
public void addWarnMessage(Widget message) { if (getMessageCount() == 0 && topMargin) { message.addStyleName("ks-form-module-single-line-margin"); }/*ww w . j ava 2 s . c o m*/ warnListPanel.add(message); warnCount++; }
From source file:org.kuali.student.common.ui.client.widgets.field.layout.layouts.VerticalFieldLayout.java
License:Educational Community License
@Override public void addWidgetToLayout(Widget widget) { widget.addStyleName("ks-section-widget"); verticalLayout.add(widget); }
From source file:org.kuali.student.common.ui.client.widgets.KSLightBox.java
License:Educational Community License
/** * Adds a button to the bottom of the lightbox. *//*from www . j a va 2s . c o m*/ public void addButton(Widget button) { button.addStyleName("ks-button-spacing"); buttonPanel.add(button); }
From source file:org.kuali.student.common.ui.client.widgets.layout.CustomFlowPanel.java
License:Educational Community License
@Override public void add(Widget w) { w.addStyleName(getFlowStyle()); super.add(w); }
From source file:org.kuali.student.common.ui.client.widgets.search.CollapsablePanel.java
License:Educational Community License
protected void init(Widget label, Widget content, boolean isOpen, boolean withImages, ImagePosition imagePosition) {// ww w . ja v a 2 s . co m this.isOpen = isOpen; this.withImages = withImages; this.imagePosition = imagePosition; this.content.setWidget(content); if (this.imagePosition == ImagePosition.ALIGN_RIGHT) { linkPanel.add(label); } if (this.withImages) { linkPanel.add(closedImage); linkPanel.add(openedImage); setImageState(); } if (this.imagePosition == ImagePosition.ALIGN_LEFT) { linkPanel.add(label); } if (!isOpen) { this.content.setVisible(false); } closedImage.addClickHandler(openCloseClickHandler); openedImage.addClickHandler(openCloseClickHandler); layout.add(linkPanel); layout.add(this.content); closedImage.addStyleName("ks-image-middle-alignment"); openedImage.addStyleName("ks-image-middle-alignment"); content.addStyleName("top-padding"); this.initWidget(layout); }
From source file:org.metawidget.gwt.client.widgetprocessor.StyleNameProcessor.java
License:LGPL
public Widget processWidget(Widget widget, String elementName, Map<String, String> attributes, GwtMetawidget metawidget) {/* w w w. j a v a2 s . co m*/ // Note: this only applies the styles to Stubs at the top-level. In practice, this seemed // to give more 'expected' behaviour than drilling into the Stubs and applying the styles // to all their subcomponents too String styleName = metawidget.getStyleName(); if (styleName != null && styleName.length() != 0) { widget.addStyleName(styleName); } return widget; }
From source file:org.mobicents.servlet.management.client.dnd.PickupDragController.java
License:Open Source License
/** * Called by {@link PickupDragController#dragStart(Widget)} to allow subclasses to * provide their own drag proxies.// w w w. j av a 2 s . co m * * @param context the current drag context * @return a new drag proxy */ protected Widget newDragProxy(DragContext context) { AbsolutePanel container = new AbsolutePanel(); DOM.setStyleAttribute(container.getElement(), "overflow", "visible"); WidgetArea draggableArea = new WidgetArea(context.draggable, null); for (int q = 0; q < context.selectedWidgets.size(); q++) { Widget widget = (Widget) context.selectedWidgets.get(q); WidgetArea widgetArea = new WidgetArea(widget, null); Widget proxy = new SimplePanel(); proxy.setPixelSize(widget.getOffsetWidth(), widget.getOffsetHeight()); proxy.addStyleName(PRIVATE_CSS_PROXY); container.add(proxy, widgetArea.getLeft() - draggableArea.getLeft(), widgetArea.getTop() - draggableArea.getTop()); } return container; }
From source file:org.obiba.opal.web.gwt.app.client.ui.AbstractTabPanel.java
License:Open Source License
private void setSelectedIndex(int index) { int i = 0;/* w ww .j av a2 s .c o m*/ for (Widget child : menu) { child.removeStyleName("active"); if (i++ == index) { child.addStyleName("active"); } } contentContainer.showWidget(index); selectedIndex = index; }