KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > core > spi > multiview > MultiViewDescription


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.spi.multiview;
21
22 import java.awt.Image JavaDoc;
23 import org.openide.util.HelpCtx;
24
25 /** Description of multi view element. Implementations should be lightweight
26  * and fast. Creating heavyweight {@link org.netbeans.core.spi.multiview.MultiViewElement} instances asociated with
27  * Swing visual representation should be done lazily in {@link #createElement} methods.
28  * The implementing class should be serializable. For performance reasons,
29  * don't include the element into serialization of the description. That one will be handled
30  * separately when necessary.
31  *
32  * @author Dafe Simonek, Milos Kleint
33  */

34 public interface MultiViewDescription {
35     
36     /** Gets persistence type of multi view element, the TopComponent will decide
37      * on it's onw persistenceType based on the sum of all it's elements.
38      * {@link org.openide.windows.TopComponent#PERSISTENCE_ALWAYS} has higher priority than {@link org.openide.windows.TopComponent#PERSISTENCE_ONLY_OPENED}
39      * and {@link org.openide.windows.TopComponent#PERSISTENCE_NEVER} has lowest priority.
40      * The {@link org.openide.windows.TopComponent} will be stored only if at least one element requesting persistence
41      * was made visible.
42      */

43     public int getPersistenceType();
44
45     /**
46      * Gets localized display name of multi view element. Will be placed on the Element's toggle button.
47      *@return localized display name
48      */

49     public String JavaDoc getDisplayName();
50     
51     /**
52      * Icon for the MultiViewDescription's multiview component. Will be shown as TopComponent's icon
53      * when this element is selected.
54      * @return the icon of multi view element
55      */

56     public Image JavaDoc getIcon ();
57
58     /** Get the help context of multi view element.
59     */

60     public HelpCtx getHelpCtx ();
61     
62     /**
63      * A Description's contribution
64      * to unique {@link org.openide.windows.TopComponent}'s Id returned by <code>getID</code>. Returned value is used as starting
65      * value for creating unique {@link org.openide.windows.TopComponent} ID for whole enclosing multi view
66      * component.
67      * Value should be preferably unique, but need not be.
68      */

69     public String JavaDoc preferredID();
70     
71     /** Creates and returns asociated multi view element. it is called just once during the lifecycle of the
72      * multiview component.
73      * @return the multiview element associated with this description
74      */

75     public MultiViewElement createElement ();
76     
77 }
Popular Tags