This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 217091
Collapse All | Expand All

(-)spi.navigator/apichanges.xml (+15 lines)
Lines 108-113 Link Here
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
108
    <!-- ACTUAL CHANGES BEGIN HERE: -->
109
109
110
  <changes>
110
  <changes>
111
    <change id="NavigatorPanelWithToolbar">
112
        <api name="navigator_api"/>
113
        <summary>Added SPI interface <code>@NavigatorPanelWithToolbar</code></summary>
114
        <version major="1" minor="25"/>
115
        <date year="2012" month="8" day="20"/>
116
        <author login="jpeska"/>
117
        <compatibility binary="compatible" source="compatible" deprecation="no" deletion="no" addition="yes"/>
118
        <description>
119
            <p>
120
                Added SPI interface <code>@NavigatorPanelWithToolbar</code>. Clients will implement this interface when they need a toolbar for their Navigator view/panel.
121
            </p>
122
        </description>
123
        <class package="org.netbeans.spi.navigator" name="NavigatorPanelWithToolbar"/>
124
        <issue number="217091"/>
125
    </change>
111
    <change id="NavigatorPanel.Registration">
126
    <change id="NavigatorPanel.Registration">
112
        <api name="navigator_api"/>
127
        <api name="navigator_api"/>
113
        <summary>Added <code>@NavigatorPanel.Registration</code></summary>
128
        <summary>Added <code>@NavigatorPanel.Registration</code></summary>
(-)spi.navigator/manifest.mf (-1 / +1 lines)
Lines 2-5 Link Here
2
OpenIDE-Module: org.netbeans.spi.navigator/1
2
OpenIDE-Module: org.netbeans.spi.navigator/1
3
OpenIDE-Module-Layer: org/netbeans/modules/navigator/resources/layer.xml
3
OpenIDE-Module-Layer: org/netbeans/modules/navigator/resources/layer.xml
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/navigator/resources/Bundle.properties
4
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/navigator/resources/Bundle.properties
5
OpenIDE-Module-Specification-Version: 1.24
5
OpenIDE-Module-Specification-Version: 1.25
(-)spi.navigator/src/org/netbeans/modules/navigator/LazyPanel.java (-1 / +7 lines)
Lines 45-50 Link Here
45
import java.util.Map;
45
import java.util.Map;
46
import javax.swing.JComponent;
46
import javax.swing.JComponent;
47
import org.netbeans.spi.navigator.NavigatorPanel;
47
import org.netbeans.spi.navigator.NavigatorPanel;
48
import org.netbeans.spi.navigator.NavigatorPanelWithToolbar;
48
import org.netbeans.spi.navigator.NavigatorPanelWithUndo;
49
import org.netbeans.spi.navigator.NavigatorPanelWithUndo;
49
import org.openide.awt.UndoRedo;
50
import org.openide.awt.UndoRedo;
50
import org.openide.util.Lookup;
51
import org.openide.util.Lookup;
Lines 52-58 Link Here
52
/**
53
/**
53
 * Delegating panel for use from {@link NavigatorPanel.Registration}.
54
 * Delegating panel for use from {@link NavigatorPanel.Registration}.
54
 */
55
 */
55
public class LazyPanel implements NavigatorPanelWithUndo {
56
public class LazyPanel implements NavigatorPanelWithToolbar {
56
57
57
    /**
58
    /**
58
     * Referenced from generated layer.
59
     * Referenced from generated layer.
Lines 112-115 Link Here
112
        return p instanceof NavigatorPanelWithUndo ? ((NavigatorPanelWithUndo) p).getUndoRedo() : UndoRedo.NONE;
113
        return p instanceof NavigatorPanelWithUndo ? ((NavigatorPanelWithUndo) p).getUndoRedo() : UndoRedo.NONE;
113
    }
114
    }
114
115
116
    @Override
117
    public JComponent getToolbarComponent() {
118
        NavigatorPanel p = initialize();
119
        return p instanceof NavigatorPanelWithToolbar ? ((NavigatorPanelWithToolbar) p).getToolbarComponent() : null;
120
    }
115
}
121
}
(-)spi.navigator/src/org/netbeans/modules/navigator/NavigatorTC.form (-3 / +21 lines)
Lines 7-12 Link Here
7
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
7
    <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
8
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
8
    <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
9
    <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
10
    <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
10
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
11
    <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
11
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
12
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
13
    <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
Lines 22-36 Link Here
22
        </Constraint>
23
        </Constraint>
23
      </Constraints>
24
      </Constraints>
24
25
25
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
26
      <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
26
      <SubComponents>
27
      <SubComponents>
27
        <Component class="javax.swing.JComboBox" name="panelSelector">
28
        <Component class="javax.swing.JComboBox" name="panelSelector">
29
          <Properties>
30
            <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
31
              <Dimension value="[100, 20]"/>
32
            </Property>
33
          </Properties>
28
          <Constraints>
34
          <Constraints>
29
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
35
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
30
              <BorderConstraints direction="Center"/>
36
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="-1" gridHeight="0" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="1.0" weightY="0.0"/>
31
            </Constraint>
37
            </Constraint>
32
          </Constraints>
38
          </Constraints>
33
        </Component>
39
        </Component>
40
        <Container class="javax.swing.JPanel" name="pnlToolbar">
41
          <Properties>
42
            <Property name="opaque" type="boolean" value="false"/>
43
          </Properties>
44
          <Constraints>
45
            <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
46
              <GridBagConstraints gridX="-1" gridY="-1" gridWidth="-1" gridHeight="0" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="3" insetsBottom="0" insetsRight="0" anchor="13" weightX="1.5" weightY="0.0"/>
47
            </Constraint>
48
          </Constraints>
49
50
          <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
51
        </Container>
34
      </SubComponents>
52
      </SubComponents>
35
    </Container>
53
    </Container>
36
    <Container class="javax.swing.JPanel" name="contentArea">
54
    <Container class="javax.swing.JPanel" name="contentArea">
(-)spi.navigator/src/org/netbeans/modules/navigator/NavigatorTC.java (-2 / +39 lines)
Lines 46-51 Link Here
46
46
47
import java.awt.BorderLayout;
47
import java.awt.BorderLayout;
48
import java.awt.Color;
48
import java.awt.Color;
49
import java.awt.GridBagConstraints;
49
import java.awt.event.ActionEvent;
50
import java.awt.event.ActionEvent;
50
import java.awt.event.ActionListener;
51
import java.awt.event.ActionListener;
51
import java.util.List;
52
import java.util.List;
Lines 59-64 Link Here
59
import javax.swing.UIManager;
60
import javax.swing.UIManager;
60
import org.netbeans.spi.navigator.NavigatorDisplayer;
61
import org.netbeans.spi.navigator.NavigatorDisplayer;
61
import org.netbeans.spi.navigator.NavigatorPanel;
62
import org.netbeans.spi.navigator.NavigatorPanel;
63
import org.netbeans.spi.navigator.NavigatorPanelWithToolbar;
62
import org.netbeans.spi.navigator.NavigatorPanelWithUndo;
64
import org.netbeans.spi.navigator.NavigatorPanelWithUndo;
63
import org.openide.ErrorManager;
65
import org.openide.ErrorManager;
64
import org.openide.awt.UndoRedo;
66
import org.openide.awt.UndoRedo;
Lines 214-219 Link Here
214
        } else {
216
        } else {
215
            contentArea.removeAll();
217
            contentArea.removeAll();
216
            contentArea.add(panel.getComponent(), BorderLayout.CENTER);
218
            contentArea.add(panel.getComponent(), BorderLayout.CENTER);
219
220
            pnlToolbar.removeAll();
221
            if (panel instanceof NavigatorPanelWithToolbar && ((NavigatorPanelWithToolbar)panel).getToolbarComponent() != null) {
222
                JComponent toolbar = ((NavigatorPanelWithToolbar)panel).getToolbarComponent();
223
                GridBagConstraints gbc = new GridBagConstraints();
224
                gbc.anchor = GridBagConstraints.WEST;
225
                gbc.fill = GridBagConstraints.HORIZONTAL;
226
                gbc.weightx = 1.0;
227
                pnlToolbar.add(toolbar, gbc);
228
                pnlToolbar.setVisible(true);
229
            } else {
230
                pnlToolbar.setVisible(false);
231
            }
217
            revalidate();
232
            revalidate();
218
            repaint();
233
            repaint();
219
        }
234
        }
Lines 372-387 Link Here
372
     */
387
     */
373
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
388
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
374
    private void initComponents() {
389
    private void initComponents() {
390
        java.awt.GridBagConstraints gridBagConstraints;
375
391
376
        holderPanel = new javax.swing.JPanel();
392
        holderPanel = new javax.swing.JPanel();
377
        panelSelector = new javax.swing.JComboBox();
393
        panelSelector = new javax.swing.JComboBox();
394
        pnlToolbar = new javax.swing.JPanel();
378
        contentArea = new javax.swing.JPanel();
395
        contentArea = new javax.swing.JPanel();
379
396
380
        setLayout(new java.awt.BorderLayout());
397
        setLayout(new java.awt.BorderLayout());
381
398
382
        holderPanel.setLayout(new java.awt.BorderLayout());
399
        holderPanel.setLayout(new java.awt.GridBagLayout());
383
        holderPanel.add(panelSelector, java.awt.BorderLayout.CENTER);
384
400
401
        panelSelector.setMinimumSize(new java.awt.Dimension(100, 20));
402
        gridBagConstraints = new java.awt.GridBagConstraints();
403
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;
404
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
405
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
406
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
407
        gridBagConstraints.weightx = 1.0;
408
        holderPanel.add(panelSelector, gridBagConstraints);
409
410
        pnlToolbar.setOpaque(false);
411
        pnlToolbar.setLayout(new java.awt.GridBagLayout());
412
        gridBagConstraints = new java.awt.GridBagConstraints();
413
        gridBagConstraints.gridwidth = java.awt.GridBagConstraints.RELATIVE;
414
        gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;
415
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
416
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
417
        gridBagConstraints.weightx = 1.5;
418
        gridBagConstraints.insets = new java.awt.Insets(0, 3, 0, 0);
419
        holderPanel.add(pnlToolbar, gridBagConstraints);
420
385
        add(holderPanel, java.awt.BorderLayout.NORTH);
421
        add(holderPanel, java.awt.BorderLayout.NORTH);
386
422
387
        contentArea.setLayout(new java.awt.BorderLayout());
423
        contentArea.setLayout(new java.awt.BorderLayout());
Lines 393-398 Link Here
393
    private javax.swing.JPanel contentArea;
429
    private javax.swing.JPanel contentArea;
394
    private javax.swing.JPanel holderPanel;
430
    private javax.swing.JPanel holderPanel;
395
    private javax.swing.JComboBox panelSelector;
431
    private javax.swing.JComboBox panelSelector;
432
    private javax.swing.JPanel pnlToolbar;
396
    // End of variables declaration//GEN-END:variables
433
    // End of variables declaration//GEN-END:variables
397
434
398
    
435
    
(-)spi.navigator/src/org/netbeans/spi/navigator/NavigatorPanelWithToolbar.java (+67 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2012 Oracle and/or its affiliates. All rights reserved.
5
 *
6
 * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
7
 * Other names may be trademarks of their respective owners.
8
 *
9
 * The contents of this file are subject to the terms of either the GNU
10
 * General Public License Version 2 only ("GPL") or the Common
11
 * Development and Distribution License("CDDL") (collectively, the
12
 * "License"). You may not use this file except in compliance with the
13
 * License. You can obtain a copy of the License at
14
 * http://www.netbeans.org/cddl-gplv2.html
15
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
16
 * specific language governing permissions and limitations under the
17
 * License.  When distributing the software, include this License Header
18
 * Notice in each file and include the License file at
19
 * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
20
 * particular file as subject to the "Classpath" exception as provided
21
 * by Oracle in the GPL Version 2 section of the License file that
22
 * accompanied this code. If applicable, add the following below the
23
 * License Header, with the fields enclosed by brackets [] replaced by
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
27
 * If you wish your version of this file to be governed by only the CDDL
28
 * or only the GPL Version 2, indicate your decision by adding
29
 * "[Contributor] elects to include this software in this distribution
30
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
31
 * single choice of license, a recipient has the option to distribute
32
 * your version of this file under either the CDDL, the GPL Version 2 or
33
 * to extend the choice of license to its licensees as provided above.
34
 * However, if you add GPL Version 2 code and therefore, elected the GPL
35
 * Version 2 license, then the option applies only if the new code is
36
 * made subject to such option by the copyright holder.
37
 *
38
 * Contributor(s):
39
 *
40
 * Portions Copyrighted 2012 Sun Microsystems, Inc.
41
 */
42
package org.netbeans.spi.navigator;
43
44
import javax.swing.JComponent;
45
46
/** Description of navigation view with a toolbar component on top of basic
47
 * NavigatorPanel and NavigatorPanelWithUndo features.
48
 *
49
 * Clients will implement this interface when they need a toolbar for their Navigator view/panel.
50
 *
51
 * Implementors of this interface will be plugged into Navigator UI.
52
 * @see NavigatorPanel.Registration
53
 *
54
 * @since 1.25
55
 *
56
 * @author jpeska
57
 */
58
public interface NavigatorPanelWithToolbar extends NavigatorPanelWithUndo {
59
60
    /** Returns a JComponent which represents panel toolbar.
61
     *
62
     * It allows clients to display a toolbar on top of the Navigator window, next to the panel chooser (ComboBox).
63
     *
64
     * @return Instance of JComponent.
65
     */
66
    public JComponent getToolbarComponent();
67
}

Return to bug 217091