com.google.gwt.user.client.DOM Java Examples

The following examples show how to use com.google.gwt.user.client.DOM. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MaterialSubHeaderContainer.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
@Override
public void load() {
    if (getType() == SubHeaderType.PINNED) {
        String subHeaderClass = DOM.createUniqueId();
        for (Widget w : getChildren()) {
            if (w instanceof MaterialSubHeader) {
                w.addStyleName(subHeaderClass);
                subHeaders.add((MaterialSubHeader) w);
            }
        }

        JsSubHeader.initSubheader("." + subHeaderClass, getElement());

        if (subHeaders.size() == 0) {
            $(getElement()).find(".top_holder").css("display", "none");
        }
    }
    AddinsDarkThemeReloader.get().reload(MaterialSubheaderDarkTheme.class);
}
 
Example #2
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private HTML buildSliderPart(String width, String height, String cursor, String color, double transparancy) {
    HTML container = new HTML();
    container.setWidth(width);
    container.setHeight(height);
    DOM.setStyleAttribute(container.getElement(), "cursor", cursor);
    DOM.setStyleAttribute(container.getElement(), "backgroundColor", color);

    // transparency styling (see also bug#449 and http://www.quirksmode.org/css/opacity.html)
    // note: since GWT complains, '-msFilter' has to be in plain camelCase (w/o '-')
    // ordering is important here
    DOM.setStyleAttribute(container.getElement(), "opacity", Double.toString(transparancy));
    DOM.setStyleAttribute(container.getElement(), "mozOpacity", Double.toString(transparancy));
    String opacity = "(opacity=" +Double.toString(transparancy*100) + ")";
    DOM.setStyleAttribute(container.getElement(), "msFilter", "\"progid:DXImageTransform.Microsoft.Alpha"+ opacity + "\"");
    DOM.setStyleAttribute(container.getElement(), "filter", "alpha" + opacity);
    return container;
}
 
Example #3
Source File: AnnotationSpreadRenderer.java    From incubator-retired-wave with Apache License 2.0 6 votes vote down vote up
private void updateEventHandler(final ContentElement element, String eventHandlerId) {
  Element implNodelet = element.getImplNodelet();
  final EventHandler handler =
      eventHandlerId == null ? null : AnnotationPaint.eventHandlerRegistry.get(eventHandlerId);
  if (handler != null) {
    DOM.sinkEvents(DomHelper.castToOld(implNodelet), MOUSE_LISTENER_EVENTS);
    DOM.setEventListener(DomHelper.castToOld(implNodelet), new EventListener() {
      @Override
      public void onBrowserEvent(Event event) {
        handler.onEvent(element, event);
      }
    });
  } else {
    removeListener(DomHelper.castToOld(implNodelet));
  }
}
 
Example #4
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private void initTooltips() {

        Element mousePointerElement = getMousePointerLineElement();
        DOM.setStyleAttribute(mousePointerElement, "backgroundColor", "blue");
        DOM.setStyleAttribute(mousePointerElement, "width", "0px");
        DOM.setStyleAttribute(mousePointerElement, "height", "0px");
        DOM.setStyleAttribute(mousePointerElement, "visibility", "hidden");
        DOM.setStyleAttribute(mousePointerElement, "marginTop", "6px");
        this.mainChartViewport.add(this.verticalMousePointerLine);

        this.tooltipPresenter = new TooltipPresenter(this.mainChartEventBus);

        this.tooltipPresenter.configureHoverMatch(true, false, false);
        this.tooltipPresenter.setTooltipZIndex(Constants.Z_INDEX_ON_TOP);

        GenericWidgetViewImpl widget = new GenericWidgetViewImpl(this.verticalMousePointerLine);
        MousePointerPresenter mpp = new MousePointerPresenter(this.mainChartEventBus, widget);
        mpp.configure(true, false);
    }
 
Example #5
Source File: JoinDataTool.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
private SubmitCompleteHandler getSubmitCompleteHandler() {
	return new SubmitCompleteHandler() {
		public void onSubmitComplete(final SubmitCompleteEvent event) {

			final Element label = DOM.createLabel();
			label.setInnerHTML(event.getResults());

			final String csvData = label.getInnerText();
			if (hasError(csvData)) {
				showAlert("Error: " + csvData);
			} else {
				parseCsvData(csvData);
				autoMessageBox.hide();
			}
		}

		private boolean hasError(final String contentFile) {
			return contentFile.startsWith("413")
					|| contentFile.startsWith("500");
		}
	};
}
 
Example #6
Source File: SyntaxHighlighterPreview.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * HTMLPreview
 */
public SyntaxHighlighterPreview() {
	iframe = new Frame("about:blank");

	DOM.setElementProperty(iframe.getElement(), "frameborder", "0");
	DOM.setElementProperty(iframe.getElement(), "marginwidth", "0");
	DOM.setElementProperty(iframe.getElement(), "marginheight", "0");
	//DOM.setElementProperty(iframe.getElement(), "scrolling", "yes");

	// Commented because on IE show clear if allowtransparency=true
	DOM.setElementProperty(iframe.getElement(), "allowtransparency", "false");

	iframe.setStyleName("okm-Iframe");
	iframe.addStyleName("okm-EnableSelect");

	initWidget(iframe);
}
 
Example #7
Source File: MockComponentsUtil.java    From appinventor-extensions with Apache License 2.0 6 votes vote down vote up
/**
 * Sets the font typeface for the given widget.
 *
 * @param widget  widget to change font typeface for
 * @param typeface  "0" for normal, "1" for sans serif, "2" for serif and
 *                  "3" for monospace
 */
static void setWidgetFontTypeface(Widget widget, String typeface) {
  switch (Integer.parseInt(typeface)) {
    default:
      // This should never happen
      throw new IllegalArgumentException("Typeface:" + typeface);

    case 0:
    case 1:
      typeface = "sans-serif";
      break;

    case 2:
      typeface = "serif";
      break;

    case 3:
      typeface = "monospace";
      break;
  }
  DOM.setStyleAttribute(widget.getElement(), "fontFamily", typeface);
}
 
Example #8
Source File: DateCell.java    From calendar-component with Apache License 2.0 6 votes vote down vote up
public void setToday(Date today, int width) {
    this.today = today;
    addStyleDependentName("today");
    Element lastChild = (Element) getElement().getLastChild();
    if (lastChild.getClassName().equals("v-calendar-current-time")) {
        todaybar = lastChild;
    } else {
        todaybar = DOM.createDiv();
        todaybar.setClassName("v-calendar-current-time");
        getElement().appendChild(todaybar);
    }

    if (width != -1) {
        todaybar.getStyle().setWidth(width, Unit.PX);
    }

    // position is calculated later, when we know the cell heights
}
 
Example #9
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Method originally copied from HTMLTable superclass where it was defined private
 * Now implemented differently to only return target cell if it'spart of 'this' table
 */
private Element getMouseEventTargetCell(Event event) {
	Element td = DOM.eventGetTarget(event);
	//locate enclosing td element
	while (!DOM.getElementProperty(td, "tagName").equalsIgnoreCase("td")) {
		// If we run out of elements, or run into the table itself, then give up.
		if ((td == null) || td == getElement())
			return null;
		td = DOM.getParent(td);
	}
	//test if the td is actually from this table
	Element tr = DOM.getParent(td);
	Element body = DOM.getParent(tr);
	if (body == this.getBodyElement()) {
		return td;
	}
	//Didn't find appropriate cell
	return null;
}
 
Example #10
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Method originally copied from HTMLTable superclass where it was defined private
 * Now implemented differently to only return target cell if it'spart of 'this' table
 */
private Element getMouseEventTargetCell(Event event) {
	Element td = DOM.eventGetTarget(event);
	//locate enclosing td element
	while (!DOM.getElementProperty(td, "tagName").equalsIgnoreCase("td")) {
		// If we run out of elements, or run into the table itself, then give up.
		if ((td == null) || td == getElement())
			return null;
		td = DOM.getParent(td);
	}
	//test if the td is actually from this table
	Element tr = DOM.getParent(td);
	Element body = DOM.getParent(tr);
	if (body == this.getBodyElement()) {
		return td;
	}
	//Didn't find appropriate cell
	return null;
}
 
Example #11
Source File: ExtendedFlexTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
public void onBrowserEvent(Event event) {
	int selectedRow = 0;

	if (DOM.eventGetType(event) == Event.ONDBLCLICK) {
		Element td = getMouseEventTargetCell(event);
		if (td == null) return;
		Element tr = DOM.getParent(td);
		Element body = DOM.getParent(tr);
		selectedRow = DOM.getChildIndex(body, tr);
		if (selectedRow >= 0) {
			markSelectedRow(selectedRow);
			Main.get().onlineUsersPopup.enableAcceptButton();
			DOM.eventCancelBubble(event, true);
			Main.get().onlineUsersPopup.executeAction();
		}
	}

	super.onBrowserEvent(event);
}
 
Example #12
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 6 votes vote down vote up
private Viewport getMainChartViewport() {
    Image mainChartImage = new Image("img/blank.gif");

    Viewport mainchart = new Viewport("100%", "100%");
    mainchart.setEnableZoomWhenShiftkeyPressed(true);
    mainchart.add(mainChartImage);

    // as it is focusable, we do not want to see an outline
    DOM.setStyleAttribute(mainchart.getElement(), "outline", "none");
    DOM.setStyleAttribute(mainchart.getElement(), "overflow", "visible");
    ImageViewImpl imageView = new ImageViewImpl(mainChartImage);

    new ImagePresenter(this.mainChartEventBus, imageView);
    new DragImageControl(this.mainChartEventBus);
    new MouseWheelControl(this.mainChartEventBus);

    return mainchart;
}
 
Example #13
Source File: CubaScrollTableWidget.java    From cuba with Apache License 2.0 6 votes vote down vote up
@Override
protected void initCellWithText(String text, char align, String style, boolean textIsHTML,
                                boolean sorted, String description, TableCellElement td) {
    super.initCellWithText(text, align, style, textIsHTML, sorted, description, td);

    final Element tdElement = td.cast();
    Tools.textSelectionEnable(tdElement, _delegate.textSelectionEnabled);

    if ((_delegate.clickableColumns != null && _delegate.clickableColumns.contains(currentColumnKey))
            || (_delegate.clickableTableColumns != null && _delegate.clickableTableColumns.contains(currentColumnKey))) {
        tdElement.addClassName(CUBA_TABLE_CLICKABLE_CELL_CONTENT);
        Element wrapperElement = tdElement.getFirstChildElement();
        final Element clickableSpan = DOM.createSpan().cast();
        clickableSpan.setClassName(CUBA_TABLE_CLICKABLE_CELL_STYLE);

        clickableSpan.setInnerText(wrapperElement.getInnerText());

        wrapperElement.removeAllChildren();
        DOM.appendChild(wrapperElement, clickableSpan);
    }

    if (_delegate.multiLineCells) {
        Style wrapperStyle = tdElement.getFirstChildElement().getStyle();
        wrapperStyle.setWhiteSpace(Style.WhiteSpace.PRE_LINE);
    }
}
 
Example #14
Source File: DatasetWidget.java    From EasyML with Apache License 2.0 6 votes vote down vote up
@Override
protected void init() {
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	clientWidth = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	clientHeight = DOM.getElementPropertyInt(label.getElement(), "clientHeight");
	offsetWidth = label.getOffsetWidth();
	offsetHeight = label.getOffsetHeight();
	offsetTop = DOM.getElementPropertyInt(label.getElement(), "offsetTop");
	offsetLeft = DOM.getElementPropertyInt(label.getElement(), "offsetLeft");

	boder = (offsetHeight - clientHeight) / 2;

	custom();

	this.setPixelSize((int) offsetWidth + offsetLeft * 2, (int) offsetHeight
			+ offsetTop * 2);
}
 
Example #15
Source File: VComboBoxMultiselect.java    From vaadin-combobox-multiselect with Apache License 2.0 6 votes vote down vote up
@Override
protected void onPreviewNativeEvent(NativePreviewEvent event) {
	// Check all events outside the combobox to see if they scroll the
	// page. We cannot use e.g. Window.addScrollListener() because the
	// scrolled element can be at any level on the page.

	// Normally this is only called when the popup is showing, but make
	// sure we don't accidentally process all events when not showing.
	if (!this.scrollPending && isShowing()
			&& !DOM.isOrHasChild(SuggestionPopup.this.getElement(), Element.as(event.getNativeEvent()
				.getEventTarget()))) {
		if (getDesiredLeftPosition() != this.leftPosition || getDesiredTopPosition() != this.topPosition) {
			updatePopupPositionOnScroll();
		}
	}

	super.onPreviewNativeEvent(event);
}
 
Example #16
Source File: MaterialValueBox.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
protected void onLoad() {
    super.onLoad();

    String id = DOM.createUniqueId();
    valueBoxBase.getElement().setId(id);
    label.getElement().setAttribute("for", id);
    loadEvents();
    // Make valueBoxBase the primary focus target
    getFocusableMixin().setUiObject(new MaterialWidget(valueBoxBase.getElement()));
}
 
Example #17
Source File: MaterialDropDown.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public void load() {
    Widget parent = getParent();
    if (parent instanceof HasActivates) {
        String uid = DOM.createUniqueId();
        ((HasActivates) parent).setActivates(uid);
        setId(uid);
        activatorElement = parent.getElement();
    } else if (activatorElement == null) {
        activatorElement = DOMHelper.getElementByAttribute("data-activates", activator);
    }

    $(activatorElement).dropdown(options);

}
 
Example #18
Source File: JsonTable.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public void load() {
    if (value != null) {
        setId(DOM.createUniqueId());
        options.id = "#" + getId();

        JsTable.jsontotable(value, options);

        $("tr").mousedown((e, handler) -> {
            SelectionEvent.fire(JsonTable.this, $(e.target).parent().asElement());
            return true;
        });
    }
}
 
Example #19
Source File: TimelineWidget.java    From gantt with Apache License 2.0 5 votes vote down vote up
private int calculateResolutionMinWidth() {

        boolean removeResolutionDiv = false;
        if (!resolutionDiv.hasParentElement()) {
            removeResolutionDiv = true;
            getElement().appendChild(resolutionDiv);
        }
        DivElement resBlockMeasure = DivElement.as(DOM.createDiv());
        if (resolution == Resolution.Week) {
            // configurable with '.col.w.measure' selector
            resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_WEEK + " " + STYLE_MEASURE);
        } else {
            // measure for text 'MM'
            resBlockMeasure.setInnerText("MM");
            // configurable with '.col.measure' selector
            resBlockMeasure.setClassName(STYLE_COL + " " + STYLE_MEASURE);
        }
        resolutionDiv.appendChild(resBlockMeasure);
        int width = resBlockMeasure.getClientWidth();
        if (resolution == Resolution.Week) {
            // divide given width by number of days in week
            width = width / DAYS_IN_WEEK;
        }
        width = (width < resolutionWeekDayblockWidth) ? resolutionWeekDayblockWidth : width;
        resBlockMeasure.removeFromParent();
        if (removeResolutionDiv) {
            resolutionDiv.removeFromParent();
        }
        return width;
    }
 
Example #20
Source File: CubaSourceCodeEditorWidget.java    From cuba with Apache License 2.0 5 votes vote down vote up
@Override
public void onBrowserEvent(Event event) {
    int type = DOM.eventGetType(event);
    if (type == Event.ONKEYDOWN
            && event.getKeyCode() == KeyCodes.KEY_ENTER
            && !event.getAltKey()
            && !event.getShiftKey()
            && !event.getCtrlKey()) {
        event.stopPropagation();
        return;
    }

    super.onBrowserEvent(event);
}
 
Example #21
Source File: VComboBoxMultiselect.java    From vaadin-combobox-multiselect with Apache License 2.0 5 votes vote down vote up
@Override
public void onKeyDown(KeyDownEvent event) {
	if (this.enabled && !this.readonly) {
		int keyCode = event.getNativeKeyCode();

		debug("VComboBoxMultiselect: key down: " + keyCode);

		if (this.dataReceivedHandler.isWaitingForFilteringResponse() && navigationKeyCodes.contains(keyCode)
				&& (!this.allowNewItems || keyCode != KeyCodes.KEY_ENTER)) {
			/*
			 * Keyboard navigation events should not be handled while we are
			 * waiting for a response. This avoids flickering, disappearing
			 * items, wrongly interpreted responses and more.
			 */
			debug("Ignoring " + keyCode + " because we are waiting for a filtering response");

			DOM.eventPreventDefault(DOM.eventGetCurrentEvent());
			event.stopPropagation();
			return;
		}

		if (this.suggestionPopup.isAttached()) {
			debug("Keycode " + keyCode + " target is popup");
			popupKeyDown(event);
		} else {
			debug("Keycode " + keyCode + " target is text field");
			inputFieldKeyDown(event);
		}
	}
}
 
Example #22
Source File: UniTimeTableHeader.java    From unitime with Apache License 2.0 5 votes vote down vote up
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
	case Event.ONKEYPRESS:
		MenuItem item = iAccessKeys.get(Character.toLowerCase((char)event.getCharCode()));
		if (item != null) {
			event.stopPropagation();
			event.preventDefault();
			item.getScheduledCommand().execute();
		}
	}
	super.onBrowserEvent(event);
	
}
 
Example #23
Source File: OpenProjectTool.java    From geowe-core with GNU General Public License v3.0 5 votes vote down vote up
@PostConstruct
private void initialize() {
	addDialogListener();
	addCloseButtonHandler();
	openProjectDialog.getUploadPanel().addSubmitCompleteHandler(new SubmitCompleteHandler() {
		public void onSubmitComplete(final SubmitCompleteEvent event) {

			final Element label = DOM.createLabel();
			label.setInnerHTML(event.getResults());

			final String jsonProject = label.getInnerText();
			
			openProjectDialog.hide();
			if (hasError(jsonProject)) {
				autoMessageBox.hide();
				showAlert("Error: " + jsonProject);
				return;
			}
			
			projectLoader.load(jsonProject);				
			autoMessageBox.hide();
							
		}

		private boolean hasError(final String contentFile) {
			return contentFile.startsWith("413")
					|| contentFile.startsWith("500")
					||  contentFile.startsWith("204")
					||  contentFile.startsWith("406");
		}

		
	});
}
 
Example #24
Source File: Util.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Download file by UUID
 */
public static void downloadFileByUUID(String uuid, String params) {
	if (!params.equals("") && !params.endsWith("&")) {
		params += "&";
	}

	final Element downloadIframe = RootPanel.get("__download").getElement();
	String url = RPCService.DownloadServlet + "?" + params + "uuid=" + URL.encodeQueryString(uuid);
	DOM.setElementAttribute(downloadIframe, "src", url);
}
 
Example #25
Source File: DiagramTab.java    From SensorWebClient with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Creates the Slider the user can interact with to change the shown time intervals of the given
 * timeseries'.
 *
 * @return the TimeSlider as a whole
 */
private HorizontalPanel createOverviewSlider() {
    HorizontalPanel horizontalSlider = new HorizontalPanel();
    DOM.setStyleAttribute(horizontalSlider.getElement(), "marginTop", "6px");
    horizontalSlider.setHeight("75px");

    this.leftHandleWidget = buildSliderPart("8px", "75px", "w-resize", "#6585d0", 0.5);
    this.rightHandleWidget = buildSliderPart("8px", "75px", "e-resize", "#6585d0", 0.5);
    this.mainHandleWidget = buildSliderPart("100%", "75px", "move", "#aaa", 0.5);

    horizontalSlider.add(this.leftHandleWidget);
    horizontalSlider.setCellWidth(this.leftHandleWidget, "15px");
    horizontalSlider.add(this.mainHandleWidget);
    horizontalSlider.setCellWidth(this.mainHandleWidget, "100%");
    horizontalSlider.add(this.rightHandleWidget);
    horizontalSlider.setCellWidth(this.rightHandleWidget, "15px");
    DOM.setStyleAttribute(horizontalSlider.getElement(), "visibility", "hidden");

    GenericWidgetViewImpl view = new GenericWidgetViewImpl(horizontalSlider);
    OverviewPresenter overviewPresenter = new OverviewPresenter(view, this.overviewEventBus, this.mainChartEventBus);

    // Define handles for overview control
    GenericWidgetView leftHandle = new GenericWidgetViewImpl(this.leftHandleWidget);
    GenericWidgetView mainHandle = new GenericWidgetViewImpl(this.mainHandleWidget);
    GenericWidgetView rightHandle = new GenericWidgetViewImpl(this.rightHandleWidget);

    overviewPresenter.addHandle(leftHandle, Bound.LEFT);
    overviewPresenter.addHandle(mainHandle, Bound.RIGHT, Bound.LEFT);
    overviewPresenter.addHandle(rightHandle, Bound.RIGHT);
    overviewPresenter.setMinClippingWidth(40); // min width
    overviewPresenter.setVerticallyLocked(true); // drag horizontally only

    return horizontalSlider;
}
 
Example #26
Source File: GanttWidget.java    From gantt with Apache License 2.0 5 votes vote down vote up
/**
 * @param child
 *            Child widget.
 * @param container
 *            Parent element.
 * @param beforeIndex
 *            Target index of element in DOM.
 * @param domInsert
 *            true: Insert at specific position. false: append at the end.
 */
@Override
protected void insert(Widget child, Element container, int beforeIndex, boolean domInsert) {
    GWT.log("Count content elements: " + content.getChildCount() + " ("
            + getAdditionalNonWidgetContentElementCount() + " non-widget non-step elements, "
            + (getAdditonalContentElementCount() - getAdditionalNonWidgetContentElementCount())
            + " non-step widgets.)");

    // Validate index; adjust if the widget is already a child of this
    // panel.
    int adjustedBeforeStepIndex = adjustIndex(child, beforeIndex - getAdditionalNonWidgetContentElementCount())
            - getAdditionalWidgetContentElementCount();

    // Detach new child. Might also remove additional widgets like
    // predecessor arrows. May affect contentHeight.
    child.removeFromParent();

    // Logical attach.
    getChildren().insert(child, adjustedBeforeStepIndex + getAdditionalWidgetContentElementCount());

    // Physical attach.
    if (domInsert) {
        DOM.insertChild(container, child.getElement(), adjustedBeforeStepIndex + getAdditonalContentElementCount());
    } else {
        DOM.appendChild(container, child.getElement());
    }

    // Adopt.
    adopt(child);
}
 
Example #27
Source File: MockComponentsUtil.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the background color for the given widget.
 *
 * @param widget  widget to change background color for
 * @param color  new color (RGB value)
 */
static void setWidgetBackgroundColor(Widget widget, String color) {
  if (isNoneColor(color)) {
    DOM.setStyleAttribute(widget.getElement(), "backgroundColor", "transparent");
  } else {
    DOM.setStyleAttribute(widget.getElement(), "backgroundColor", "#" + getHexString(color, 6));
  }
}
 
Example #28
Source File: AriaSuggestBox.java    From unitime with Apache License 2.0 5 votes vote down vote up
@Override
public void onBrowserEvent(Event event) {
	switch (DOM.eventGetType(event)) {
    case Event.ONBLUR:
    	BlurEvent.fireNativeEvent(event, this);
    	break;
    case Event.ONFOCUS:
    	FocusEvent.fireNativeEvent(event, this);
    	break;
	}
	super.onBrowserEvent(event);
}
 
Example #29
Source File: Kanban.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
public void load() {
    setId(DOM.createUniqueId());
    kanbanOptions = getOptions();
    kanbanOptions.setElement("#" + getId());
    kanban = new JKanban(getOptions());

    if (responsive) {
        responsiveLoader.load();
    } else {
        responsiveLoader.unload();
    }
}
 
Example #30
Source File: LanguageSelector.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
protected <T extends MaterialWidget & HasActivates> void setActivator(T widget) {
    String activator = DOM.createUniqueId();
    widget.setActivates(activator);
    widget.addStyleName(IncubatorCssName.LANGUAGE_ACTIVATOR);
    add(widget);
    dropdown.setActivator(activator);
    dropdown.reload();
}