Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (C) 2000-2023 Vaadin Ltd
*
* This program is available under Vaadin Commercial License and Service Terms.
*
* See for the full
* license.
*/
package com.vaadin.ui;
import java.util.Iterator;
import com.vaadin.event.MouseEvents.ClickEvent;
import com.vaadin.event.MouseEvents.ClickListener;
import com.vaadin.server.Resource;
import com.vaadin.shared.EventId;
import com.vaadin.shared.Registration;
import com.vaadin.shared.ui.embedded.EmbeddedServerRpc;
import com.vaadin.shared.ui.embedded.EmbeddedState;
/**
* A component for embedding external objects.
*
* The {@code Embedded} component is used to display various types of multimedia
* content using the HTML {@code
*
* @param type
* the type to set.
*/
public void setType(int type) {
if (type != TYPE_OBJECT && type != TYPE_IMAGE && type != TYPE_BROWSER) {
throw new IllegalArgumentException("Unsupported type");
}
if (type != getType()) {
getState().type = type;
}
}
/**
* This attribute may be used to specify a space-separated list of URIs for
* archives containing resources relevant to the object, which may include
* the resources specified by the classid and data attributes. Preloading
* archives will generally result in reduced load times for objects.
* Archives specified as relative URIs should be interpreted relative to the
* codebase attribute.
*
* @return Space-separated list of URIs with resources relevant to the
* object
*/
public String getArchive() {
return getState(false).archive;
}
/**
* This attribute may be used to specify a space-separated list of URIs for
* archives containing resources relevant to the object, which may include
* the resources specified by the classid and data attributes. Preloading
* archives will generally result in reduced load times for objects.
* Archives specified as relative URIs should be interpreted relative to the
* codebase attribute.
*
* @param archive
* Space-separated list of URIs with resources relevant to the
* object
*/
public void setArchive(String archive) {
String oldArchive = getArchive();
if (archive != oldArchive
|| (archive != null && !archive.equals(oldArchive))) {
getState().archive = archive;
}
}
/**
* Add a click listener to the component. The listener is called whenever
* the user clicks inside the component. Depending on the content the event
* may be blocked and in that case no event is fired.
*
* @see Registration
*
* @param listener
* The listener to add
* @return a registration object for removing the listener
* @since 8.0
*/
public Registration addClickListener(ClickListener listener) {
return addListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class,
listener, ClickListener.clickMethod);
}
/**
* Remove a click listener from the component. The listener should earlier
* have been added using {@link #addClickListener(ClickListener)}.
*
* @param listener
* The listener to remove
*
* @deprecated As of 8.0, replaced by {@link Registration#remove()} in the
* registration object returned from
* {@link #addClickListener(ClickListener)}.
*/
@Deprecated
public void removeClickListener(ClickListener listener) {
removeListener(EventId.CLICK_EVENT_IDENTIFIER, ClickEvent.class,
listener);
}
@Override
protected EmbeddedState getState() {
return (EmbeddedState) super.getState();
}
@Override
protected EmbeddedState getState(boolean markAsDirty) {
return (EmbeddedState) super.getState(markAsDirty);
}
}