View | Details | Raw Unified | Return to bug 209051 | Differences between
and this patch

Collapse All | Expand All

(-)a/core.multiview/src/org/netbeans/core/multiview/MultiViewCloneableTopComponent.java (+4 lines)
 Lines 355-360    Link Here 
355
        return false;
355
        return false;
356
    }
356
    }
357
    
357
    
358
    @Override
359
    public SubComponent[] getSubComponents() {
360
        return MultiViewTopComponent.getSubComponents( peer );
361
    }
358
    
362
    
359
    /**
363
    /**
360
     * implementation of the MultiViewElement.ActionRequestObserver, manages activatation of the elements
364
     * implementation of the MultiViewElement.ActionRequestObserver, manages activatation of the elements
(-)a/core.multiview/src/org/netbeans/core/multiview/MultiViewTopComponent.java (+26 lines)
 Lines 44-56    Link Here 
44
44
45
package org.netbeans.core.multiview;
45
package org.netbeans.core.multiview;
46
46
47
import java.awt.event.ActionEvent;
48
import java.awt.event.ActionListener;
47
import java.io.*;
49
import java.io.*;
48
import java.util.Map;
50
import java.util.Map;
49
import javax.swing.Action;
51
import javax.swing.Action;
52
import org.netbeans.core.api.multiview.MultiViewPerspective;
50
import org.netbeans.core.multiview.MultiViewModel.ActionRequestObserverFactory;
53
import org.netbeans.core.multiview.MultiViewModel.ActionRequestObserverFactory;
51
import org.netbeans.core.spi.multiview.CloseOperationHandler;
54
import org.netbeans.core.spi.multiview.CloseOperationHandler;
52
import org.netbeans.core.spi.multiview.MultiViewDescription;
55
import org.netbeans.core.spi.multiview.MultiViewDescription;
53
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
56
import org.netbeans.core.spi.multiview.MultiViewElementCallback;
57
import org.openide.awt.Actions;
54
import org.openide.awt.UndoRedo;
58
import org.openide.awt.UndoRedo;
55
import org.openide.util.HelpCtx;
59
import org.openide.util.HelpCtx;
56
import org.openide.util.Lookup;
60
import org.openide.util.Lookup;
 Lines 276-281    Link Here 
276
    public void requestFocus() {
280
    public void requestFocus() {
277
        peer.requestFocus();
281
        peer.requestFocus();
278
    }
282
    }
283
284
    @Override
285
    public SubComponent[] getSubComponents() {
286
        return getSubComponents( peer );
287
    }
288
289
    static SubComponent[] getSubComponents( final MultiViewPeer peer ) {
290
        MultiViewModel model = peer.getModel();
291
        MultiViewPerspective[] perspectives = model.getPerspectives();
292
        SubComponent[] res = new SubComponent[perspectives.length];
293
        for( int i=0; i<perspectives.length; i++ ) {
294
            final MultiViewPerspective mvp = perspectives[i];
295
            res[i] = new SubComponent( Actions.cutAmpersand(mvp.getDisplayName()), new ActionListener() {
296
297
                @Override
298
                public void actionPerformed( ActionEvent e ) {
299
                    peer.getMultiViewHandlerDelegate().requestActive( mvp );
300
                }
301
            }, mvp == model.getSelectedPerspective() );
302
        }
303
        return res;
304
    }
279
    
305
    
280
//    public Lookup getLookup() {
306
//    public Lookup getLookup() {
281
//        return peer.getLookup(super.getLookup());
307
//        return peer.getLookup(super.getLookup());

Return to bug 209051
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo