# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/dafe/Prace/Sources/main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: core.windows/nbproject/project.xml --- core.windows/nbproject/project.xml Base (BASE) +++ core.windows/nbproject/project.xml Locally Modified (Based On LOCAL) @@ -214,10 +214,9 @@ org.netbeans.core.nativeaccess org.netbeans.modules.visualweb.gravy + org.netbeans.core.windows.actions org.netbeans.core.windows.nativeaccess org.netbeans.core.windows.view.ui.tabcontrol - org.netbeans.core.windows.resources - org.netbeans.core.windows.actions Index: core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java --- core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java Locally Modified (Based On LOCAL) @@ -54,7 +54,7 @@ import javax.swing.SwingUtilities; import org.netbeans.core.windows.nativeaccess.NativeWindowSystem; import org.netbeans.core.windows.options.WinSysPrefs; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; /** * Index: core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java --- core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java Locally Modified (Based On LOCAL) @@ -59,7 +59,7 @@ import javax.swing.SwingUtilities; import javax.swing.Timer; import org.netbeans.core.windows.options.WinSysPrefs; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; /** * Index: core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java --- core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java Locally Modified (Based On LOCAL) @@ -44,6 +44,7 @@ +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import java.awt.AWTEvent; import java.awt.Color; import java.awt.Component; Index: core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java --- core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java Locally Modified (Based On LOCAL) @@ -43,6 +43,7 @@ package org.netbeans.core.windows.view.ui; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import java.lang.reflect.Field; import org.netbeans.core.windows.Constants; import org.netbeans.core.windows.ModeImpl; Index: core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java --- core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java Locally Modified (Based On LOCAL) @@ -43,6 +43,7 @@ package org.netbeans.core.windows.view.ui; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import java.text.MessageFormat; import javax.swing.plaf.basic.BasicHTML; import org.netbeans.core.windows.Constants; @@ -53,7 +54,6 @@ import org.netbeans.core.windows.view.dnd.TopComponentDroppable; import org.netbeans.core.windows.view.dnd.WindowDnDManager; import org.netbeans.core.windows.view.dnd.ZOrderManager; -import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter; import org.openide.util.NbBundle; import org.openide.windows.TopComponent; @@ -64,6 +64,9 @@ import java.util.logging.Level; import java.util.logging.Logger; import org.netbeans.core.windows.options.WinSysPrefs; +import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter; +import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory; +import org.openide.util.Lookup; import org.openide.windows.WindowManager; @@ -110,14 +113,9 @@ } protected Tabbed createTabbed() { - Tabbed tabbed; - if(getKind() == Constants.MODE_KIND_EDITOR) { - tabbed = new TabbedAdapter(Constants.MODE_KIND_EDITOR); - } else { - tabbed = new TabbedAdapter(Constants.MODE_KIND_VIEW); + return Lookup.getDefault().lookup(TabbedComponentFactory.class). + getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind())); } - return tabbed; - } protected void updateTitle (String title) { getModeUIBase().updateTitle(title); Index: core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java --- core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java Locally Modified (Based On LOCAL) @@ -43,17 +43,20 @@ package org.netbeans.core.windows.view.ui; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.netbeans.core.windows.Constants; import org.netbeans.core.windows.WindowManagerImpl; import org.netbeans.core.windows.view.ModeView; import org.netbeans.core.windows.view.ViewElement; import org.netbeans.core.windows.view.dnd.TopComponentDroppable; import org.netbeans.core.windows.view.dnd.WindowDnDManager; -import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter; import org.openide.windows.TopComponent; import javax.swing.*; import java.awt.*; +import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter; +import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory; +import org.openide.util.Lookup; /** @@ -91,14 +94,9 @@ } protected Tabbed createTabbed() { - Tabbed tabbed; - if(getKind() == Constants.MODE_KIND_EDITOR) { - tabbed = new TabbedAdapter(Constants.MODE_KIND_EDITOR); - } else { - tabbed = new TabbedAdapter(Constants.MODE_KIND_VIEW); + return Lookup.getDefault().lookup(TabbedComponentFactory.class). + getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind())); } - return tabbed; - } protected void updateTitle(String title) { // no op Index: core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java --- core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java Locally New @@ -0,0 +1,60 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +/** + * + * @author eppleton + */ + +package org.netbeans.core.windows.view.ui; + +import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer; +import org.netbeans.swing.tabcontrol.customtabs.*; +import org.netbeans.core.windows.view.ui.tabcontrol.*; +import org.openide.util.lookup.ServiceProvider; + + +@ServiceProvider(service=TabbedComponentFactory.class) +public class DefaultTabbedComponentFactory implements TabbedComponentFactory{ + + public Tabbed getTabbedComponent(int type, WinsysInfoForTabbedContainer info) { + return new TabbedAdapter(type, info); + } + +} Index: core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java --- core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java Locally Deleted @@ -1,134 +0,0 @@ -/* - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. - * - * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. - * - * The contents of this file are subject to the terms of either the GNU - * General Public License Version 2 only ("GPL") or the Common - * Development and Distribution License("CDDL") (collectively, the - * "License"). You may not use this file except in compliance with the - * License. You can obtain a copy of the License at - * http://www.netbeans.org/cddl-gplv2.html - * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the - * specific language governing permissions and limitations under the - * License. When distributing the software, include this License Header - * Notice in each file and include the License file at - * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this - * particular file as subject to the "Classpath" exception as provided - * by Sun in the GPL Version 2 section of the License file that - * accompanied this code. If applicable, add the following below the - * License Header, with the fields enclosed by brackets [] replaced by - * your own identifying information: - * "Portions Copyrighted [year] [name of copyright owner]" - * - * Contributor(s): - * - * The Original Software is NetBeans. The Initial Developer of the Original - * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * If you wish your version of this file to be governed by only the CDDL - * or only the GPL Version 2, indicate your decision by adding - * "[Contributor] elects to include this software in this distribution - * under the [CDDL or GPL Version 2] license." If you do not indicate a - * single choice of license, a recipient has the option to distribute - * your version of this file under either the CDDL, the GPL Version 2 or - * to extend the choice of license to its licensees as provided above. - * However, if you add GPL Version 2 code and therefore, elected the GPL - * Version 2 license, then the option applies only if the new code is - * made subject to such option by the copyright holder. - */ - - -package org.netbeans.core.windows.view.ui; - - -import org.openide.windows.TopComponent; - -import javax.swing.*; -import javax.swing.event.ChangeListener; -import java.awt.*; -import java.awt.event.ActionListener; - - -/** - * Interface describing component which is used inside SimpleContainer. - * There will be at two implementations one for view and second one for editor type. - * - * @author Peter Zavadsky - */ -public interface Tabbed { - - public void requestAttention(TopComponent tc); - - public void cancelRequestAttention(TopComponent tc); - - public void addTopComponent(String name, Icon icon, TopComponent tc, String toolTip); - - public void insertComponent(String name, Icon icon, Component comp, String toolTip, int position); - - public void setTopComponents(TopComponent[] tcs, TopComponent selected); - - public int getTabCount(); - - public TopComponent[] getTopComponents(); - - public TopComponent getTopComponentAt(int index); - - public int indexOf(Component tc); - - public void removeComponent(Component comp); - - public void setTitleAt(int index, String title); - - public void setIconAt(int index, Icon icon); - - public void setToolTipTextAt(int index, String toolTip); - - public void setSelectedComponent(Component comp); - - public TopComponent getSelectedTopComponent(); - - public void addChangeListener(ChangeListener listener); - - public void removeChangeListener(ChangeListener listener); - - public void addActionListener (ActionListener al); - - public void removeActionListener (ActionListener al); - - public void setActive(boolean active); - - public int tabForCoordinate(Point p); - - public Shape getIndicationForLocation(Point location, TopComponent startingTransfer, - Point startingPoint, boolean attachingPossible); - - public Object getConstraintForLocation(Point location, boolean attachingPossible); - - public Image createImageOfTab (int tabIndex); - - /** Accessor for visual component holding components */ - public Component getComponent(); - - /** Allows tabbed implementors to speficy content of popup menu on tab - * with given index. Incoming actions are default set by winsys - */ - public Action[] getPopupActions(Action[] defaultActions, int tabIndex); - - /** Returns bounds of tab with given index */ - public Rectangle getTabBounds(int tabIndex); - - public boolean isTransparent(); - - public void setTransparent( boolean transparent ); - - /** Interface for simple accessing of Tabbed instance */ - public interface Accessor { - - public Tabbed getTabbed (); - - } // end of Accessor - -} - Index: core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java --- core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java Locally Modified (Based On LOCAL) @@ -43,6 +43,7 @@ package org.netbeans.core.windows.view.ui; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.netbeans.core.windows.Constants; import org.netbeans.core.windows.actions.ActionUtils; import org.netbeans.core.windows.actions.MaximizeWindowAction; Index: core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java --- core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java Locally Modified (Based On LOCAL) @@ -72,7 +72,7 @@ import org.netbeans.core.windows.Constants; import org.netbeans.core.windows.Switches; import org.netbeans.core.windows.WindowManagerImpl; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.netbeans.core.windows.view.ui.tabcontrol.TabbedAdapter; import org.netbeans.swing.tabcontrol.SlideBarDataModel; import org.netbeans.swing.tabcontrol.SlidingButton; Index: core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java --- core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java Locally Modified (Based On LOCAL) @@ -65,7 +65,7 @@ import org.netbeans.core.windows.view.ui.AbstractModeContainer; import org.netbeans.core.windows.view.ui.ModeComponent; import org.netbeans.core.windows.view.dnd.TopComponentDroppable; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.openide.windows.TopComponent; Index: core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java --- core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java Locally Modified (Based On LOCAL) @@ -62,7 +62,7 @@ import org.netbeans.core.windows.Switches; import org.netbeans.core.windows.WindowManagerImpl; import org.netbeans.core.windows.actions.ActionUtils; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.netbeans.swing.tabcontrol.DefaultTabDataModel; import org.netbeans.core.windows.view.dnd.DragAndDropFeedbackVisualizer; import org.netbeans.swing.tabcontrol.SlideBarDataModel; Index: core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java --- core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java Base (BASE) +++ core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java Locally Modified (Based On LOCAL) @@ -49,7 +49,7 @@ import org.netbeans.core.windows.Constants; import org.netbeans.core.windows.Debug; import org.netbeans.core.windows.WindowManagerImpl; -import org.netbeans.core.windows.view.ui.Tabbed; +import org.netbeans.swing.tabcontrol.customtabs.Tabbed; import org.netbeans.swing.tabcontrol.ComponentConverter; import org.netbeans.swing.tabcontrol.TabData; import org.netbeans.swing.tabcontrol.TabbedContainer; @@ -89,8 +89,8 @@ private PropertyChangeListener tooltipListener, weakTooltipListener; /** Creates a new instance of TabbedAdapter */ - public TabbedAdapter (int type) { - super (null, type, new WinsysInfo(type)); + public TabbedAdapter (int type, WinsysInfoForTabbedContainer info) { + super (null, type, info); getSelectionModel().addChangeListener(new ChangeListener() { public void stateChanged (ChangeEvent ce) { int idx = getSelectionModel().getSelectedIndex(); @@ -515,7 +515,7 @@ /********* implementation of WinsysInfoForTabbed ********/ - static class WinsysInfo extends WinsysInfoForTabbedContainer { + public static class WinsysInfo extends WinsysInfoForTabbedContainer { private int containerType; public WinsysInfo( int containerType ) { this.containerType = containerType; Index: o.n.swing.tabcontrol/apichanges.xml --- o.n.swing.tabcontrol/apichanges.xml Base (BASE) +++ o.n.swing.tabcontrol/apichanges.xml Locally Modified (Based On LOCAL) @@ -104,6 +104,25 @@ + + + Added new Service Provider Interface TabbedComponentFactory to allow changing the Tabbed Implementation + + + + + +

Added new Service Provider Interface TabbedComponentFactory to make it possible to change the implementation of Tabbed +

+

Refactor moved Interface Tabbed from core.windows to make it part of + a public API. Now it can be implemented by alternative controls to the default + implementation (TabbedAdapter). +

+
+ + + +
Index: o.n.swing.tabcontrol/arch.xml --- o.n.swing.tabcontrol/arch.xml Base (BASE) +++ o.n.swing.tabcontrol/arch.xml Locally Modified (Based On LOCAL) @@ -79,6 +79,13 @@ modules dependencies. Consequently the package is not intended for external use.
For more information on SwitcherTable and SwitcherTableItem see a javadoc.
+ + API contains Interfaces that can be implemented to replace the default Tabbed Container supplied in org.netbeans.swing.tabcontol with + a custom component, e.g. an implementation based on JTabbedPane. A custom implementation of TabbedComponentFactory needs to be registered + as a Service Provider via the ServiceProvider annotation. The implementation is used by core.windows to create Tabbed Components when required.
For more + Information on TabbedComponentFactory and Tabbed see the javadoc. + +
Index: o.n.swing.tabcontrol/manifest.mf --- o.n.swing.tabcontrol/manifest.mf Base (BASE) +++ o.n.swing.tabcontrol/manifest.mf Locally Modified (Based On LOCAL) @@ -1,6 +1,6 @@ Manifest-Version: 1.0 OpenIDE-Module-Localizing-Bundle: org/netbeans/swing/tabcontrol/Bundle.properties OpenIDE-Module: org.netbeans.swing.tabcontrol -OpenIDE-Module-Specification-Version: 1.16 +OpenIDE-Module-Specification-Version: 1.17 AutoUpdate-Essential-Module: true Index: o.n.swing.tabcontrol/nbproject/project.xml --- o.n.swing.tabcontrol/nbproject/project.xml Base (BASE) +++ o.n.swing.tabcontrol/nbproject/project.xml Locally Modified (Based On LOCAL) @@ -74,6 +74,7 @@ org.netbeans.swing.popupswitcher org.netbeans.swing.tabcontrol + org.netbeans.swing.tabcontrol.customtabs org.netbeans.swing.tabcontrol.event org.netbeans.swing.tabcontrol.plaf Index: o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java --- o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java Base (BASE) +++ o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java Locally New @@ -0,0 +1,138 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * Contributor(s): maxnitribitt + * + * The Original Software is NetBeans. The Initial Developer of the Original + * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + */ + + +package org.netbeans.swing.tabcontrol.customtabs; + + +import org.openide.windows.TopComponent; + +import javax.swing.*; +import javax.swing.event.ChangeListener; +import java.awt.*; +import java.awt.event.ActionListener; + + +/** + * Interface for a pseudo JTabbedPane API for the actual tab control. + * Default implementation is based on nb specific TabbedContainer. + * + * @author Peter Zavadsky + */ +public interface Tabbed { + + /** + * Give a visual hint (e.g. blink) to draw attention to this TopComponent + * @param tc + */ + public void requestAttention(TopComponent tc); + + public void cancelRequestAttention(TopComponent tc); + + public void addTopComponent(String name, Icon icon, TopComponent tc, String toolTip); + + public void insertComponent(String name, Icon icon, Component comp, String toolTip, int position); + + public void setTopComponents(TopComponent[] tcs, TopComponent selected); + + public int getTabCount(); + + public TopComponent[] getTopComponents(); + + public TopComponent getTopComponentAt(int index); + + public int indexOf(Component tc); + + public void removeComponent(Component comp); + + public void setTitleAt(int index, String title); + + public void setIconAt(int index, Icon icon); + + public void setToolTipTextAt(int index, String toolTip); + + public void setSelectedComponent(Component comp); + + public TopComponent getSelectedTopComponent(); + + public void addChangeListener(ChangeListener listener); + + public void removeChangeListener(ChangeListener listener); + + public void addActionListener (ActionListener al); + + public void removeActionListener (ActionListener al); + + public void setActive(boolean active); + + public int tabForCoordinate(Point p); + + public Shape getIndicationForLocation(Point location, TopComponent startingTransfer, + Point startingPoint, boolean attachingPossible); + + public Object getConstraintForLocation(Point location, boolean attachingPossible); + + public Image createImageOfTab (int tabIndex); + + /** Accessor for visual component holding components */ + public Component getComponent(); + + /** Allows tabbed implementors to speficy content of popup menu on tab + * with given index. Incoming actions are default set by winsys + */ + public Action[] getPopupActions(Action[] defaultActions, int tabIndex); + + /** Returns bounds of tab with given index */ + public Rectangle getTabBounds(int tabIndex); + + public boolean isTransparent(); + + public void setTransparent( boolean transparent ); + + /** Interface for simple accessing of Tabbed instance */ + public interface Accessor { + + public Tabbed getTabbed (); + + } // end of Accessor + +} + Index: o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java --- o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java Base (BASE) +++ o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java Locally New @@ -0,0 +1,63 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * + * The contents of this file are subject to the terms of either the GNU + * General Public License Version 2 only ("GPL") or the Common + * Development and Distribution License("CDDL") (collectively, the + * "License"). You may not use this file except in compliance with the + * License. You can obtain a copy of the License at + * http://www.netbeans.org/cddl-gplv2.html + * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the + * specific language governing permissions and limitations under the + * License. When distributing the software, include this License Header + * Notice in each file and include the License file at + * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the GPL Version 2 section of the License file that + * accompanied this code. If applicable, add the following below the + * License Header, with the fields enclosed by brackets [] replaced by + * your own identifying information: + * "Portions Copyrighted [year] [name of copyright owner]" + * + * If you wish your version of this file to be governed by only the CDDL + * or only the GPL Version 2, indicate your decision by adding + * "[Contributor] elects to include this software in this distribution + * under the [CDDL or GPL Version 2] license." If you do not indicate a + * single choice of license, a recipient has the option to distribute + * your version of this file under either the CDDL, the GPL Version 2 or + * to extend the choice of license to its licensees as provided above. + * However, if you add GPL Version 2 code and therefore, elected the GPL + * Version 2 license, then the option applies only if the new code is + * made subject to such option by the copyright holder. + * + * Contributor(s): + * + * Portions Copyrighted 2009 Sun Microsystems, Inc. + */ + +package org.netbeans.swing.tabcontrol.customtabs; + +import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer; + +/** + * Service Interface used by the Window System for creating NetBeans specific + * Tabbed Containers. Use this if you want to provide an alternative implementation + * (e.g. based on JTabbedPane). + * Implement to return your own implementation of Tabbed. Make it available by + * registering as a ServiceProvider using this annotation: + * @ServiceProvider(service=TabbedComponentFactory.class,supersedes="org.netbeans.core.windows.view.ui.DefaultTabbedComponentFactory" ) + * + * @since 1.17 + * @author maxnitribitt + */ +public interface TabbedComponentFactory { +/** + * Get the Tabbed implementation for this type (Editor / View) + * @param type + * @return + */ + public Tabbed getTabbedComponent(int type, WinsysInfoForTabbedContainer info); + +}