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 199677
Collapse All | Expand All

(-)a/o.n.swing.tabcontrol/apichanges.xml (+26 lines)
Lines 108-113 Link Here
108
108
109
<changes>
109
<changes>
110
110
111
    <change id="new_window_group_operations">
112
      <api name="tabcontrol"/>
113
      <summary>New methods to support operations with window groups.</summary>
114
      <version major="1" minor="27"/>
115
      <date day="24" month="6" year="2011"/>
116
      <author login="saubrecht"/>
117
      <compatibility addition="yes" binary="compatible" deprecation="no"/>
118
      <description>
119
        <p>Added new methods to support operations with window groups, e.g. close
120
        window group or minimize window group.
121
        </p>
122
        <p>Also the implementation of look and feels for all supported
123
        platform switches to non-stretching tab layout.</p>
124
      </description>
125
      <class package="org.netbeans.swing.tabcontrol" name="WinsysInfoForTabbedContainer"/>
126
      <class package="org.netbeans.swing.tabcontrol" name="SlideBarDataModel"/>
127
      <class package="org.netbeans.swing.tabcontrol" name="TabbedContainer"/>
128
      <class package="org.netbeans.swing.tabcontrol" name="TabbedDisplayer"/>
129
      <class package="org.netbeans.swing.tabcontrol" name="TabbedDisplayerUI"/>
130
      <class package="org.netbeans.swing.tabcontrol.event" name="TabActionEvent"/>
131
      <class package="org.netbeans.swing.tabcontrol.plaf" name="AbstractViewTabDisplayerUI"/>
132
      <class package="org.netbeans.swing.tabcontrol.plaf" name="TabControlButton"/>
133
      <class package="org.netbeans.swing.tabcontrol.plaf" name="TabControlButtonFactory"/>
134
      <issue number="199677"/>
135
    </change>
136
111
    <change id="topcomponent_level_winsys_customizations">
137
    <change id="topcomponent_level_winsys_customizations">
112
      <api name="tabcontrol"/>
138
      <api name="tabcontrol"/>
113
      <summary>Added new methods to WinsysInfoForTabbedContainer class which can
139
      <summary>Added new methods to WinsysInfoForTabbedContainer class which can
(-)a/o.n.swing.tabcontrol/arch.xml (+7 lines)
Lines 364-369 Link Here
364
                can be used to hide close buttons by default.
364
                can be used to hide close buttons by default.
365
            </p>
365
            </p>
366
        </api>
366
        </api>
367
        <api category="devel" group="systemproperty" name="winsys.stretching_view_tabs" type="export">
368
            <p>
369
                The system property <code>winsys.stretching_view_tabs</code>
370
                can be used to switch to stretching tab layout as implemented 
371
                in NetBeans version 7.0 and older.
372
            </p>
373
        </api>
367
    </answer>
374
    </answer>
368
375
369
376
(-)a/o.n.swing.tabcontrol/manifest.mf (-1 / +1 lines)
Lines 1-6 Link Here
1
Manifest-Version: 1.0
1
Manifest-Version: 1.0
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/tabcontrol/Bundle.properties
2
OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/tabcontrol/Bundle.properties
3
OpenIDE-Module: org.netbeans.swing.tabcontrol
3
OpenIDE-Module: org.netbeans.swing.tabcontrol
4
OpenIDE-Module-Specification-Version: 1.26
4
OpenIDE-Module-Specification-Version: 1.27
5
AutoUpdate-Essential-Module: true
5
AutoUpdate-Essential-Module: true
6
6
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/SlideBarDataModel.java (+4 lines)
Lines 56-61 Link Here
56
    public static final int EAST = 1;
56
    public static final int EAST = 1;
57
    public static final int WEST = 2;
57
    public static final int WEST = 2;
58
    public static final int SOUTH = 3;
58
    public static final int SOUTH = 3;
59
    /**
60
     * @since 1.27
61
     */
62
    public static final int NORTH = 4;
59
63
60
    /** Orientation of slide bar
64
    /** Orientation of slide bar
61
     */
65
     */
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/TabDisplayer.java (+18 lines)
Lines 169-174 Link Here
169
     * clicking the Pin button on a tab.
169
     * clicking the Pin button on a tab.
170
     */
170
     */
171
    public static final String COMMAND_ENABLE_AUTO_HIDE = TabbedContainer.COMMAND_ENABLE_AUTO_HIDE; //NOI18N
171
    public static final String COMMAND_ENABLE_AUTO_HIDE = TabbedContainer.COMMAND_ENABLE_AUTO_HIDE; //NOI18N
172
    
173
    /**
174
     * Action command to slide out the whole window group.
175
     * @since 1.27
176
     */
177
    public static final String COMMAND_MINIMIZE_GROUP = TabbedContainer.COMMAND_MINIMIZE_GROUP;
178
    
179
    /**
180
     * Action command to restore the whole slided-out window group.
181
     * @since 1.27
182
     */
183
    public static final String COMMAND_RESTORE_GROUP = TabbedContainer.COMMAND_RESTORE_GROUP;
184
    
185
    /**
186
     * Action command to close the whole window group.
187
     * @since 1.27
188
     */
189
    public static final String COMMAND_CLOSE_GROUP = TabbedContainer.COMMAND_CLOSE_GROUP;
172
190
173
    /**
191
    /**
174
     * Action command indicating that the action event signifies the user
192
     * Action command indicating that the action event signifies the user
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/TabDisplayerUI.java (+20 lines)
Lines 190-195 Link Here
190
        displayer.postActionEvent(evt);
190
        displayer.postActionEvent(evt);
191
        return !evt.isConsumed();
191
        return !evt.isConsumed();
192
    }
192
    }
193
    
194
    /**
195
     * Allows ActionListeners attached to the container to determine if the
196
     * event should be acted on. Delegates to <code>displayer.postActionEvent()</code>.
197
     * This method will create a TabActionEvent with the passed string as an 
198
     * action command, and cause the displayer to fire this event.  It will
199
     * return true if no listener on the displayer consumed the TabActionEvent;
200
     * consuming the event is the way a listener can veto a change, or provide
201
     * special handling for it.
202
     *
203
     * @param e The original tab action event.
204
     * @return true if the event posted was not consumed by any listener
205
     * @since 1.27
206
     */
207
    protected final boolean shouldPerformAction(TabActionEvent e) {
208
        TabActionEvent evt = new TabActionEvent(displayer, e.getActionCommand(), e.getTabIndex(), e.getMouseEvent());
209
        evt.setGroupName( e.getGroupName() );
210
        displayer.postActionEvent(evt);
211
        return !evt.isConsumed();
212
    }
193
213
194
    /**
214
    /**
195
     * Instruct the UI to ensure that the tab at the given index is visible.
215
     * Instruct the UI to ensure that the tab at the given index is visible.
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/TabbedContainer.java (+14 lines)
Lines 218-223 Link Here
218
    public static final String COMMAND_DISABLE_AUTO_HIDE = "disableAutoHide"; //NOI18N
218
    public static final String COMMAND_DISABLE_AUTO_HIDE = "disableAutoHide"; //NOI18N
219
    
219
    
220
    public static final String COMMAND_TOGGLE_TRANSPARENCY = "toggleTransparency"; //NOI18N
220
    public static final String COMMAND_TOGGLE_TRANSPARENCY = "toggleTransparency"; //NOI18N
221
    /**
222
     * @since 1.27
223
     */
224
    public static final String COMMAND_MINIMIZE_GROUP = "minimizeGroup"; //NOI18N
225
    
226
    /**
227
     * @since 1.27
228
     */
229
    public static final String COMMAND_RESTORE_GROUP = "restoreGroup"; //NOI18N
230
    
231
    /**
232
     * @since 1.27
233
     */
234
    public static final String COMMAND_CLOSE_GROUP = "closeGroup"; //NOI18N
221
    
235
    
222
    //XXX support supressing close buttons
236
    //XXX support supressing close buttons
223
    
237
    
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/WinsysInfoForTabbedContainer.java (+16 lines)
Lines 114-119 Link Here
114
        return true;
114
        return true;
115
    }
115
    }
116
116
117
    /**
118
     * @return True if it is possible to minimize the whole group of TopCOmponents.
119
     * @since 1.27
120
     */
121
    public boolean isModeSlidingEnabled() {
122
        return true;
123
    }
124
    
125
    /**
126
     * @return True if this container is currently slided out (and contains a single window)
127
     * @since 1.27
128
     */
129
    public boolean isSlidedOutContainer() {
130
        return false;
131
    }
132
117
    public static WinsysInfoForTabbedContainer getDefault( WinsysInfoForTabbed winsysInfo ) {
133
    public static WinsysInfoForTabbedContainer getDefault( WinsysInfoForTabbed winsysInfo ) {
118
        return new DefaultWinsysInfoForTabbedContainer( winsysInfo );
134
        return new DefaultWinsysInfoForTabbedContainer( winsysInfo );
119
    }
135
    }
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/event/TabActionEvent.java (+17 lines)
Lines 108-119 Link Here
108
    public int getTabIndex() {
111
    public int getTabIndex() {
109
        return tabIndex;
112
        return tabIndex;
110
    }
113
    }
114
    
115
    /**
116
     * @return Name of window group this command applies to or null.
117
     * @since 1.27
118
     */
119
    public String getGroupName() {
120
        return groupName;
121
    }
122
    
123
    /**
124
     * Set the name of window group this command applies to.
125
     * @param groupName 
126
     * @since 1.27
127
     */
128
    public void setGroupName( String groupName ) {
129
        this.groupName = groupName;
130
    }
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/AbstractViewTabDisplayerUI.java (+22 lines)
Lines 394-399 Link Here
394
410
395
    protected abstract void paintTabBackground(Graphics g, int index, int x,
411
    protected abstract void paintTabBackground(Graphics g, int index, int x,
396
                                               int y, int width, int height);
412
                                               int y, int width, int height);
413
    
414
    /**
415
     * Paint the background when using non-stretching tabs.
416
     * @param g
417
     * @param c 
418
     * @since 1.27
419
     */
420
    protected void paintDisplayerBackground( Graphics g, JComponent c ) {
421
        int x;
422
        int width;
423
        if( !isUseStretchingTabs() ) {
424
            x = 0;
425
            width = c.getWidth();
426
            if( dataModel.size() > 0 ) {
427
                x += layoutModel.getX( dataModel.size()-1 );
428
                x += layoutModel.getW( dataModel.size()-1 )-1;
429
                width -= x;
430
            }
431
            paintTabBackground( g, -1, x, 0, width, c.getHeight());
432
            paintTabBorder( g, -1, x, 0, width, c.getHeight());
433
        }
434
    }
397
435
398
436
399
437
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButton.java (+8 lines)
Lines 73-78 Link Here
73
    public static final int ID_DROP_DOWN_BUTTON = 8;
73
    public static final int ID_DROP_DOWN_BUTTON = 8;
74
    public static final int ID_SCROLL_LEFT_BUTTON = 9;
74
    public static final int ID_SCROLL_LEFT_BUTTON = 9;
75
    public static final int ID_SCROLL_RIGHT_BUTTON = 10;
75
    public static final int ID_SCROLL_RIGHT_BUTTON = 10;
76
    /**
77
     * @since 1.27
78
     */
79
    public static final int ID_RESTORE_GROUP_BUTTON = 11;
80
    /**
81
     * @since 1.27
82
     */
83
    public static final int ID_SLIDE_GROUP_BUTTON = 12;
76
    
84
    
77
    public static final int STATE_DEFAULT = 0;
85
    public static final int STATE_DEFAULT = 0;
78
    public static final int STATE_PRESSED = 1;
86
    public static final int STATE_PRESSED = 1;
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/plaf/TabControlButtonFactory.java (-1 / +30 lines)
Lines 64-71 Link Here
64
import org.netbeans.swing.tabcontrol.TabData;
64
import org.netbeans.swing.tabcontrol.TabData;
65
import org.netbeans.swing.tabcontrol.TabDisplayer;
65
import org.netbeans.swing.tabcontrol.TabDisplayer;
66
import org.netbeans.swing.tabcontrol.TabListPopupAction;
66
import org.netbeans.swing.tabcontrol.TabListPopupAction;
67
import org.netbeans.swing.tabcontrol.WinsysInfoForTabbed;
68
import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer;
67
import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer;
68
import org.netbeans.swing.tabcontrol.event.TabActionEvent;
69
69
70
/**
70
/**
71
 * A factory to create tab control buttons.
71
 * A factory to create tab control buttons.
Lines 94-99 Link Here
94
    }
94
    }
95
    
95
    
96
    /**
96
    /**
97
     * Create button to close the whole window group.
98
     * @since 1.27
99
     */
100
    public static TabControlButton createCloseGroupButton( TabDisplayer displayer ) {
101
        return new CloseGroupButton( displayer );
102
    }
103
    
104
    /**
97
     * Create default auto-hide/pin button. The button changes icons depending
105
     * Create default auto-hide/pin button. The button changes icons depending
98
     * on the state of tab component.
106
     * on the state of tab component.
99
     */
107
     */
Lines 102-107 Link Here
102
    }
110
    }
103
    
111
    
104
    /**
112
    /**
113
     * Create default minimize window group button.
114
     * @since 1.27
115
     */
116
    public static TabControlButton createSlideGroupButton( TabDisplayer displayer ) {
117
        return new SlideGroupButton( displayer );
118
    }
119
    
120
    /**
121
     * Create button to restore a group of windows from minimized state.
122
     * @param displayer 
123
     * @param groupName Name of the group of windows to un-minimize. When the default
124
     * window system implementation is being used then the group name is the name
125
     * of TopComponent Mode.
126
     * @see org.openide.windows.Mode#getName() 
127
     * @since 1.27
128
     */
129
    public static TabControlButton createRestoreGroupButton( TabDisplayer displayer, String groupName ) {
130
        return new RestoreGroupButton( displayer, groupName );
131
    }
132
    
133
    /**
105
     * Create default maximize/restore button. The button changes icons depending
134
     * Create default maximize/restore button. The button changes icons depending
106
     * on the state of tab component.
135
     * on the state of tab component.
107
     */
136
     */

Return to bug 199677