Search in sources :

Example 1 with AutocompleteMenu

use of org.csstudio.display.builder.representation.javafx.AutocompleteMenu in project org.csstudio.display.builder by kasemir.

the class DisplayEditorPart method createPartControl.

@Override
public void createPartControl(final Composite parent) {
    parent.setLayout(new FillLayout());
    final JFX_SWT_Wrapper wrapper = new JFX_SWT_Wrapper(parent, () -> {
        editor = new DisplayEditor(toolkit, Preferences.getUndoSize());
        final Parent root = editor.create();
        editor.getToolBar().getItems().add(new ExecuteDisplayButton(this));
        return new Scene(root);
    });
    final Scene scene = wrapper.getScene();
    EditorUtil.setSceneStyle(scene);
    JFXCursorFix.apply(scene, parent.getDisplay());
    final AutocompleteMenu ac_menu = editor.getSelectedWidgetUITracker().getAutocompleteMenu();
    ac_menu.setUpdater(new AutoCompleteUpdater(ac_menu));
    editor.getUndoableActionManager().addListener(undo_redo_listener);
    final Control fx_canvas = wrapper.getFXCanvas();
    fx_canvas.setMenu(createContextMenu(fx_canvas));
    createRetargetableActionHandlers(fx_canvas);
    PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "org.csstudio.display.builder.editor.rcp.display_builder");
    loadModel();
}
Also used : Control(org.eclipse.swt.widgets.Control) DisplayEditor(org.csstudio.display.builder.editor.DisplayEditor) Parent(javafx.scene.Parent) ExecuteDisplayButton(org.csstudio.display.builder.editor.rcp.actions.ExecuteDisplayButton) FillLayout(org.eclipse.swt.layout.FillLayout) JFX_SWT_Wrapper(org.csstudio.javafx.swt.JFX_SWT_Wrapper) AutocompleteMenu(org.csstudio.display.builder.representation.javafx.AutocompleteMenu) Scene(javafx.scene.Scene)

Example 2 with AutocompleteMenu

use of org.csstudio.display.builder.representation.javafx.AutocompleteMenu in project org.csstudio.display.builder by kasemir.

the class RulesDialogDemo method start.

/**
 * JavaFX Start
 */
@Override
public void start(final Stage stage) {
    final AutocompleteMenu menu = new AutocompleteMenu();
    final UndoableActionManager undo = new UndoableActionManager(10);
    final Widget widget = new LabelWidget();
    final List<RuleInfo> rules = widget.propRules().getValue();
    final RulesDialog dialog = new RulesDialog(undo, rules, widget, menu);
    System.out.println(dialog.showAndWait());
}
Also used : UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) LabelWidget(org.csstudio.display.builder.model.widgets.LabelWidget) LabelWidget(org.csstudio.display.builder.model.widgets.LabelWidget) Widget(org.csstudio.display.builder.model.Widget) AutocompleteMenu(org.csstudio.display.builder.representation.javafx.AutocompleteMenu) RuleInfo(org.csstudio.display.builder.model.rules.RuleInfo)

Aggregations

AutocompleteMenu (org.csstudio.display.builder.representation.javafx.AutocompleteMenu)2 Parent (javafx.scene.Parent)1 Scene (javafx.scene.Scene)1 DisplayEditor (org.csstudio.display.builder.editor.DisplayEditor)1 ExecuteDisplayButton (org.csstudio.display.builder.editor.rcp.actions.ExecuteDisplayButton)1 Widget (org.csstudio.display.builder.model.Widget)1 RuleInfo (org.csstudio.display.builder.model.rules.RuleInfo)1 LabelWidget (org.csstudio.display.builder.model.widgets.LabelWidget)1 UndoableActionManager (org.csstudio.display.builder.util.undo.UndoableActionManager)1 JFX_SWT_Wrapper (org.csstudio.javafx.swt.JFX_SWT_Wrapper)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Control (org.eclipse.swt.widgets.Control)1