KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > NbClipboardIsUsedByAlreadyInitializedComponentsTest


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.core;
21
22 import java.awt.datatransfer.*;
23 import java.io.IOException JavaDoc;
24 import java.util.*;
25 import javax.swing.JComboBox JavaDoc;
26 import javax.swing.TransferHandler JavaDoc;
27 import org.netbeans.junit.*;
28 import junit.textui.TestRunner;
29 import org.openide.filesystems.*;
30 import org.openide.loaders.*;
31 import org.openide.modules.ModuleInfo;
32 import org.openide.util.Lookup;
33 import org.openide.util.datatransfer.*;
34 import org.openide.util.datatransfer.ExClipboard;
35
36 /** Test that verifies that Clipboard is used by swing components.
37  * @author Jaroslav Tulach
38  * @see "#40693"
39  */

40 public class NbClipboardIsUsedByAlreadyInitializedComponentsTest extends NbClipboardIsUsedBySwingComponentsTest {
41     private javax.swing.JTextField JavaDoc field;
42     
43     public NbClipboardIsUsedByAlreadyInitializedComponentsTest (String JavaDoc name) {
44         super(name);
45     }
46
47     protected void inMiddleOfSettingUpTheManager() {
48         assertNotNull("There is a manager already", System.getSecurityManager());
49         // do some strange tricks to initialize the system
50
field = new javax.swing.JTextField JavaDoc ();
51         TransferHandler.getCopyAction();
52         TransferHandler.getCutAction();
53         TransferHandler.getPasteAction();
54     }
55     
56     /** overrides to return field that exists since begining and was not instantiated
57      * after SecurityManager hack is started */

58     protected javax.swing.JTextField JavaDoc getField () {
59         return field;
60     }
61     
62 }
63
Popular Tags