1.1 --- a/samples/friendpackage/src/implpkg/Accessor.java Fri Oct 24 12:07:34 2008 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,60 +0,0 @@
1.4 -/*
1.5 - * Sun Public License Notice
1.6 - *
1.7 - * The contents of this file are subject to the Sun Public License
1.8 - * Version 1.0 (the "License"). You may not use this file except in
1.9 - * compliance with the License. A copy of the License is available at
1.10 - * http://www.sun.com/
1.11 - *
1.12 - * The Original Code is NetBeans. The Initial Developer of the Original
1.13 - * Code is Jaroslav Tulach. Portions Copyright 2007 Jaroslav Tulach.
1.14 - * All Rights Reserved.
1.15 - */
1.16 -
1.17 -package implpkg;
1.18 -
1.19 -import apipkg.Item;
1.20 -import javax.swing.event.ChangeListener;
1.21 -
1.22 -/**
1.23 - *
1.24 - * @author Jaroslav Tulach
1.25 - */
1.26 -// BEGIN: design.less.friend.Accessor
1.27 -public abstract class Accessor {
1.28 - private static volatile Accessor DEFAULT;
1.29 - public static Accessor getDefault() {
1.30 - Accessor a = DEFAULT;
1.31 - if (a == null) {
1.32 - throw new IllegalStateException("Something is wrong: " + a);
1.33 - }
1.34 - return a;
1.35 - }
1.36 -
1.37 - public static void setDefault(Accessor accessor) {
1.38 - if (DEFAULT != null) {
1.39 - throw new IllegalStateException();
1.40 - }
1.41 - DEFAULT = accessor;
1.42 - }
1.43 -
1.44 - public Accessor() {
1.45 - }
1.46 -
1.47 - protected abstract Item newItem();
1.48 - protected abstract void addChangeListener(Item item, ChangeListener l);
1.49 -// FINISH: design.less.friend.Accessor
1.50 -
1.51 - // BEGIN: design.less.friend.InitAPI
1.52 - private static final Class<?> INIT_API_CLASS = loadClass(Item.class.getName());
1.53 - private static Class<?> loadClass(String name) {
1.54 - try {
1.55 - return Class.forName(
1.56 - name, true, Accessor.class.getClassLoader()
1.57 - );
1.58 - } catch (Exception ex) {
1.59 - throw new RuntimeException(ex);
1.60 - }
1.61 - }
1.62 - // END: design.less.friend.InitAPI
1.63 -}