Lines 51-62
Link Here
|
51 |
import java.util.logging.Logger; |
51 |
import java.util.logging.Logger; |
52 |
import javax.swing.Action; |
52 |
import javax.swing.Action; |
53 |
import javax.swing.SwingUtilities; |
53 |
import javax.swing.SwingUtilities; |
|
|
54 |
import org.netbeans.core.api.multiview.MultiViewPerspective; |
54 |
import org.netbeans.core.multiview.MultiViewModel.ActionRequestObserverFactory; |
55 |
import org.netbeans.core.multiview.MultiViewModel.ActionRequestObserverFactory; |
55 |
import org.netbeans.core.spi.multiview.CloseOperationHandler; |
56 |
import org.netbeans.core.spi.multiview.CloseOperationHandler; |
56 |
import org.netbeans.core.spi.multiview.MultiViewDescription; |
57 |
import org.netbeans.core.spi.multiview.MultiViewDescription; |
57 |
import org.netbeans.core.spi.multiview.MultiViewElement; |
58 |
import org.netbeans.core.spi.multiview.MultiViewElement; |
58 |
import org.netbeans.core.spi.multiview.MultiViewElementCallback; |
59 |
import org.netbeans.core.spi.multiview.MultiViewElementCallback; |
59 |
import org.netbeans.core.spi.multiview.SourceViewMarker; |
60 |
import org.netbeans.core.spi.multiview.SourceViewMarker; |
|
|
61 |
import org.openide.awt.Actions; |
60 |
import org.openide.awt.UndoRedo; |
62 |
import org.openide.awt.UndoRedo; |
61 |
import org.openide.text.CloneableEditorSupport; |
63 |
import org.openide.text.CloneableEditorSupport; |
62 |
import org.openide.util.HelpCtx; |
64 |
import org.openide.util.HelpCtx; |
Lines 355-360
Link Here
|
355 |
return false; |
357 |
return false; |
356 |
} |
358 |
} |
357 |
|
359 |
|
|
|
360 |
@Override |
361 |
public SubComponent[] getSubComponents() { |
362 |
MultiViewModel model = peer.getModel(); |
363 |
MultiViewPerspective[] perspectives = model.getPerspectives(); |
364 |
SubComponent[] res = new SubComponent[perspectives.length]; |
365 |
for( int i=0; i<perspectives.length; i++ ) { |
366 |
final MultiViewPerspective mvp = perspectives[i]; |
367 |
res[i] = new SubComponent( Actions.cutAmpersand(mvp.getDisplayName()), null, mvp == model.getSelectedPerspective() ) { |
368 |
@Override |
369 |
public void activate() { |
370 |
peer.getMultiViewHandlerDelegate().requestActive( mvp ); |
371 |
} |
372 |
}; |
373 |
} |
374 |
return res; |
375 |
} |
358 |
|
376 |
|
359 |
/** |
377 |
/** |
360 |
* implementation of the MultiViewElement.ActionRequestObserver, manages activatation of the elements |
378 |
* implementation of the MultiViewElement.ActionRequestObserver, manages activatation of the elements |