1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.lttng
.scope
.tmf2
.views
.ui
.timeline
;
12 import static java
.util
.Objects
.requireNonNull
;
14 import java
.util
.Collection
;
15 import java
.util
.stream
.Collectors
;
17 import org
.eclipse
.jdt
.annotation
.Nullable
;
18 import org
.eclipse
.swt
.SWT
;
19 import org
.eclipse
.swt
.widgets
.Composite
;
20 import org
.eclipse
.tracecompass
.common
.core
.StreamUtils
;
21 import org
.eclipse
.tracecompass
.tmf
.ui
.views
.TmfView
;
22 import org
.lttng
.scope
.tmf2
.views
.core
.context
.ViewGroupContext
;
24 import javafx
.embed
.swt
.FXCanvas
;
25 import javafx
.geometry
.Orientation
;
26 import javafx
.scene
.Node
;
27 import javafx
.scene
.Scene
;
28 import javafx
.scene
.control
.SplitPane
;
30 public class TimelineView
extends TmfView
{
32 public static final String VIEW_ID
= "org.lttng.scope.views.timeline"; //$NON-NLS-1$
34 private static final String VIEW_NAME
= requireNonNull(Messages
.timelineViewName
);
36 private @Nullable TimelineManager fManager
;
38 public TimelineView() {
43 public void createPartControl(@Nullable Composite parent
) {
48 FXCanvas fxCanvas
= new FXCanvas(parent
, SWT
.NONE
);
49 SplitPane sp
= new SplitPane();
50 sp
.setOrientation(Orientation
.VERTICAL
);
52 /* Add the widget to the view */
53 TimelineManager manager
= new TimelineManager(ViewGroupContext
.getCurrent());
54 Collection
<Node
> nodes
= StreamUtils
.getStream(manager
.getWidgets())
55 .map(widget
-> widget
.getRootNode())
56 .collect(Collectors
.toList());
57 sp
.getItems().addAll(nodes
);
59 fxCanvas
.setScene(new Scene(sp
));
62 * Set the initial divider positions. Has to be done *after* the
63 * Stage/Scene is initialized.
65 manager
.resetInitialSeparatorPosition();
71 public void dispose() {
72 if (fManager
!= null) {
78 public void setFocus() {
This page took 0.03177 seconds and 5 git commands to generate.