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

(-)a/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java (-1 / +1 lines)
Lines 59-65 Link Here
59
import javax.swing.SwingUtilities;
59
import javax.swing.SwingUtilities;
60
import org.netbeans.core.windows.nativeaccess.NativeWindowSystem;
60
import org.netbeans.core.windows.nativeaccess.NativeWindowSystem;
61
import org.netbeans.core.windows.options.WinSysPrefs;
61
import org.netbeans.core.windows.options.WinSysPrefs;
62
import org.netbeans.core.windows.view.ui.Tabbed;
62
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
63
63
64
/**
64
/**
65
 *
65
 *
(-)a/core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java (-1 / +1 lines)
Lines 62-68 Link Here
62
import javax.swing.SwingUtilities;
62
import javax.swing.SwingUtilities;
63
import javax.swing.Timer;
63
import javax.swing.Timer;
64
import org.netbeans.core.windows.options.WinSysPrefs;
64
import org.netbeans.core.windows.options.WinSysPrefs;
65
import org.netbeans.core.windows.view.ui.Tabbed;
65
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
66
66
67
/**
67
/**
68
 *
68
 *
(-)a/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java (+1 lines)
Lines 47-52 Link Here
47
47
48
48
49
49
50
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
50
import java.awt.AWTEvent;
51
import java.awt.AWTEvent;
51
import java.awt.Color;
52
import java.awt.Color;
52
import java.awt.Component;
53
import java.awt.Component;
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java (+1 lines)
Lines 46-51 Link Here
46
package org.netbeans.core.windows.view.ui;
46
package org.netbeans.core.windows.view.ui;
47
47
48
48
49
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
49
import java.lang.reflect.Field;
50
import java.lang.reflect.Field;
50
import org.netbeans.core.windows.Constants;
51
import org.netbeans.core.windows.Constants;
51
import org.netbeans.core.windows.ModeImpl;
52
import org.netbeans.core.windows.ModeImpl;
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java (-8 / +6 lines)
Lines 46-51 Link Here
46
package org.netbeans.core.windows.view.ui;
46
package org.netbeans.core.windows.view.ui;
47
47
48
48
49
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
49
import java.text.MessageFormat;
50
import java.text.MessageFormat;
50
import javax.swing.plaf.basic.BasicHTML;
51
import javax.swing.plaf.basic.BasicHTML;
51
import org.netbeans.core.windows.Constants;
52
import org.netbeans.core.windows.Constants;
Lines 56-62 Link Here
56
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
57
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
57
import org.netbeans.core.windows.view.dnd.WindowDnDManager;
58
import org.netbeans.core.windows.view.dnd.WindowDnDManager;
58
import org.netbeans.core.windows.view.dnd.ZOrderManager;
59
import org.netbeans.core.windows.view.dnd.ZOrderManager;
59
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
60
import org.openide.util.NbBundle;
60
import org.openide.util.NbBundle;
61
import org.openide.windows.TopComponent;
61
import org.openide.windows.TopComponent;
62
62
Lines 67-72 Link Here
67
import java.util.logging.Level;
67
import java.util.logging.Level;
68
import java.util.logging.Logger;
68
import java.util.logging.Logger;
69
import org.netbeans.core.windows.options.WinSysPrefs;
69
import org.netbeans.core.windows.options.WinSysPrefs;
70
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
71
import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory;
72
import org.openide.util.Lookup;
70
import org.openide.windows.WindowManager;
73
import org.openide.windows.WindowManager;
71
74
72
75
Lines 113-125 Link Here
113
    }
116
    }
114
    
117
    
115
    protected Tabbed createTabbed() {
118
    protected Tabbed createTabbed() {
116
        Tabbed tabbed;
119
        return Lookup.getDefault().lookup(TabbedComponentFactory.class).
117
        if(getKind() == Constants.MODE_KIND_EDITOR) {
120
                getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind()));
118
            tabbed = new TabbedAdapter(Constants.MODE_KIND_EDITOR);
119
        } else {
120
            tabbed = new TabbedAdapter(Constants.MODE_KIND_VIEW);
121
        }
122
        return tabbed;    
123
    }    
121
    }    
124
    
122
    
125
    protected void updateTitle (String title) {
123
    protected void updateTitle (String title) {
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java (-8 / +6 lines)
Lines 46-62 Link Here
46
package org.netbeans.core.windows.view.ui;
46
package org.netbeans.core.windows.view.ui;
47
47
48
48
49
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
49
import org.netbeans.core.windows.Constants;
50
import org.netbeans.core.windows.Constants;
50
import org.netbeans.core.windows.WindowManagerImpl;
51
import org.netbeans.core.windows.WindowManagerImpl;
51
import org.netbeans.core.windows.view.ModeView;
52
import org.netbeans.core.windows.view.ModeView;
52
import org.netbeans.core.windows.view.ViewElement;
53
import org.netbeans.core.windows.view.ViewElement;
53
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
54
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
54
import org.netbeans.core.windows.view.dnd.WindowDnDManager;
55
import org.netbeans.core.windows.view.dnd.WindowDnDManager;
55
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
56
import org.openide.windows.TopComponent;
56
import org.openide.windows.TopComponent;
57
57
58
import javax.swing.*;
58
import javax.swing.*;
59
import java.awt.*;
59
import java.awt.*;
60
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
61
import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory;
62
import org.openide.util.Lookup;
60
63
61
64
62
/**
65
/**
Lines 94-106 Link Here
94
    }
97
    }
95
    
98
    
96
    protected Tabbed createTabbed() {
99
    protected Tabbed createTabbed() {
97
        Tabbed tabbed;
100
        return Lookup.getDefault().lookup(TabbedComponentFactory.class).
98
        if(getKind() == Constants.MODE_KIND_EDITOR) {
101
                getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind()));
99
            tabbed = new TabbedAdapter(Constants.MODE_KIND_EDITOR);
100
        } else {
101
            tabbed = new TabbedAdapter(Constants.MODE_KIND_VIEW);
102
        }
103
        return tabbed;    
104
    }    
102
    }    
105
    
103
    
106
    protected void updateTitle(String title) {
104
    protected void updateTitle(String title) {
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java (+61 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
/**
41
 *
42
 * @author eppleton
43
 */
44
45
package org.netbeans.core.windows.view.ui;
46
47
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
48
import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer;
49
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
50
import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory;
51
import org.openide.util.lookup.ServiceProvider;
52
53
54
@ServiceProvider(service=TabbedComponentFactory.class)
55
public class DefaultTabbedComponentFactory implements TabbedComponentFactory{
56
57
    public Tabbed getTabbedComponent(int type, WinsysInfoForTabbedContainer info) {
58
        return new TabbedAdapter(type, info);
59
    }
60
61
}
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java (+1 lines)
Lines 46-51 Link Here
46
package org.netbeans.core.windows.view.ui;
46
package org.netbeans.core.windows.view.ui;
47
47
48
48
49
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
49
import org.netbeans.core.windows.Constants;
50
import org.netbeans.core.windows.Constants;
50
import org.netbeans.core.windows.actions.ActionUtils;
51
import org.netbeans.core.windows.actions.ActionUtils;
51
import org.netbeans.core.windows.actions.MaximizeWindowAction;
52
import org.netbeans.core.windows.actions.MaximizeWindowAction;
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java (-1 / +1 lines)
Lines 75-81 Link Here
75
import org.netbeans.core.windows.Constants;
75
import org.netbeans.core.windows.Constants;
76
import org.netbeans.core.windows.Switches;
76
import org.netbeans.core.windows.Switches;
77
import org.netbeans.core.windows.WindowManagerImpl;
77
import org.netbeans.core.windows.WindowManagerImpl;
78
import org.netbeans.core.windows.view.ui.Tabbed;
78
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
79
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
79
import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter;
80
import org.netbeans.swing.tabcontrol.SlideBarDataModel;
80
import org.netbeans.swing.tabcontrol.SlideBarDataModel;
81
import org.netbeans.swing.tabcontrol.SlidingButton;
81
import org.netbeans.swing.tabcontrol.SlidingButton;
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java (-1 / +1 lines)
Lines 68-74 Link Here
68
import org.netbeans.core.windows.view.ui.AbstractModeContainer;
68
import org.netbeans.core.windows.view.ui.AbstractModeContainer;
69
import org.netbeans.core.windows.view.ui.ModeComponent;
69
import org.netbeans.core.windows.view.ui.ModeComponent;
70
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
70
import org.netbeans.core.windows.view.dnd.TopComponentDroppable;
71
import org.netbeans.core.windows.view.ui.Tabbed;
71
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
72
import org.openide.windows.TopComponent;
72
import org.openide.windows.TopComponent;
73
73
74
74
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java (-1 / +1 lines)
Lines 65-71 Link Here
65
import org.netbeans.core.windows.Switches;
65
import org.netbeans.core.windows.Switches;
66
import org.netbeans.core.windows.WindowManagerImpl;
66
import org.netbeans.core.windows.WindowManagerImpl;
67
import org.netbeans.core.windows.actions.ActionUtils;
67
import org.netbeans.core.windows.actions.ActionUtils;
68
import org.netbeans.core.windows.view.ui.Tabbed;
68
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
69
import org.netbeans.swing.tabcontrol.DefaultTabDataModel;
69
import org.netbeans.swing.tabcontrol.DefaultTabDataModel;
70
import org.netbeans.core.windows.view.dnd.DragAndDropFeedbackVisualizer;
70
import org.netbeans.core.windows.view.dnd.DragAndDropFeedbackVisualizer;
71
import org.netbeans.swing.tabcontrol.SlideBarDataModel;
71
import org.netbeans.swing.tabcontrol.SlideBarDataModel;
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java (-4 / +4 lines)
Lines 52-58 Link Here
52
import org.netbeans.core.windows.Constants;
52
import org.netbeans.core.windows.Constants;
53
import org.netbeans.core.windows.Debug;
53
import org.netbeans.core.windows.Debug;
54
import org.netbeans.core.windows.WindowManagerImpl;
54
import org.netbeans.core.windows.WindowManagerImpl;
55
import org.netbeans.core.windows.view.ui.Tabbed;
55
import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
56
import org.netbeans.swing.tabcontrol.ComponentConverter;
56
import org.netbeans.swing.tabcontrol.ComponentConverter;
57
import org.netbeans.swing.tabcontrol.TabData;
57
import org.netbeans.swing.tabcontrol.TabData;
58
import org.netbeans.swing.tabcontrol.TabbedContainer;
58
import org.netbeans.swing.tabcontrol.TabbedContainer;
Lines 92-99 Link Here
92
    private PropertyChangeListener tooltipListener, weakTooltipListener;
92
    private PropertyChangeListener tooltipListener, weakTooltipListener;
93
93
94
    /** Creates a new instance of TabbedAdapter */
94
    /** Creates a new instance of TabbedAdapter */
95
    public TabbedAdapter (int type) {
95
    public TabbedAdapter (int type, WinsysInfoForTabbedContainer info) {
96
        super (null, type, new WinsysInfo(type));
96
        super (null, type, info);
97
        getSelectionModel().addChangeListener(new ChangeListener() {
97
        getSelectionModel().addChangeListener(new ChangeListener() {
98
            public void stateChanged (ChangeEvent ce) {
98
            public void stateChanged (ChangeEvent ce) {
99
                int idx = getSelectionModel().getSelectedIndex();
99
                int idx = getSelectionModel().getSelectedIndex();
Lines 518-524 Link Here
518
518
519
    /********* implementation of WinsysInfoForTabbed ********/
519
    /********* implementation of WinsysInfoForTabbed ********/
520
    
520
    
521
    static class WinsysInfo extends WinsysInfoForTabbedContainer {
521
    public static class WinsysInfo extends WinsysInfoForTabbedContainer {
522
        private int containerType;
522
        private int containerType;
523
        public WinsysInfo( int containerType ) {
523
        public WinsysInfo( int containerType ) {
524
            this.containerType = containerType;
524
            this.containerType = containerType;
(-)a/o.n.swing.tabcontrol/nbproject/project.xml (+1 lines)
Lines 99-104 Link Here
99
            <public-packages>
99
            <public-packages>
100
                <package>org.netbeans.swing.popupswitcher</package>
100
                <package>org.netbeans.swing.popupswitcher</package>
101
                <package>org.netbeans.swing.tabcontrol</package>
101
                <package>org.netbeans.swing.tabcontrol</package>
102
                <package>org.netbeans.swing.tabcontrol.customtabs</package>
102
                <package>org.netbeans.swing.tabcontrol.event</package>
103
                <package>org.netbeans.swing.tabcontrol.event</package>
103
                <package>org.netbeans.swing.tabcontrol.plaf</package>
104
                <package>org.netbeans.swing.tabcontrol.plaf</package>
104
            </public-packages>
105
            </public-packages>
(-)a/core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java (-4 / +8 lines)
Lines 24-30 Link Here
24
 * your own identifying information:
24
 * your own identifying information:
25
 * "Portions Copyrighted [year] [name of copyright owner]"
25
 * "Portions Copyrighted [year] [name of copyright owner]"
26
 *
26
 *
27
 * Contributor(s):
27
 * Contributor(s): maxnitribitt
28
 *
28
 *
29
 * The Original Software is NetBeans. The Initial Developer of the Original
29
 * The Original Software is NetBeans. The Initial Developer of the Original
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
30
 * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
Lines 43-49 Link Here
43
 */
43
 */
44
44
45
45
46
package org.netbeans.core.windows.view.ui;
46
package org.netbeans.swing.tabcontrol.customtabs;
47
47
48
48
49
import org.openide.windows.TopComponent;
49
import org.openide.windows.TopComponent;
Lines 55-67 Link Here
55
55
56
56
57
/**
57
/**
58
 * Interface describing component which is used inside <code>SimpleContainer</code>.
58
 * Interface for a pseudo JTabbedPane API for the actual tab control.
59
 * There will be at two implementations one for view and second one for editor type.
59
 * Default implementation is based on nb specific <code>TabbedContainer</code>.
60
 *
60
 *
61
 * @author  Peter Zavadsky
61
 * @author  Peter Zavadsky
62
 */
62
 */
63
public interface Tabbed {
63
public interface Tabbed {
64
64
65
    /**
66
     * Give a visual hint (e.g. blink) to draw attention to this TopComponent
67
     * @param tc
68
     */
65
    public void requestAttention(TopComponent tc);
69
    public void requestAttention(TopComponent tc);
66
70
67
    public void cancelRequestAttention(TopComponent tc);
71
    public void cancelRequestAttention(TopComponent tc);
(-)a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java (+63 lines)
Line 0 Link Here
1
/*
2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
3
 *
4
 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
5
 *
6
 * The contents of this file are subject to the terms of either the GNU
7
 * General Public License Version 2 only ("GPL") or the Common
8
 * Development and Distribution License("CDDL") (collectively, the
9
 * "License"). You may not use this file except in compliance with the
10
 * License. You can obtain a copy of the License at
11
 * http://www.netbeans.org/cddl-gplv2.html
12
 * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
13
 * specific language governing permissions and limitations under the
14
 * License.  When distributing the software, include this License Header
15
 * Notice in each file and include the License file at
16
 * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
17
 * particular file as subject to the "Classpath" exception as provided
18
 * by Sun in the GPL Version 2 section of the License file that
19
 * accompanied this code. If applicable, add the following below the
20
 * License Header, with the fields enclosed by brackets [] replaced by
21
 * your own identifying information:
22
 * "Portions Copyrighted [year] [name of copyright owner]"
23
 *
24
 * If you wish your version of this file to be governed by only the CDDL
25
 * or only the GPL Version 2, indicate your decision by adding
26
 * "[Contributor] elects to include this software in this distribution
27
 * under the [CDDL or GPL Version 2] license." If you do not indicate a
28
 * single choice of license, a recipient has the option to distribute
29
 * your version of this file under either the CDDL, the GPL Version 2 or
30
 * to extend the choice of license to its licensees as provided above.
31
 * However, if you add GPL Version 2 code and therefore, elected the GPL
32
 * Version 2 license, then the option applies only if the new code is
33
 * made subject to such option by the copyright holder.
34
 *
35
 * Contributor(s):
36
 *
37
 * Portions Copyrighted 2009 Sun Microsystems, Inc.
38
 */
39
40
package org.netbeans.swing.tabcontrol.customtabs;
41
42
import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer;
43
44
/**
45
 * Service Interface used by the Window System for creating NetBeans specific
46
 * Tabbed Containers. Use this if you want to provide an alternative implementation
47
 * (e.g. based on JTabbedPane).
48
 * Implement to return your own implementation of Tabbed. Make it available by
49
 * registering as a ServiceProvider using this annotation:
50
 * <code>@ServiceProvider(service=TabbedComponentFactory.class,supersedes="org.netbeans.core.windows.view.ui.DefaultTabbedComponentFactory" )</code>
51
 *
52
 * @since XXX need API changes here!
53
 * @author maxnitribitt
54
 */
55
public interface TabbedComponentFactory {
56
/**
57
 * Get the Tabbed implementation for this type (Editor / View)
58
 * @param type
59
 * @return
60
 */
61
    public Tabbed getTabbedComponent(int type, WinsysInfoForTabbedContainer info);
62
63
}

Return to bug 169099