Search in sources :

Example 1 with UndoableActionManager

use of org.csstudio.display.builder.util.undo.UndoableActionManager in project org.csstudio.display.builder by kasemir.

the class DataBrowserEditor method fillContextMenu.

/**
 * Dynamically fill context menu
 *  @param manager
 */
private void fillContextMenu(final IMenuManager manager) {
    final Activator activator = Activator.getDefault();
    final Shell shell = getSite().getShell();
    final UndoableActionManager op_manager = plot.getPlot().getUndoableActionManager();
    manager.add(toggle_toolbar);
    manager.add(toggle_legend);
    manager.add(new Separator());
    manager.add(new AddPVAction(op_manager, shell, model, false));
    manager.add(new AddPVAction(op_manager, shell, model, true));
    final boolean is_rcp = SingleSourcePlugin.getUIHelper().getUI() == UI.RCP;
    if (is_rcp) {
        try {
            for (IAction imp : SampleImporters.createImportActions(op_manager, shell, model)) manager.add(imp);
        } catch (Exception ex) {
            ExceptionDetailsErrorDialog.openError(shell, Messages.Error, ex);
        }
    }
    manager.add(new RemoveUnusedAxesAction(op_manager, model));
    manager.add(new RefreshAction(controller));
    manager.add(new Separator());
    manager.add(new OpenPropertiesAction());
    manager.add(new OpenViewAction(SearchView.ID, Messages.OpenSearchView, activator.getImageDescriptor("icons/search.gif")));
    if (is_rcp)
        manager.add(new OpenViewAction(ExportView.ID, Messages.OpenExportView, activator.getImageDescriptor("icons/export.png")));
    manager.add(new OpenViewAction(SampleView.ID, Messages.InspectSamples, activator.getImageDescriptor("icons/inspect.gif")));
    manager.add(new OpenPerspectiveAction(activator.getImageDescriptor("icons/databrowser.png"), Messages.OpenDataBrowserPerspective, Perspective.ID));
    manager.add(new OpenViewAction(WaveformView.ID, Messages.OpenWaveformView, activator.getImageDescriptor("icons/wavesample.gif")));
    manager.add(new Separator());
    manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
    if (is_rcp) {
        manager.add(new Separator());
        manager.add(snapshot);
        if (EMailSender.isEmailSupported())
            manager.add(new SendEMailAction(shell, plot.getPlot()));
        manager.add(new PrintAction(shell, plot.getPlot()));
        if (SendToElogAction.isElogAvailable())
            manager.add(new SendToElogAction(shell, plot.getPlot()));
    }
}
Also used : OpenPerspectiveAction(org.csstudio.ui.util.perspective.OpenPerspectiveAction) IAction(org.eclipse.jface.action.IAction) OpenViewAction(org.csstudio.apputil.ui.workbench.OpenViewAction) PartInitException(org.eclipse.ui.PartInitException) Shell(org.eclipse.swt.widgets.Shell) RemoveUnusedAxesAction(org.csstudio.trends.databrowser3.propsheet.RemoveUnusedAxesAction) RefreshAction(org.csstudio.trends.databrowser3.ui.RefreshAction) Activator(org.csstudio.trends.databrowser3.Activator) UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) AddPVAction(org.csstudio.trends.databrowser3.ui.AddPVAction) GroupMarker(org.eclipse.jface.action.GroupMarker) Separator(org.eclipse.jface.action.Separator)

Example 2 with UndoableActionManager

use of org.csstudio.display.builder.util.undo.UndoableActionManager 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)

Example 3 with UndoableActionManager

use of org.csstudio.display.builder.util.undo.UndoableActionManager in project org.csstudio.display.builder by kasemir.

the class ImageToolbarHandler method addUndo.

private void addUndo(final boolean active) {
    final Button undo = newButton(ToolIcons.UNDO, Messages.Undo_TT);
    final Button redo = newButton(ToolIcons.REDO, Messages.Redo_TT);
    final UndoableActionManager undo_mgr = plot.getUndoableActionManager();
    undo.setDisable(!undo_mgr.canUndo());
    redo.setDisable(!undo_mgr.canRedo());
    if (active) {
        undo.setOnAction(event -> plot.getUndoableActionManager().undoLast());
        redo.setOnAction(event -> plot.getUndoableActionManager().redoLast());
        undo_mgr.addListener((to_undo, to_redo) -> {
            Platform.runLater(() -> {
                if (to_undo == null) {
                    undo.setDisable(true);
                    undo.setTooltip(new Tooltip(Messages.Undo_TT));
                } else {
                    undo.setDisable(false);
                    undo.setTooltip(new Tooltip(NLS.bind(Messages.Undo_Fmt_TT, to_undo)));
                }
                if (to_redo == null) {
                    redo.setDisable(true);
                    redo.setTooltip(new Tooltip(Messages.Redo_TT));
                } else {
                    redo.setDisable(false);
                    redo.setTooltip(new Tooltip(NLS.bind(Messages.Redo_Fmt_TT, to_redo)));
                }
            });
        });
    }
}
Also used : Button(javafx.scene.control.Button) ToggleButton(javafx.scene.control.ToggleButton) UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) Tooltip(javafx.scene.control.Tooltip)

Example 4 with UndoableActionManager

use of org.csstudio.display.builder.util.undo.UndoableActionManager in project org.csstudio.display.builder by kasemir.

the class PropertyPanelSection method bindSimplePropertyField.

/**
 * Some 'simple' properties are handled
 *  in static method to allow use in the
 *  RulesDialog
 *  @param undo
 *  @param bindings
 *  @param property
 *  @param other
 *  @return
 */
public static Node bindSimplePropertyField(final UndoableActionManager undo, final List<WidgetPropertyBinding<?, ?>> bindings, final WidgetProperty<?> property, final List<Widget> other) {
    final Widget widget = property.getWidget();
    Node field = null;
    if (property.isReadonly()) {
        // If "Type", use a label with an icon.
        if (property.getName().equals(CommonWidgetProperties.propType.getName())) {
            final String type = widget.getType();
            try {
                final Image image = new Image(WidgetFactory.getInstance().getWidgetDescriptor(type).getIconStream());
                final ImageView icon = new ImageView(image);
                final String name = WidgetFactory.getInstance().getWidgetDescriptor(type).getName();
                field = new Label(name, icon);
            } catch (Exception ex) {
                // Some widgets have no icon (e.g. DisplayModel).
                field = new Label(String.valueOf(property.getValue()));
            }
        } else {
            final TextField text = new TextField();
            text.setText(String.valueOf(property.getValue()));
            text.setDisable(true);
            field = text;
        }
    } else if (property instanceof ColorWidgetProperty) {
        final ColorWidgetProperty color_prop = (ColorWidgetProperty) property;
        final WidgetColorPropertyField color_field = new WidgetColorPropertyField();
        final WidgetColorPropertyBinding binding = new WidgetColorPropertyBinding(undo, color_field, color_prop, other);
        bindings.add(binding);
        binding.bind();
        field = color_field;
    } else if (property instanceof FontWidgetProperty) {
        final FontWidgetProperty font_prop = (FontWidgetProperty) property;
        final Button font_field = new Button();
        font_field.setMaxWidth(Double.MAX_VALUE);
        final WidgetFontPropertyBinding binding = new WidgetFontPropertyBinding(undo, font_field, font_prop, other);
        bindings.add(binding);
        binding.bind();
        field = font_field;
    } else if (property instanceof EnumWidgetProperty<?>) {
        final EnumWidgetProperty<?> enum_prop = (EnumWidgetProperty<?>) property;
        final ComboBox<String> combo = new ComboBox<>();
        combo.setPromptText(property.getDefaultValue().toString());
        combo.getItems().addAll(enum_prop.getLabels());
        combo.setMaxWidth(Double.MAX_VALUE);
        combo.setMaxHeight(Double.MAX_VALUE);
        final ToggleButton macroButton = new ToggleButton("$");
        try {
            macroButton.setGraphic(new ImageView(new Image(ResourceUtil.openPlatformResource("platform:/plugin/org.csstudio.display.builder.editor/icons/macro-edit.png"))));
        } catch (Exception ex) {
            logger.log(Level.WARNING, "Cannot load macro edit image.", ex);
        }
        macroButton.getStyleClass().add("macro_button");
        macroButton.setTooltip(new Tooltip(Messages.MacroEditButton));
        BorderPane.setMargin(macroButton, new Insets(0, 0, 0, 3));
        BorderPane.setAlignment(macroButton, Pos.CENTER);
        final EnumWidgetPropertyBinding binding = new EnumWidgetPropertyBinding(undo, combo, enum_prop, other);
        bindings.add(binding);
        binding.bind();
        final EventHandler<ActionEvent> macro_handler = event -> {
            final boolean use_macro = macroButton.isSelected() || MacroHandler.containsMacros(enum_prop.getSpecification());
            combo.setEditable(use_macro);
            // now that the combo has become editable.
            if (use_macro && combo.getEditor().getText().isEmpty())
                binding.restore();
        };
        macroButton.setOnAction(macro_handler);
        macroButton.setSelected(MacroHandler.containsMacros(enum_prop.getSpecification()));
        macro_handler.handle(null);
        field = new BorderPane(combo, null, macroButton, null, null);
        // When used in RulesDialog, field can get focus.
        // In that case, forward focus to combo
        field.focusedProperty().addListener((ob, o, focused) -> {
            if (focused) {
                combo.requestFocus();
                if (combo.isEditable())
                    combo.getEditor().selectAll();
            }
        });
    } else if (property instanceof BooleanWidgetProperty) {
        final BooleanWidgetProperty bool_prop = (BooleanWidgetProperty) property;
        final ComboBox<String> combo = new ComboBox<>();
        combo.setPromptText(property.getDefaultValue().toString());
        combo.getItems().addAll("true", "false");
        combo.setMaxWidth(Double.MAX_VALUE);
        combo.setMaxHeight(Double.MAX_VALUE);
        combo.setEditable(true);
        // BooleanWidgetPropertyBinding makes either check or combo visible
        // for plain boolean vs. macro-based value
        final CheckBox check = new CheckBox();
        StackPane.setAlignment(check, Pos.CENTER_LEFT);
        final ToggleButton macroButton = new ToggleButton("$");
        try {
            macroButton.setGraphic(new ImageView(new Image(ResourceUtil.openPlatformResource("platform:/plugin/org.csstudio.display.builder.editor/icons/macro-edit.png"))));
        } catch (Exception ex) {
            logger.log(Level.WARNING, "Cannot load macro edit image.", ex);
        }
        macroButton.getStyleClass().add("macro_button");
        macroButton.setTooltip(new Tooltip(Messages.MacroEditButton));
        BorderPane.setMargin(macroButton, new Insets(0, 0, 0, 3));
        BorderPane.setAlignment(macroButton, Pos.CENTER);
        final BooleanWidgetPropertyBinding binding = new BooleanWidgetPropertyBinding(undo, check, combo, macroButton, bool_prop, other);
        bindings.add(binding);
        binding.bind();
        field = new BorderPane(new StackPane(combo, check), null, macroButton, null, null);
        // For RulesDialog, see above
        field.focusedProperty().addListener((ob, o, focused) -> {
            if (focused) {
                if (combo.isVisible()) {
                    combo.requestFocus();
                    combo.getEditor().selectAll();
                } else if (check.isVisible())
                    check.requestFocus();
            }
        });
    } else if (property instanceof ColorMapWidgetProperty) {
        final ColorMapWidgetProperty colormap_prop = (ColorMapWidgetProperty) property;
        final Button map_button = new Button();
        map_button.setMaxWidth(Double.MAX_VALUE);
        final ColorMapPropertyBinding binding = new ColorMapPropertyBinding(undo, map_button, colormap_prop, other);
        bindings.add(binding);
        binding.bind();
        field = map_button;
    } else if (property instanceof WidgetClassProperty) {
        final WidgetClassProperty widget_class_prop = (WidgetClassProperty) property;
        final ComboBox<String> combo = new ComboBox<>();
        combo.setPromptText(property.getDefaultValue().toString());
        combo.setEditable(true);
        // List classes of this widget
        final String type = widget.getType();
        final Collection<String> classes = WidgetClassesService.getWidgetClasses().getWidgetClasses(type);
        combo.getItems().addAll(classes);
        combo.setMaxWidth(Double.MAX_VALUE);
        final WidgetClassBinding binding = new WidgetClassBinding(undo, combo, widget_class_prop, other);
        bindings.add(binding);
        binding.bind();
        field = combo;
    } else if (property instanceof FilenameWidgetProperty) {
        final FilenameWidgetProperty file_prop = (FilenameWidgetProperty) property;
        final TextField text = new TextField();
        text.setPromptText(file_prop.getDefaultValue().toString());
        text.setMaxWidth(Double.MAX_VALUE);
        final Button select_file = new Button("...");
        select_file.setOnAction(event -> {
            try {
                final String filename = FilenameSupport.promptForRelativePath(widget, file_prop.getValue());
                if (filename != null)
                    undo.execute(new SetMacroizedWidgetPropertyAction(file_prop, filename));
            } catch (Exception ex) {
                logger.log(Level.WARNING, "Cannot prompt for " + file_prop, ex);
            }
        });
        final MacroizedWidgetPropertyBinding binding = new MacroizedWidgetPropertyBinding(undo, text, file_prop, other);
        bindings.add(binding);
        binding.bind();
        field = new HBox(text, select_file);
        HBox.setHgrow(text, Priority.ALWAYS);
        // For RulesDialog, see above
        field.focusedProperty().addListener((ob, o, focused) -> {
            if (focused)
                text.requestFocus();
        });
    } else if (property instanceof PVNameWidgetProperty) {
        final PVNameWidgetProperty pv_prop = (PVNameWidgetProperty) property;
        final TextField text = new TextField();
        text.setPromptText(pv_prop.getDefaultValue().toString());
        final MacroizedWidgetPropertyBinding binding = new MacroizedWidgetPropertyBinding(undo, text, pv_prop, other) {

            @Override
            public void bind() {
                super.bind();
                autocomplete_menu.attachField(text);
            }

            @Override
            public void unbind() {
                super.unbind();
                autocomplete_menu.removeField(text);
            }
        };
        bindings.add(binding);
        binding.bind();
        // Allow editing long PV names, including loc://text("Log text with newlines"),
        // in dialog
        final Button open_editor = new Button("...");
        open_editor.setOnAction(event -> {
            final MultiLineInputDialog dialog = new MultiLineInputDialog(pv_prop.getSpecification());
            DialogHelper.positionDialog(dialog, open_editor, -600, 0);
            final Optional<String> result = dialog.showAndWait();
            if (!result.isPresent())
                return;
            undo.execute(new SetMacroizedWidgetPropertyAction(pv_prop, result.get()));
            for (Widget w : other) {
                final MacroizedWidgetProperty<?> other_prop = (MacroizedWidgetProperty<?>) w.getProperty(pv_prop.getName());
                undo.execute(new SetMacroizedWidgetPropertyAction(other_prop, result.get()));
            }
        });
        field = new HBox(text, open_editor);
        HBox.setHgrow(text, Priority.ALWAYS);
        // For RulesDialog, see similar code elsewhere
        field.focusedProperty().addListener((ob, o, focused) -> {
            if (focused)
                text.requestFocus();
        });
    } else if (property instanceof MacroizedWidgetProperty) {
        // MacroizedWidgetProperty needs to be checked _after_ subclasses like PVNameWidgetProperty, FilenameWidgetProperty
        final MacroizedWidgetProperty<?> macro_prop = (MacroizedWidgetProperty<?>) property;
        final TextField text = new TextField();
        text.setPromptText(macro_prop.getDefaultValue().toString());
        final MacroizedWidgetPropertyBinding binding = new MacroizedWidgetPropertyBinding(undo, text, macro_prop, other);
        bindings.add(binding);
        binding.bind();
        if (CommonWidgetProperties.propText.getName().equals(property.getName()) || CommonWidgetProperties.propTooltip.getName().equals(property.getName())) {
            // Allow editing multi-line text in dialog
            final Button open_editor = new Button("...");
            open_editor.setOnAction(event -> {
                final MultiLineInputDialog dialog = new MultiLineInputDialog(macro_prop.getSpecification());
                DialogHelper.positionDialog(dialog, open_editor, -600, 0);
                final Optional<String> result = dialog.showAndWait();
                if (!result.isPresent())
                    return;
                undo.execute(new SetMacroizedWidgetPropertyAction(macro_prop, result.get()));
                for (Widget w : other) {
                    final MacroizedWidgetProperty<?> other_prop = (MacroizedWidgetProperty<?>) w.getProperty(macro_prop.getName());
                    undo.execute(new SetMacroizedWidgetPropertyAction(other_prop, result.get()));
                }
            });
            field = new HBox(text, open_editor);
            HBox.setHgrow(text, Priority.ALWAYS);
            // For RulesDialog, see above
            field.focusedProperty().addListener((ob, o, focused) -> {
                if (focused)
                    text.requestFocus();
            });
        } else
            field = text;
    } else if (property instanceof PointsWidgetProperty) {
        final PointsWidgetProperty points_prop = (PointsWidgetProperty) property;
        final Button points_field = new Button();
        points_field.setMaxWidth(Double.MAX_VALUE);
        final PointsPropertyBinding binding = new PointsPropertyBinding(undo, points_field, points_prop, other);
        bindings.add(binding);
        binding.bind();
        field = points_field;
    }
    return field;
}
Also used : EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) FilenameSupport(org.csstudio.display.builder.representation.javafx.FilenameSupport) HPos(javafx.geometry.HPos) Pos(javafx.geometry.Pos) UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) ScriptsWidgetProperty(org.csstudio.display.builder.model.properties.ScriptsWidgetProperty) SetMacroizedWidgetPropertyAction(org.csstudio.display.builder.editor.undo.SetMacroizedWidgetPropertyAction) StackPane(javafx.scene.layout.StackPane) MultiLineInputDialog(org.csstudio.javafx.MultiLineInputDialog) StructuredWidgetProperty(org.csstudio.display.builder.model.StructuredWidgetProperty) MacrosWidgetProperty(org.csstudio.display.builder.model.properties.MacrosWidgetProperty) ComboBox(javafx.scene.control.ComboBox) ResourceUtil(org.csstudio.display.builder.util.ResourceUtil) EnumWidgetProperty(org.csstudio.display.builder.model.properties.EnumWidgetProperty) WidgetProperty(org.csstudio.display.builder.model.WidgetProperty) BooleanWidgetProperty(org.csstudio.display.builder.model.properties.BooleanWidgetProperty) HBox(javafx.scene.layout.HBox) TextField(javafx.scene.control.TextField) Collection(java.util.Collection) WidgetClassProperty(org.csstudio.display.builder.model.properties.WidgetClassProperty) WidgetClassesService(org.csstudio.display.builder.model.persist.WidgetClassesService) Spinner(javafx.scene.control.Spinner) Messages(org.csstudio.display.builder.editor.Messages) CommonWidgetProperties(org.csstudio.display.builder.model.properties.CommonWidgetProperties) MacroizedWidgetProperty(org.csstudio.display.builder.model.MacroizedWidgetProperty) Separator(javafx.scene.control.Separator) Priority(javafx.scene.layout.Priority) List(java.util.List) ColorWidgetProperty(org.csstudio.display.builder.model.properties.ColorWidgetProperty) PointsWidgetProperty(org.csstudio.display.builder.model.properties.PointsWidgetProperty) ToggleButton(javafx.scene.control.ToggleButton) WidgetFactory(org.csstudio.display.builder.model.WidgetFactory) Optional(java.util.Optional) AutocompleteMenu(org.csstudio.display.builder.representation.javafx.AutocompleteMenu) BorderPane(javafx.scene.layout.BorderPane) PVNameWidgetProperty(org.csstudio.display.builder.model.properties.PVNameWidgetProperty) ColumnConstraints(javafx.scene.layout.ColumnConstraints) Plugin.logger(org.csstudio.display.builder.editor.Plugin.logger) FilenameWidgetProperty(org.csstudio.display.builder.model.properties.FilenameWidgetProperty) ArrayList(java.util.ArrayList) Level(java.util.logging.Level) RulesWidgetProperty(org.csstudio.display.builder.model.properties.RulesWidgetProperty) Insets(javafx.geometry.Insets) Tooltip(javafx.scene.control.Tooltip) GridPane(javafx.scene.layout.GridPane) ArrayWidgetProperty(org.csstudio.display.builder.model.ArrayWidgetProperty) Label(javafx.scene.control.Label) WidgetPropertyCategory(org.csstudio.display.builder.model.WidgetPropertyCategory) FontWidgetProperty(org.csstudio.display.builder.model.properties.FontWidgetProperty) Node(javafx.scene.Node) CheckBox(javafx.scene.control.CheckBox) ColorMapWidgetProperty(org.csstudio.display.builder.model.properties.ColorMapWidgetProperty) ActionsWidgetProperty(org.csstudio.display.builder.model.properties.ActionsWidgetProperty) ActionEvent(javafx.event.ActionEvent) MacroHandler(org.csstudio.display.builder.model.macros.MacroHandler) ImageView(javafx.scene.image.ImageView) DialogHelper(org.csstudio.javafx.DialogHelper) Widget(org.csstudio.display.builder.model.Widget) Image(javafx.scene.image.Image) BorderPane(javafx.scene.layout.BorderPane) HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) PointsWidgetProperty(org.csstudio.display.builder.model.properties.PointsWidgetProperty) FontWidgetProperty(org.csstudio.display.builder.model.properties.FontWidgetProperty) Node(javafx.scene.Node) ColorMapWidgetProperty(org.csstudio.display.builder.model.properties.ColorMapWidgetProperty) Widget(org.csstudio.display.builder.model.Widget) Label(javafx.scene.control.Label) EventHandler(javafx.event.EventHandler) WidgetClassProperty(org.csstudio.display.builder.model.properties.WidgetClassProperty) Image(javafx.scene.image.Image) Button(javafx.scene.control.Button) ToggleButton(javafx.scene.control.ToggleButton) MultiLineInputDialog(org.csstudio.javafx.MultiLineInputDialog) TextField(javafx.scene.control.TextField) ImageView(javafx.scene.image.ImageView) StackPane(javafx.scene.layout.StackPane) ToggleButton(javafx.scene.control.ToggleButton) BooleanWidgetProperty(org.csstudio.display.builder.model.properties.BooleanWidgetProperty) Optional(java.util.Optional) ComboBox(javafx.scene.control.ComboBox) Tooltip(javafx.scene.control.Tooltip) FilenameWidgetProperty(org.csstudio.display.builder.model.properties.FilenameWidgetProperty) MacroizedWidgetProperty(org.csstudio.display.builder.model.MacroizedWidgetProperty) SetMacroizedWidgetPropertyAction(org.csstudio.display.builder.editor.undo.SetMacroizedWidgetPropertyAction) EnumWidgetProperty(org.csstudio.display.builder.model.properties.EnumWidgetProperty) CheckBox(javafx.scene.control.CheckBox) ColorWidgetProperty(org.csstudio.display.builder.model.properties.ColorWidgetProperty) PVNameWidgetProperty(org.csstudio.display.builder.model.properties.PVNameWidgetProperty)

Example 5 with UndoableActionManager

use of org.csstudio.display.builder.util.undo.UndoableActionManager in project org.csstudio.display.builder by kasemir.

the class RemoveGroupAction method run.

@Override
public void run() {
    editor.getWidgetSelectionHandler().clear();
    // Group's children list will be empty, create copy to select la
    final List<Widget> widgets = new ArrayList<>(group.runtimeChildren().getValue());
    final UndoableActionManager undo = editor.getUndoableActionManager();
    undo.execute(new UnGroupWidgetsAction(group));
    editor.getWidgetSelectionHandler().setSelection(widgets);
}
Also used : UnGroupWidgetsAction(org.csstudio.display.builder.editor.undo.UnGroupWidgetsAction) UndoableActionManager(org.csstudio.display.builder.util.undo.UndoableActionManager) GroupWidget(org.csstudio.display.builder.model.widgets.GroupWidget) Widget(org.csstudio.display.builder.model.Widget) ArrayList(java.util.ArrayList)

Aggregations

UndoableActionManager (org.csstudio.display.builder.util.undo.UndoableActionManager)7 Button (javafx.scene.control.Button)3 ToggleButton (javafx.scene.control.ToggleButton)3 Tooltip (javafx.scene.control.Tooltip)3 Widget (org.csstudio.display.builder.model.Widget)3 ArrayList (java.util.ArrayList)2 GroupWidget (org.csstudio.display.builder.model.widgets.GroupWidget)2 Collection (java.util.Collection)1 List (java.util.List)1 Optional (java.util.Optional)1 Level (java.util.logging.Level)1 ActionEvent (javafx.event.ActionEvent)1 EventHandler (javafx.event.EventHandler)1 HPos (javafx.geometry.HPos)1 Insets (javafx.geometry.Insets)1 Pos (javafx.geometry.Pos)1 Rectangle2D (javafx.geometry.Rectangle2D)1 Node (javafx.scene.Node)1 CheckBox (javafx.scene.control.CheckBox)1 ComboBox (javafx.scene.control.ComboBox)1