org.netbeans.swing.tabcontrol.DefaultTabDataModel Java Examples

The following examples show how to use org.netbeans.swing.tabcontrol.DefaultTabDataModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LayoutModelTest.java    From netbeans with Apache License 2.0 6 votes vote down vote up
private void prepareModel() {
    TabData[] td = new TabData[25];
    int ct = 0;
    for (char c='a'; c < 'z'; c++) {
        char[] ch = new char[ct+1];
        Arrays.fill (ch, c);
        String name = new String (ch);
        Component comp = new JLabel(name);
        comp.setName (name);
        td[ct] = new TabData (comp, ic, name, "tip:"+name);
        ct++;
    }
    padX = 2;
    padY = 2;
    mdl = new DefaultTabDataModel (td);
    JLabel jl = new JLabel();
    jl.setBorder (BorderFactory.createEmptyBorder());
    lay = new TestLayoutModel (mdl, jl);
    lay.setPadding (new Dimension(padX, padY));
}
 
Example #2
Source File: TabbedSlideAdapter.java    From netbeans with Apache License 2.0 5 votes vote down vote up
@Override
public Image createImageOfTab(int tabIndex) {
    TabData dt = slideBar.getModel().getTab(tabIndex);
    if (dt.getComponent() instanceof TopComponent) {
        DefaultTabDataModel tempModel = new DefaultTabDataModel( new TabData[] { dt } );
        TabbedContainer temp = new TabbedContainer( tempModel, TabbedContainer.TYPE_VIEW );
        temp.setSize( 300,300 );
        
        return temp.createImageOfTab(0);
    }
    
    return null;
}
 
Example #3
Source File: TabbedImpl.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public TabbedImpl( WinsysInfoForTabbedContainer winsysInfo, int orientation ) {
    tabModel = new DefaultTabDataModel();
    TabDisplayer displayer = TabDisplayerFactory.getDefault().createTabDisplayer( tabModel, orientation );
    controller = new Controller( displayer );

    container = new TabContainer(this, displayer, orientation );
    
    getSelectionModel().addChangeListener( new ChangeListener() {

        @Override
        public void stateChanged( ChangeEvent e ) {
            fireStateChanged();
        }
    });
}
 
Example #4
Source File: WorkspaceTopComponent.java    From snap-desktop with GNU General Public License v3.0 5 votes vote down vote up
private void initComponents() {
    setLayout(new BorderLayout());

    DefaultTabDataModel tabDataModel = new DefaultTabDataModel();
    tabbedContainer = new TabbedContainer(tabDataModel,
                                          TabbedContainer.TYPE_EDITOR,
                                          WinsysInfoForTabbedContainer.getDefault(new MyWinsysInfoForTabbedContainer()));
    tabbedContainer.setVisible(false);

    desktopPane = new JDesktopPane();

    add(tabbedContainer, BorderLayout.NORTH);
    add(desktopPane, BorderLayout.CENTER);
}