All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vaadin.event.TransferableImpl Maven / Gradle / Ivy

There is a newer version: 8.27.3
Show newest version
/*
 * Copyright (C) 2000-2024 Vaadin Ltd
 *
 * This program is available under Vaadin Commercial License and Service Terms.
 *
 * See  for the full
 * license.
 */
package com.vaadin.event;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import com.vaadin.ui.Component;

/**
 * TODO Javadoc!
 *
 * @since 6.3
 */
public class TransferableImpl implements Transferable {
    private Map rawVariables = new HashMap<>();
    private final Component sourceComponent;

    public TransferableImpl(Component sourceComponent,
            Map rawVariables) {
        this.sourceComponent = sourceComponent;
        this.rawVariables = rawVariables;
    }

    @Override
    public Component getSourceComponent() {
        return sourceComponent;
    }

    @Override
    public Object getData(String dataFlavor) {
        return rawVariables.get(dataFlavor);
    }

    @Override
    public void setData(String dataFlavor, Object value) {
        rawVariables.put(dataFlavor, value);
    }

    @Override
    public Collection getDataFlavors() {
        return rawVariables.keySet();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy