001: /*
002: * Sun Public License Notice
003: *
004: * The contents of this file are subject to the Sun Public License
005: * Version 1.0 (the "License"). You may not use this file except in
006: * compliance with the License. A copy of the License is available at
007: * http://www.sun.com/
008: *
009: * The Original Code is NetBeans. The Initial Developer of the Original
010: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
011: * Microsystems, Inc. All Rights Reserved.
012:
013: If you wish your version of this file to be governed by only the CDDL
014: or only the GPL Version 2, indicate your decision by adding
015: "[Contributor] elects to include this software in this distribution
016: under the [CDDL or GPL Version 2] license." If you do not indicate a
017: single choice of license, a recipient has the option to distribute
018: your version of this file under either the CDDL, the GPL Version 2 or
019: to extend the choice of license to its licensees as provided above.
020: However, if you add GPL Version 2 code and therefore, elected the GPL
021: Version 2 license, then the option applies only if the new code is
022: made subject to such option by the copyright holder.
023:
024: If you wish your version of this file to be governed by only the CDDL
025: or only the GPL Version 2, indicate your decision by adding
026: "[Contributor] elects to include this software in this distribution
027: under the [CDDL or GPL Version 2] license." If you do not indicate a
028: single choice of license, a recipient has the option to distribute
029: your version of this file under either the CDDL, the GPL Version 2 or
030: to extend the choice of license to its licensees as provided above.
031: However, if you add GPL Version 2 code and therefore, elected the GPL
032: Version 2 license, then the option applies only if the new code is
033: made subject to such option by the copyright holder.
034: */
035: package org.netbeans.modules.vmd.inspector;
036:
037: import java.awt.BorderLayout;
038: import java.awt.Color;
039: import org.openide.util.Lookup;
040: import javax.swing.*;
041: import org.netbeans.spi.navigator.NavigatorPanel;
042: import org.openide.util.NbBundle;
043: import org.openide.util.lookup.AbstractLookup;
044: import org.openide.util.lookup.InstanceContent;
045:
046: /**
047: * @author Karol Harezlak
048: */
049:
050: public final class InspectorPanel implements NavigatorPanel {
051:
052: private static InspectorPanel INSTANCE;
053:
054: private JPanel panel;
055: private Lookup lookup;
056: private final InstanceContent ic;
057:
058: public static InspectorPanel getInstance() {
059: synchronized (InspectorPanel.class) {
060: if (INSTANCE == null) {
061: INSTANCE = new InspectorPanel();
062: }
063: return INSTANCE;
064: }
065: }
066:
067: private InspectorPanel() {
068: this .ic = new InstanceContent();
069: this .lookup = new AbstractLookup(ic);
070: this .panel = new JPanel(new BorderLayout());
071: this .panel.setBackground(Color.WHITE);
072: }
073:
074: public String getDisplayName() {
075: return NbBundle.getMessage(InspectorPanel.class,
076: "LBL_InspectorPanelDisplayName"); //NOI18N
077: }
078:
079: public String getDisplayHint() {
080: return NbBundle.getMessage(InspectorPanel.class,
081: "LBL_InspectorPanelHint"); //NOI18N
082: }
083:
084: public synchronized JComponent getComponent() {
085: return panel;
086: }
087:
088: public void panelActivated(Lookup lookup) {
089: }
090:
091: public void panelDeactivated() {
092: }
093:
094: public Lookup getLookup() {
095: return lookup;
096: }
097:
098: public InstanceContent getInstanceContent() {
099: return ic;
100: }
101:
102: }
|