jdk/src/java.desktop/share/classes/sun/awt/datatransfer/SunClipboard.java
author serb
Wed, 25 Feb 2015 14:01:27 +0300
changeset 29505 682be03b8f41
parent 25859 3317bb8137f4
child 29885 6eb60fac3383
permissions -rw-r--r--
8043393: NullPointerException and no event received when clipboard data flavor changes Reviewed-by: ant, azvegint
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
     2
 * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt.datatransfer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.EventQueue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.datatransfer.Clipboard;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.datatransfer.FlavorTable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.datatransfer.SystemFlavorMap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.datatransfer.Transferable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.datatransfer.ClipboardOwner;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.datatransfer.DataFlavor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.datatransfer.FlavorListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.awt.datatransfer.FlavorEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.awt.datatransfer.UnsupportedFlavorException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
    43
import java.util.Arrays;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import java.util.Set;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import java.util.HashSet;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import sun.awt.AppContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
import sun.awt.PeerEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
import sun.awt.SunToolkit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * Serves as a common, helper superclass for the Win32 and X11 system
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * Clipboards.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * @author Danila Sinopalnikov
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * @author Alexander Gerasimov
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * @since 1.3
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
public abstract class SunClipboard extends Clipboard
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    implements PropertyChangeListener {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    private AppContext contentsContext = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private final Object CLIPBOARD_FLAVOR_LISTENER_KEY;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * A number of <code>FlavorListener</code>s currently registered
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * on this clipboard across all <code>AppContext</code>s.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    private volatile int numberOfFlavorListeners = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
    77
     * A set of {@code DataFlavor}s that is available on this clipboard. It is
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
    78
     * used for tracking changes of {@code DataFlavor}s available on this
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
    79
     * clipboard. Can be {@code null}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     */
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
    81
    private volatile long[] currentFormats;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public SunClipboard(String name) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        super(name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        CLIPBOARD_FLAVOR_LISTENER_KEY = new StringBuffer(name + "_CLIPBOARD_FLAVOR_LISTENER_KEY");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public synchronized void setContents(Transferable contents,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                                         ClipboardOwner owner) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        // 4378007 : Toolkit.getSystemClipboard().setContents(null, null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        // should throw NPE
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        if (contents == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
            throw new NullPointerException("contents");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        initContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        final ClipboardOwner oldOwner = this.owner;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        final Transferable oldContents = this.contents;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
            this.owner = owner;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            this.contents = new TransferableProxy(contents, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
            setContentsNative(contents);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            if (oldOwner != null && oldOwner != owner) {
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   108
                EventQueue.invokeLater(() -> oldOwner.lostOwnership(SunClipboard.this, oldContents));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    private synchronized void initContext() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        final AppContext context = AppContext.getAppContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
        if (contentsContext != context) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
            // Need to synchronize on the AppContext to guarantee that it cannot
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
            // be disposed after the check, but before the listener is added.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
            synchronized (context) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                if (context.isDisposed()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    throw new IllegalStateException("Can't set contents from disposed AppContext");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                context.addPropertyChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    (AppContext.DISPOSED_PROPERTY_NAME, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            if (contentsContext != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                contentsContext.removePropertyChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                    (AppContext.DISPOSED_PROPERTY_NAME, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            contentsContext = context;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
    public synchronized Transferable getContents(Object requestor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        if (contents != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            return contents;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        return new ClipboardTransferable(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * @return the contents of this clipboard if it has been set from the same
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     *         AppContext as it is currently retrieved or null otherwise
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    private synchronized Transferable getContextContents() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        AppContext context = AppContext.getAppContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        return (context == contentsContext) ? contents : null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * @see java.awt.Clipboard#getAvailableDataFlavors
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    public DataFlavor[] getAvailableDataFlavors() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        Transferable cntnts = getContextContents();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        if (cntnts != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
            return cntnts.getTransferDataFlavors();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        long[] formats = getClipboardFormatsOpenClose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        return DataTransferer.getInstance().
23905
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   166
            getFlavorsForFormatsAsArray(formats, getDefaultFlavorTable());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * @see java.awt.Clipboard#isDataFlavorAvailable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    public boolean isDataFlavorAvailable(DataFlavor flavor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        if (flavor == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
            throw new NullPointerException("flavor");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        Transferable cntnts = getContextContents();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        if (cntnts != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            return cntnts.isDataFlavorSupported(flavor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        long[] formats = getClipboardFormatsOpenClose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        return formatArrayAsDataFlavorSet(formats).contains(flavor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @see java.awt.Clipboard#getData
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    public Object getData(DataFlavor flavor)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        throws UnsupportedFlavorException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        if (flavor == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            throw new NullPointerException("flavor");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        Transferable cntnts = getContextContents();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        if (cntnts != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            return cntnts.getTransferData(flavor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        long format = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        byte[] data = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        Transferable localeTransferable = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            openClipboard(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            long[] formats = getClipboardFormats();
23279
16c1ddb7b66a 8030093: Generify DataTrasfer classes
pchelko
parents: 5506
diff changeset
   211
            Long lFormat = DataTransferer.getInstance().
23905
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   212
                    getFlavorsForFormats(formats, getDefaultFlavorTable()).get(flavor);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
            if (lFormat == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                throw new UnsupportedFlavorException(flavor);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            format = lFormat.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            data = getClipboardData(format);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
            if (DataTransferer.getInstance().isLocaleDependentTextFormat(format)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                localeTransferable = createLocaleTransferable(formats);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            closeClipboard();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        return DataTransferer.getInstance().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                translateBytes(data, flavor, format, localeTransferable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * The clipboard must be opened.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    protected Transferable createLocaleTransferable(long[] formats) throws IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     * @throws IllegalStateException if the clipboard has not been opened
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    public void openClipboard(SunClipboard newOwner) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    public void closeClipboard() {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    public abstract long getID();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public void propertyChange(PropertyChangeEvent evt) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        if (AppContext.DISPOSED_PROPERTY_NAME.equals(evt.getPropertyName()) &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
            Boolean.TRUE.equals(evt.getNewValue())) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
            final AppContext disposedContext = (AppContext)evt.getSource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
            lostOwnershipLater(disposedContext);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    protected void lostOwnershipImpl() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        lostOwnershipLater(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     * Clears the clipboard state (contents, owner and contents context) and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * notifies the current owner that ownership is lost. Does nothing if the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * argument is not <code>null</code> and is not equal to the current
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * contents context.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     * @param disposedContext the AppContext that is disposed or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *        <code>null</code> if the ownership is lost because another
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *        application acquired ownership.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    protected void lostOwnershipLater(final AppContext disposedContext) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        final AppContext context = this.contentsContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        if (context == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        final Runnable runnable = new Runnable() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                public void run() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                    final SunClipboard sunClipboard = SunClipboard.this;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                    ClipboardOwner owner = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                    Transferable contents = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
                    synchronized (sunClipboard) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
                        final AppContext context = sunClipboard.contentsContext;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
                        if (context == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
                            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
                        if (disposedContext == null || context == disposedContext) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
                            owner = sunClipboard.owner;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
                            contents = sunClipboard.contents;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
                            sunClipboard.contentsContext = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
                            sunClipboard.owner = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
                            sunClipboard.contents = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                            sunClipboard.clearNativeContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
                            context.removePropertyChangeListener
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                                (AppContext.DISPOSED_PROPERTY_NAME, sunClipboard);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
                    if (owner != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
                        owner.lostOwnership(sunClipboard, contents);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
            };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        SunToolkit.postEvent(context, new PeerEvent(this, runnable,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                                                    PeerEvent.PRIORITY_EVENT));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
    protected abstract void clearNativeContext();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    protected abstract void setContentsNative(Transferable contents);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * @since 1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    protected long[] getClipboardFormatsOpenClose() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
            openClipboard(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            return getClipboardFormats();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
            closeClipboard();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * Returns zero-length array (not null) if the number of available formats is zero.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * @throws IllegalStateException if formats could not be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    protected abstract long[] getClipboardFormats();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
    protected abstract byte[] getClipboardData(long format) throws IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
24538
25bf8153fbfe 8039642: Fix raw and unchecked warnings in sun.awt.*
henryjen
parents: 24183
diff changeset
   340
    private static Set<DataFlavor> formatArrayAsDataFlavorSet(long[] formats) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        return (formats == null) ? null :
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                DataTransferer.getInstance().
23905
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   343
                getFlavorsForFormatsAsSet(formats, getDefaultFlavorTable());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    public synchronized void addFlavorListener(FlavorListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        if (listener == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        AppContext appContext = AppContext.getAppContext();
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   352
        Set<FlavorListener> flavorListeners = getFlavorListeners(appContext);
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   353
        if (flavorListeners == null) {
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   354
            flavorListeners = new HashSet<>();
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   355
            appContext.put(CLIPBOARD_FLAVOR_LISTENER_KEY, flavorListeners);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        }
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   357
        flavorListeners.add(listener);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        if (numberOfFlavorListeners++ == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
            long[] currentFormats = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
                openClipboard(null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
                currentFormats = getClipboardFormats();
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   364
            } catch (final IllegalStateException ignored) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
            } finally {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
                closeClipboard();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
            }
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   368
            this.currentFormats = currentFormats;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
            registerClipboardViewerChecked();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    public synchronized void removeFlavorListener(FlavorListener listener) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        if (listener == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        }
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   378
        Set<FlavorListener> flavorListeners = getFlavorListeners(AppContext.getAppContext());
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   379
        if (flavorListeners == null){
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
            //else we throw NullPointerException, but it is forbidden
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        }
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   383
        if (flavorListeners.remove(listener) && --numberOfFlavorListeners == 0) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
            unregisterClipboardViewerChecked();
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   385
            currentFormats = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   389
    @SuppressWarnings("unchecked")
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   390
    private Set<FlavorListener> getFlavorListeners(AppContext appContext) {
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   391
        return (Set<FlavorListener>)appContext.get(CLIPBOARD_FLAVOR_LISTENER_KEY);
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   392
    }
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   393
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    public synchronized FlavorListener[] getFlavorListeners() {
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   395
        Set<FlavorListener> flavorListeners = getFlavorListeners(AppContext.getAppContext());
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   396
        return flavorListeners == null ? new FlavorListener[0]
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   397
                : flavorListeners.toArray(new FlavorListener[flavorListeners.size()]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    public boolean areFlavorListenersRegistered() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
        return (numberOfFlavorListeners > 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    protected abstract void registerClipboardViewerChecked();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    protected abstract void unregisterClipboardViewerChecked();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     * Checks change of the <code>DataFlavor</code>s and, if necessary,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * posts notifications on <code>FlavorEvent</code>s to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * AppContexts' EDTs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * The parameter <code>formats</code> is null iff we have just
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * failed to get formats available on the clipboard.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * @param formats data formats that have just been retrieved from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     *        this clipboard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     */
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   418
    public final void checkChange(final long[] formats) {
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   419
        if (Arrays.equals(formats, currentFormats)) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
            // we've been able to successfully get available on the clipboard
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
            // DataFlavors this and previous time and they are coincident;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
            // don't notify
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
            return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
        }
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   425
        currentFormats = formats;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
29505
682be03b8f41 8043393: NullPointerException and no event received when clipboard data flavor changes
serb
parents: 25859
diff changeset
   427
        for (final AppContext appContext : AppContext.getAppContexts()) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
            if (appContext == null || appContext.isDisposed()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
                continue;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
            }
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   431
            Set<FlavorListener> flavorListeners = getFlavorListeners(appContext);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
            if (flavorListeners != null) {
24153
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   433
                for (FlavorListener listener : flavorListeners) {
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   434
                    if (listener != null) {
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   435
                        PeerEvent peerEvent = new PeerEvent(this,
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   436
                                () -> listener.flavorsChanged(new FlavorEvent(SunClipboard.this)),
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   437
                                PeerEvent.PRIORITY_EVENT);
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   438
                        SunToolkit.postEvent(appContext, peerEvent);
2c19973ab9f2 6463901: Either generify or deprecate sun.awt.EventListenerAggregate
pchelko
parents: 23279
diff changeset
   439
                    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
23905
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   445
    public static FlavorTable getDefaultFlavorTable() {
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   446
        return (FlavorTable) SystemFlavorMap.getDefaultFlavorMap();
51af43e32270 8026797: Enhance data transfers
malenkov
parents: 23279
diff changeset
   447
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
}