diff -r 255253b9cea0 openide.awt/apichanges.xml --- a/openide.awt/apichanges.xml Mon May 04 16:54:52 2009 +0200 +++ b/openide.awt/apichanges.xml Wed May 06 13:42:43 2009 +0200 @@ -47,6 +47,20 @@ AWT API + + + API to hide close button in CloseButtonTabbedPane + + + + + + Added possibility to hide close button in CloseButtonTabbedPane + through tab's client property + component.putClientProperty(TabbedPaneFactory.NO_CLOSE_BUTTON, Boolean.TRUE) + + + AlwaysEnabledAction extra properties and Action.NAME synchronization diff -r 255253b9cea0 openide.awt/nbproject/project.properties --- a/openide.awt/nbproject/project.properties Mon May 04 16:54:52 2009 +0200 +++ b/openide.awt/nbproject/project.properties Wed May 06 13:42:43 2009 +0200 @@ -44,4 +44,4 @@ javadoc.arch=${basedir}/arch.xml javadoc.apichanges=${basedir}/apichanges.xml -spec.version.base=7.7.0 +spec.version.base=7.8.0 diff -r 255253b9cea0 openide.awt/src/org/openide/awt/CloseButtonTabbedPane.java --- a/openide.awt/src/org/openide/awt/CloseButtonTabbedPane.java Mon May 04 16:54:52 2009 +0200 +++ b/openide.awt/src/org/openide/awt/CloseButtonTabbedPane.java Wed May 06 13:42:43 2009 +0200 @@ -169,6 +169,14 @@ } private Rectangle getCloseButtonBoundsAt(int i) { + Component c = findTabAt(i); + //if NO_CLOSE_BUTTON -> return null + if (c!=null && c instanceof JComponent) { + Object prop = ((JComponent) c).getClientProperty(TabbedPaneFactory.NO_CLOSE_BUTTON); + if (prop!=null && prop instanceof Boolean && (Boolean) prop) { + return null; + } + } Rectangle b = getBoundsAt(i); if (b == null) return null; diff -r 255253b9cea0 openide.awt/src/org/openide/awt/TabbedPaneFactory.java --- a/openide.awt/src/org/openide/awt/TabbedPaneFactory.java Mon May 04 16:54:52 2009 +0200 +++ b/openide.awt/src/org/openide/awt/TabbedPaneFactory.java Wed May 06 13:42:43 2009 +0200 @@ -56,6 +56,16 @@ * when the user clicks close button on a tab. */ public static final String PROP_CLOSE = CloseButtonTabbedPane.PROP_CLOSE; + + /** + * To hide close button feature on specific tab, put value Boolean.TRUE + * as a client property of your tab:
+ *
+     * component.putClientProperty(TabbedPaneFactory.NO_CLOSE_BUTTON, Boolean.TRUE)
+     * 
+ * @since 7.8 + */ + public static final String NO_CLOSE_BUTTON = "noCloseButton"; /** Creates a new instance of TabbedPaneFactory */ private TabbedPaneFactory() { @@ -68,6 +78,7 @@ * value is the inner component inside the clicked tab. * * @return Special TabbedPane with closeable tabs. + * @see TabbedPaneFactory#NO_CLOSE_BUTTON */ public static JTabbedPane createCloseButtonTabbedPane() { return new CloseButtonTabbedPane();