diff --git a/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java b/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
--- a/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
+++ b/core.windows/src/org/netbeans/core/windows/view/dnd/DragAndDropFeedbackVisualizer.java
@@ -59,7 +59,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;
/**
*
diff --git a/core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java b/core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java
--- a/core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java
+++ b/core.windows/src/org/netbeans/core/windows/view/dnd/DragWindow.java
@@ -62,7 +62,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;
/**
*
diff --git a/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java b/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
--- a/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
+++ b/core.windows/src/org/netbeans/core/windows/view/dnd/TopComponentDragSupport.java
@@ -47,6 +47,7 @@
+import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
import java.awt.AWTEvent;
import java.awt.Color;
import java.awt.Component;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java b/core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/AbstractModeContainer.java
@@ -46,6 +46,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;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSeparateContainer.java
@@ -46,6 +46,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;
@@ -56,7 +57,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;
@@ -67,6 +67,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;
@@ -113,13 +116,8 @@
}
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 tabbed;
+ return Lookup.getDefault().lookup(TabbedComponentFactory.class).
+ getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind()));
}
protected void updateTitle (String title) {
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultSplitContainer.java
@@ -46,17 +46,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;
/**
@@ -94,13 +97,8 @@
}
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 tabbed;
+ return Lookup.getDefault().lookup(TabbedComponentFactory.class).
+ getTabbedComponent(getKind(), new TabbedAdapter.WinsysInfo(getKind()));
}
protected void updateTitle(String title) {
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java
new file mode 100644
--- /dev/null
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/DefaultTabbedComponentFactory.java
@@ -0,0 +1,61 @@
+/*
+ * 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.core.windows.view.ui.tabcontrol.TabbedAdapter;
+import org.netbeans.swing.tabcontrol.WinsysInfoForTabbedContainer;
+import org.netbeans.swing.tabcontrol.customtabs.Tabbed;
+import org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory;
+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);
+ }
+
+}
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java b/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/TabbedHandler.java
@@ -46,6 +46,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;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java b/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBar.java
@@ -75,7 +75,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;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java b/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/slides/SlideBarContainer.java
@@ -68,7 +68,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;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java b/core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/slides/TabbedSlideAdapter.java
@@ -65,7 +65,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;
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java b/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java
+++ b/core.windows/src/org/netbeans/core/windows/view/ui/tabcontrol/TabbedAdapter.java
@@ -52,7 +52,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;
@@ -92,8 +92,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();
@@ -518,7 +518,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;
diff --git a/o.n.swing.tabcontrol/nbproject/project.xml b/o.n.swing.tabcontrol/nbproject/project.xml
--- a/o.n.swing.tabcontrol/nbproject/project.xml
+++ b/o.n.swing.tabcontrol/nbproject/project.xml
@@ -99,6 +99,7 @@
org.netbeans.swing.popupswitcher
org.netbeans.swing.tabcontrol
+ org.netbeans.swing.tabcontrol.customtabs
org.netbeans.swing.tabcontrol.event
org.netbeans.swing.tabcontrol.plaf
diff --git a/core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java b/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java
rename from core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java
rename to o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java
--- a/core.windows/src/org/netbeans/core/windows/view/ui/Tabbed.java
+++ b/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/Tabbed.java
@@ -24,7 +24,7 @@
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
- * Contributor(s):
+ * Contributor(s): maxnitribitt
*
* The Original Software is NetBeans. The Initial Developer of the Original
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
@@ -43,7 +43,7 @@
*/
-package org.netbeans.core.windows.view.ui;
+package org.netbeans.swing.tabcontrol.customtabs;
import org.openide.windows.TopComponent;
@@ -55,13 +55,17 @@
/**
- * Interface describing component which is used inside SimpleContainer
.
- * There will be at two implementations one for view and second one for editor type.
+ * 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);
diff --git a/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java b/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java
new file mode 100644
--- /dev/null
+++ b/o.n.swing.tabcontrol/src/org/netbeans/swing/tabcontrol/customtabs/TabbedComponentFactory.java
@@ -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 XXX need API changes here!
+ * @author maxnitribitt
+ */
+public interface TabbedComponentFactory {
+/**
+ * Get the Tabbed implementation for this type (Editor / View)
+ * @param type
+ * @return
+ */
+ public Tabbed getTabbedComponent(int type, WinsysInfoForTabbedContainer info);
+
+}