com.vaadin.client.ui.VEmbedded Maven / Gradle / Ivy
Show all versions of vaadin-client Show documentation
/*
* Copyright 2000-2014 Vaadin Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package com.vaadin.client.ui;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import com.google.gwt.dom.client.Element;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTML;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorMap;
import com.vaadin.client.UIDL;
import com.vaadin.client.Util;
import com.vaadin.client.VConsole;
import com.vaadin.client.WidgetUtil;
import com.vaadin.shared.ui.embedded.EmbeddedConstants;
public class VEmbedded extends HTML {
public static String CLASSNAME = "v-embedded";
/** For internal use only. May be removed or replaced in the future. */
public Element browserElement;
/** For internal use only. May be removed or replaced in the future. */
public String type;
/** For internal use only. May be removed or replaced in the future. */
public String mimetype;
/** For internal use only. May be removed or replaced in the future. */
public ApplicationConnection client;
public VEmbedded() {
setStyleName(CLASSNAME);
}
/**
* Creates the Object and Embed tags for the Flash plugin so it works
* cross-browser.
*
* For internal use only. May be removed or replaced in the future.
*
* @param uidl
* The UIDL
* @return Tags concatenated into a string
*/
public String createFlashEmbed(UIDL uidl) {
/*
* To ensure cross-browser compatibility we are using the twice-cooked
* method to embed flash i.e. we add a OBJECT tag for IE ActiveX and
* inside it a EMBED for all other browsers.
*/
StringBuilder html = new StringBuilder();
// Start the object tag
html.append("");
return html.toString();
}
/**
* Returns a map (name -> value) of all parameters in the UIDL.
*
* For internal use only. May be removed or replaced in the future.
*
* @param uidl
* @return
*/
public static Map getParameters(UIDL uidl) {
Map parameters = new HashMap();
Iterator