Search in sources :

Example 1 with DisplayEditor

use of org.csstudio.display.builder.editor.DisplayEditor 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 DisplayEditor

use of org.csstudio.display.builder.editor.DisplayEditor in project org.csstudio.display.builder by kasemir.

the class EditorPartAction method forActionDescription.

public static EditorPartAction forActionDescription(final ActionDescription action) {
    final ImageDescriptor icon = AbstractUIPlugin.imageDescriptorFromPlugin(org.csstudio.display.builder.editor.Plugin.ID, action.getIcon());
    return new EditorPartAction(action.getToolTip(), icon) {

        @Override
        public void run() {
            final DisplayEditor editor = edit_part.getDisplayEditor();
            action.run(editor);
        }
    };
}
Also used : DisplayEditor(org.csstudio.display.builder.editor.DisplayEditor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Example 3 with DisplayEditor

use of org.csstudio.display.builder.editor.DisplayEditor in project org.csstudio.display.builder by kasemir.

the class EditorPartAction method forToggledActionDescription.

public static EditorPartAction forToggledActionDescription(final ActionDescription action) {
    final ImageDescriptor icon = AbstractUIPlugin.imageDescriptorFromPlugin(org.csstudio.display.builder.editor.Plugin.ID, action.getIcon());
    final EditorPartAction epa = new EditorPartAction(action.getToolTip(), icon, Action.AS_CHECK_BOX) {

        @Override
        public void run() {
            final DisplayEditor editor = edit_part.getDisplayEditor();
            action.run(editor, isChecked());
        }
    };
    epa.setChecked(true);
    return epa;
}
Also used : DisplayEditor(org.csstudio.display.builder.editor.DisplayEditor) ImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)

Aggregations

DisplayEditor (org.csstudio.display.builder.editor.DisplayEditor)3 ImageDescriptor (org.eclipse.jface.resource.ImageDescriptor)2 Parent (javafx.scene.Parent)1 Scene (javafx.scene.Scene)1 ExecuteDisplayButton (org.csstudio.display.builder.editor.rcp.actions.ExecuteDisplayButton)1 AutocompleteMenu (org.csstudio.display.builder.representation.javafx.AutocompleteMenu)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