Java Code Examples for com.google.gwt.user.client.ui.Widget.addStyleName()

The following are Jave code examples for showing how to use addStyleName() of the com.google.gwt.user.client.ui.Widget class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: unitimes   File: SimpleForm.java   Source Code and License Vote up 6 votes
public int addRow(Widget header, Widget widget, int colSpan) {
	header.addStyleName("label-cell");
	int row = getRowCount();
	setWidget(row, 0, header);
	getCellFormatter().setStyleName(row, 0, "label-td");
	if (widget instanceof HasMobileScroll) {
		ScrollPanel scroll = new ScrollPanel(widget);
		scroll.addStyleName("table-cell");
		setWidget(row, 1, scroll);
		getCellFormatter().setStyleName(row, 1, "table-td");
	} else {
		widget.addStyleName("widget-cell");
		setWidget(row, 1, widget);
		getCellFormatter().setStyleName(row, 1, "widget-td");
	}
	if (colSpan != 1)
		getFlexCellFormatter().setColSpan(row, 1, colSpan);
	if (header.getElement().getId() == null || header.getElement().getId().isEmpty())
		header.getElement().setId(DOM.createUniqueId());
	if (widget instanceof UniTimeWidget)
		Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widget).getWidget().getElement(), Id.of(header.getElement()));
	else
		Roles.getTextboxRole().setAriaLabelledbyProperty(widget.getElement(), Id.of(header.getElement()));
	return row;
}
 
Example 2
Project: unitimes   File: RestrictionsTable.java   Source Code and License Vote up 6 votes
protected Node addClass(Node parent, Clazz clazz) {
	List<Widget> line = new ArrayList<Widget>();
	Node node = new Node(parent, clazz.getAbbv(), clazz);
	line.add(node);
	line.add(new Label(clazz.hasExternalId() ? clazz.getExternalId() : ""));
	line.add(new UniTimeTable.NumberCell(clazz.getLimit() == null ? "" : clazz.getLimit().toString()));
	if (clazz.isCancelled()) {
		line.add(new CancelledCell());
	} else {
		line.add(new Label(clazz.hasTime() ? clazz.getTime() : ""));
		line.add(new Label(clazz.hasDate() ? clazz.getDate() : ""));
		line.add(new Label(clazz.hasRoom() ? clazz.getRoom() : ""));
	}
	line.add(new Label(clazz.hasInstructor() ? clazz.getInstructor() : ""));
	node.setRow(addRow(node, line));
	if (clazz.isCancelled())
		for (Widget w: line)
			w.addStyleName("cancelled");
	iClasses.put(clazz.getId(), node);
	parent.addChildNode(node);
	return node;
}
 
Example 3
Project: empiria.player   File: SelectionGridElementGeneratorImpl.java   Source Code and License Vote up 5 votes
@Override
public SelectionItemGridElementImpl createItemDisplayElement(Element item) {
    SelectionItemGridElementImpl itemLabelElement = new SelectionItemGridElementImpl();
    Widget itemTextLabel = inlineBodyGeneratorSocket.generateInlineBody(item, true);

    itemTextLabel.setStyleName(selectionStyleNameConstants.QP_SELECTION_ITEM_LABEL());
    itemTextLabel.addStyleName(styleNameConstants.QP_MARKANSWERS_LABEL_INACTIVE());

    itemLabelElement.setStyleName(selectionStyleNameConstants.QP_SELECTION_ITEM());
    itemLabelElement.addStyleName(styleNameConstants.QP_MARKANSWERS_MARKER_INACTIVE());
    itemLabelElement.add(itemTextLabel);
    return itemLabelElement;
}
 
Example 4
Project: empiria.player   File: ModuleBase.java   Source Code and License Vote up 5 votes
protected final void applyIdAndClassToView(Widget widget) {
    if (widget != null) {
        if (getModuleId() != null && !"".equals(getModuleId().trim()))
            widget.getElement().setId(getModuleId());
        if (getModuleClass() != null && !"".equals(getModuleClass().trim()))
            widget.addStyleName(getModuleClass());
    }
}
 
Example 5
Project: unitimes   File: AriaTabBar.java   Source Code and License Vote up 5 votes
public void setRestWidget(Widget rest) {
	HorizontalPanel panel = (HorizontalPanel)getWidget();
	rest.addStyleName("gwt-TabBarRest");
	rest.setHeight("100%");
	panel.remove(panel.getWidgetCount() - 1);
	panel.add(rest);
	panel.setCellWidth(rest, "100%");
	setStyleName(rest.getElement().getParentElement(), "gwt-TabBarRest-wrapper");
}
 
Example 6
Project: unitimes   File: UniTimeHeaderPanel.java   Source Code and License Vote up 5 votes
public void insertLeft(Widget widget, boolean first) {
	widget.addStyleName("left-widget");
	if (first)
		iLeft.insert(widget, 0);
	else
		iLeft.add(widget);
}
 
Example 7
Project: unitimes   File: UniTimeHeaderPanel.java   Source Code and License Vote up 5 votes
public void insertRight(Widget widget, boolean first) {
	widget.addStyleName("right-widget");
	if (first)
		iRight.insert(widget, 0);
	else
		iRight.add(widget);
}
 
Example 8
Project: unitimes   File: FilterPanel.java   Source Code and License Vote up 4 votes
@Override
public void add(Widget w) {
	w.addStyleName("filter-item");
	super.add(w);
}
 
Example 9
Project: unitimes   File: FilterPanel.java   Source Code and License Vote up 4 votes
public void addMiddle(Widget w) {
	w.addStyleName("filter-item");
	iMiddle.add(w);
}
 
Example 10
Project: unitimes   File: FilterPanel.java   Source Code and License Vote up 4 votes
public void addLeft(Widget w) {
	w.addStyleName("filter-item");
	iLeft.add(w);
}
 
Example 11
Project: unitimes   File: FilterPanel.java   Source Code and License Vote up 4 votes
public void addRight(Widget w) {
	w.addStyleName("filter-item");
	iRight.add(w);
}
 
Example 12
Project: unitimes   File: UniTimeHeaderPanel.java   Source Code and License Vote up 4 votes
public void insertWidget(Widget widget) {
	widget.addStyleName("widget");
	iContent.insert(widget, 1);
}