Skip navigation links
org.netbeans.core.multitabs/1 1.17.0 1

Multi-tabs
Under Development

See: Description

Multi-tabs 
Package Description
org.netbeans.core.multitabs  

multitabs

The main purpose of this API is to allow third-party customizations of editor tabs. Instead of implementing many interfaces and creating various UI delegates it is possible to create a simple decorator-like class that can customize the appearance of a specific editor tab. For example change tabs background color according to file type or project type, change its icon etc.

What is New (see all changes)?

Use Cases

Tab Decorator

To customize the rendering of (some) editor tabs one needs subclass TabDecorator class and register it in the global Lookup.

The example below shows a decorator that removes file extension from Java source files to have shorter tabs to show more file names without the need for scrolling.

ServiceProvider(service = TabDecorator.class, position = 1000)
public class MyTabDecorator extends TabDecorator {

    public String getText( TabData tab ) {
        String res = tab.getText();
        if( null != res )
            res = res.replace( ".java", "");
        return res;
    }
}
              
Custom Tab Displayer

If one needs a custom editor tab displayer for example to have special tab layout or special layout of scrolling buttons etc it is necessary to subclass TabDisplayer class and register an instance of TabDisplayerFactory in the global Lookup.


public class MyTabDisplayer extends TabDisplayer {

    public MyTabDisplayer( TabDataModel model ) {
        super( model );
    }

    ServiceProvider(service = TabDisplayerFactory.class)
    public static class MyTabDisplayerFactory extends TabDisplayerFactory {
        public TabDisplayer createTabDisplayer( TabDataModel tabModel, int orientation ) {
            return new MyTabDisplayer( tabModel );
        }
    }

    //implement all abstract methods here
}
          

Exported Interfaces

This table lists all of the module exported APIs with defined stability classifications. It is generated based on answers to questions about the architecture of the module. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
multitabsExportedUnder Development

Implementation Details

Where are the sources for the module?

The sources for the module are in the NetBeans Mercurial repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

No other dependencies.

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.netbeans.core.multitabs/1 1.17.0 1