Package com.volantis.mcs.eclipse.ab.actions

Examples of com.volantis.mcs.eclipse.ab.actions.SubMenuAction


    protected static void populateSubMenuActions(Map actions) {
        populateCanvasSubMenuActions(actions);
        populateMontageSubMenuActions(actions);
        populateUndefinedSubMenuActions(actions);

        SubMenuAction gridModifyMenu =
                (SubMenuAction) actions.get(ActionID.GRID_MODIFY_MENU);

        gridModifyMenu.add((IAction) actions.get(ActionID.INSERT_COLUMNS));
        gridModifyMenu.add((IAction) actions.get(ActionID.INSERT_ROWS));
        gridModifyMenu.add((IAction) actions.get(ActionID.DELETE_COLUMN));
        gridModifyMenu.add((IAction) actions.get(ActionID.DELETE_ROW));
    }
View Full Code Here


    /**
     * Populates the canvas-specific sub-menu actions with the appropriate
     * actions.
     */
    protected static void populateCanvasSubMenuActions(Map actions) {
        SubMenuAction newMenu =
                (SubMenuAction) actions.get(ActionID.CANVAS_NEW_MENU);

        // Build the New Pane sub-menu
        SubMenuAction newPaneMenu =
                (SubMenuAction) actions.get(ActionID.NEW_PANE_MENU);

        newMenu.add(newPaneMenu);

        newPaneMenu.add((IAction) actions.get(ActionID.NEW_PANE));
        newPaneMenu.add((IAction) actions.get(ActionID.NEW_ROW_ITERATOR_PANE));
        newPaneMenu.add((IAction) actions.get(ActionID.NEW_COLUMN_ITERATOR_PANE));
        newPaneMenu.add((IAction) actions.get(ActionID.NEW_DISSECTING_PANE));

        // Build the New Iterator sub-menu
        SubMenuAction newIteratorMenu =
                (SubMenuAction) actions.get(ActionID.NEW_ITERATOR_MENU);

        newMenu.add(newIteratorMenu);

        newIteratorMenu.add((IAction) actions.get(ActionID.NEW_SPATIAL_ITERATOR));
        newIteratorMenu.add((IAction) actions.get(ActionID.NEW_TEMPORAL_ITERATOR));

        // Build the New Grid sub-menu
        SubMenuAction newGridMenu =
                (SubMenuAction) actions.get(ActionID.NEW_GRID_MENU);

        newMenu.add(newGridMenu);

        newGridMenu.add((IAction) actions.get(ActionID.NEW_2_COLUMN_GRID));
        newGridMenu.add((IAction) actions.get(ActionID.NEW_3_ROW_GRID));
        newGridMenu.add((IAction) actions.get(ActionID.NEW_N_BY_M_GRID));

        // Complete the New sub-menu
        newMenu.add((IAction) actions.get(ActionID.NEW_FRAGMENT));
        newMenu.add((IAction) actions.get(ActionID.NEW_FORM));
        newMenu.add((IAction) actions.get(ActionID.NEW_REGION));
        newMenu.add((IAction) actions.get(ActionID.NEW_REPLICA));
        newMenu.add((IAction) actions.get(ActionID.NEW_FORM_FRAGMENT));

        // Build the Wrap sub-menu
        SubMenuAction wrapMenu =
                (SubMenuAction) actions.get(ActionID.CANVAS_WRAP_MENU);

        // Build the Wrap Iterator sub-menu
        SubMenuAction wrapIteratorMenu =
                (SubMenuAction) actions.get(ActionID.WRAP_ITERATOR_MENU);

        wrapMenu.add(wrapIteratorMenu);

        wrapIteratorMenu.add((IAction) actions.get(ActionID.WRAP_SPATIAL_ITERATOR));
        wrapIteratorMenu.add((IAction) actions.get(ActionID.WRAP_TEMPORAL_ITERATOR));

        // Complete the Wrap sub-menu
        wrapMenu.add((IAction) actions.get(ActionID.WRAP_N_BY_M_GRID));
        wrapMenu.add((IAction) actions.get(ActionID.WRAP_FRAGMENT));
        wrapMenu.add((IAction) actions.get(ActionID.WRAP_FORM));
View Full Code Here

     * Populates the montage-specific sub-menu actions with the appropriate
     * actions.
     */
    protected static void populateMontageSubMenuActions(Map actions) {
        // Build the New sub-menu
        SubMenuAction newMenu =
                (SubMenuAction) actions.get(ActionID.MONTAGE_NEW_MENU);

        // Build the New Grid sub-menu
        SubMenuAction newGridMenu =
                (SubMenuAction) actions.get(ActionID.NEW_SEGMENT_GRID_MENU);

        newMenu.add(newGridMenu);

        newGridMenu.add((IAction) actions.get(ActionID.NEW_2_COLUMN_SEGMENT_GRID));
        newGridMenu.add((IAction) actions.get(ActionID.NEW_3_ROW_SEGMENT_GRID));
        newGridMenu.add((IAction) actions.get(ActionID.NEW_N_BY_M_SEGMENT_GRID));

        // Complete the New sub-menu
        newMenu.add((IAction) actions.get(ActionID.NEW_SEGMENT));

        // Build the Wrap sub-menu
        SubMenuAction wrapMenu =
                (SubMenuAction) actions.get(ActionID.MONTAGE_WRAP_MENU);

        // Complete the Wrap sub-menu
        wrapMenu.add((IAction) actions.get(ActionID.WRAP_N_BY_M_SEGMENT_GRID));
    }
View Full Code Here

     * Populates the undefined device layout-specific sub-menu actions with the
     * appropriate actions.
     */
    protected static void populateUndefinedSubMenuActions(Map actions) {
        // Build the New sub-menu
        SubMenuAction newMenu =
                (SubMenuAction) actions.get(ActionID.UNDEFINED_NEW_MENU);

        newMenu.add(new ODOMAction(new DefaultActionCommand(),
                BUNDLE,
                "dummy")); //$NON-NLS-1$

        // Build the Wrap sub-menu
        SubMenuAction wrapMenu =
                (SubMenuAction) actions.get(ActionID.UNDEFINED_WRAP_MENU);

        wrapMenu.add(new ODOMAction(new DefaultActionCommand(),
                BUNDLE,
                "dummy")); //$NON-NLS-1$
    }
View Full Code Here

        final Map actions = new HashMap();
        final ODOMSelectionManager manager = context.
                getODOMSelectionManager();

        actions.put(ActionID.CANVAS_NEW_MENU,
                new SubMenuAction(
                        new NewMenuActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.CANVAS_NEW_MENU.getPrefix()));
        actions.put(ActionID.NEW_PANE_MENU,
                new SubMenuAction(
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.NEW_PANE_MENU.getPrefix()));
        actions.put(ActionID.NEW_PANE,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.PANE,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_PANE.getPrefix()));
        actions.put(ActionID.NEW_ROW_ITERATOR_PANE,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.ROW_ITERATOR_PANE,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_ROW_ITERATOR_PANE.getPrefix()));
        actions.put(ActionID.NEW_COLUMN_ITERATOR_PANE,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.COLUMN_ITERATOR_PANE,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_COLUMN_ITERATOR_PANE.getPrefix()));
        actions.put(ActionID.NEW_DISSECTING_PANE,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.DISSECTING_PANE,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_DISSECTING_PANE.getPrefix()));
        actions.put(ActionID.NEW_ITERATOR_MENU,
                new SubMenuAction(
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.NEW_ITERATOR_MENU.getPrefix()));
        actions.put(ActionID.NEW_SPATIAL_ITERATOR,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.SPATIAL_FORMAT_ITERATOR,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_SPATIAL_ITERATOR.getPrefix()));
        actions.put(ActionID.NEW_TEMPORAL_ITERATOR,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.TEMPORAL_FORMAT_ITERATOR,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_TEMPORAL_ITERATOR.getPrefix()));
        actions.put(ActionID.NEW_GRID_MENU,
                new SubMenuAction(
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.NEW_GRID_MENU.getPrefix()));
        actions.put(ActionID.NEW_2_COLUMN_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(FormatType.GRID,
                                manager) {
                            protected Dimension getGridDimensions() {
                                return new Dimension(2, 1);
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_2_COLUMN_GRID.getPrefix()));
        actions.put(ActionID.NEW_3_ROW_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(FormatType.GRID,
                                manager) {
                            protected Dimension getGridDimensions() {
                                return new Dimension(1, 3);
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_3_ROW_GRID.getPrefix()));
        actions.put(ActionID.NEW_N_BY_M_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(FormatType.GRID,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_N_BY_M_GRID.getPrefix()));
        actions.put(ActionID.NEW_FRAGMENT,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.FRAGMENT, manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_FRAGMENT.getPrefix()));
        actions.put(ActionID.NEW_FORM,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.FORM,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_FORM.getPrefix()));
        actions.put(ActionID.NEW_REGION,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.REGION,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_REGION.getPrefix()));
        actions.put(ActionID.NEW_REPLICA,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.REPLICA,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_REPLICA.getPrefix()));
        actions.put(ActionID.NEW_FORM_FRAGMENT,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.FORM_FRAGMENT,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_FORM_FRAGMENT.getPrefix()));

        actions.put(ActionID.MONTAGE_NEW_MENU,
                new SubMenuAction(
                        new NewMenuActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.MONTAGE_NEW_MENU.getPrefix()));
        actions.put(ActionID.NEW_SEGMENT_GRID_MENU,
                new SubMenuAction(
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.NEW_SEGMENT_GRID_MENU.getPrefix()));
        actions.put(ActionID.NEW_2_COLUMN_SEGMENT_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(
                                FormatType.SEGMENT_GRID,
                                manager) {
                            protected Dimension getGridDimensions() {
                                return new Dimension(2, 1);
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_2_COLUMN_SEGMENT_GRID.getPrefix()));
        actions.put(ActionID.NEW_3_ROW_SEGMENT_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(
                                FormatType.SEGMENT_GRID,
                                manager) {
                            protected Dimension getGridDimensions() {
                                return new Dimension(1, 3);
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_3_ROW_SEGMENT_GRID.getPrefix()));
        actions.put(ActionID.NEW_N_BY_M_SEGMENT_GRID,
                new ODOMAction(
                        new NewGridFormatActionCommand(
                                FormatType.SEGMENT_GRID,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_N_BY_M_SEGMENT_GRID.getPrefix()));
        actions.put(ActionID.NEW_SEGMENT,
                new ODOMAction(
                        new NewNonGridFormatActionCommand(
                                FormatType.SEGMENT,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.NEW_SEGMENT.getPrefix()));

        actions.put(ActionID.UNDEFINED_NEW_MENU,
                new SubMenuAction(
                        new DefaultActionCommand() {
                            // javadoc inherited
                            public boolean enable(ODOMActionDetails context) {
                                return false;
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.UNDEFINED_NEW_MENU.getPrefix()));

        actions.put(ActionID.CANVAS_WRAP_MENU,
                new SubMenuAction(
                        new WrapMenuActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.CANVAS_WRAP_MENU.getPrefix()));
        actions.put(ActionID.WRAP_ITERATOR_MENU,
                new SubMenuAction(
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_ITERATOR_MENU.getPrefix()));
        actions.put(ActionID.WRAP_SPATIAL_ITERATOR,
                new ODOMAction(
                        new WrapNonGridFormatActionCommand(
                                FormatType.SPATIAL_FORMAT_ITERATOR,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_SPATIAL_ITERATOR.getPrefix()));
        actions.put(ActionID.WRAP_TEMPORAL_ITERATOR,
                new ODOMAction(
                        new WrapNonGridFormatActionCommand(
                                FormatType.TEMPORAL_FORMAT_ITERATOR,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_TEMPORAL_ITERATOR.getPrefix()));
        actions.put(ActionID.WRAP_N_BY_M_GRID,
                new ODOMAction(
                        new WrapGridFormatActionCommand(FormatType.GRID,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_N_BY_M_GRID.getPrefix()));
        actions.put(ActionID.WRAP_FRAGMENT,
                new ODOMAction(
                        new WrapNonGridFormatActionCommand(
                                FormatType.FRAGMENT, manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_FRAGMENT.getPrefix()));
        actions.put(ActionID.WRAP_FORM,
                new ODOMAction(
                        new WrapNonGridFormatActionCommand(
                                FormatType.FORM,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_FORM.getPrefix()));
        actions.put(ActionID.WRAP_FORM_FRAGMENT,
                new ODOMAction(
                        new WrapNonGridFormatActionCommand(
                                FormatType.FORM_FRAGMENT,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_FORM_FRAGMENT.getPrefix()));

        actions.put(ActionID.MONTAGE_WRAP_MENU,
                new SubMenuAction(
                        new WrapMenuActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.MONTAGE_WRAP_MENU.getPrefix()));
        actions.put(ActionID.WRAP_N_BY_M_SEGMENT_GRID,
                new ODOMAction(
                        new WrapGridFormatActionCommand(
                                FormatType.SEGMENT_GRID,
                                manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.WRAP_N_BY_M_SEGMENT_GRID.getPrefix()));

        actions.put(ActionID.UNDEFINED_WRAP_MENU,
                new SubMenuAction(
                        new DefaultActionCommand() {
                            // javadoc inherited
                            public boolean enable(ODOMActionDetails context) {
                                return false;
                            }
                        },
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.UNDEFINED_WRAP_MENU.getPrefix()));

        actions.put(ActionID.CUT,
                new ODOMAction(
                        new CutActionCommand(
                                EclipseCommonPlugin.getClipboard(
                                        Display.getDefault()), manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.CUT.getPrefix()));
        actions.put(ActionID.COPY,
                new ODOMAction(
                        new CopyActionCommand(
                                EclipseCommonPlugin.getClipboard(
                                        Display.getDefault()), manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.COPY.getPrefix()));
        actions.put(ActionID.PASTE,
                new ODOMAction(
                        new PasteActionCommand(
                                EclipseCommonPlugin.getClipboard(
                                        Display.getDefault()),
                                context),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.PASTE.getPrefix()));
        actions.put(ActionID.DELETE,
                new ODOMAction(
                        new DeleteActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.DELETE.getPrefix()));
        actions.put(ActionID.REPLACE,
                new ODOMAction(
                        new ReplaceActionCommand(
                                EclipseCommonPlugin.getClipboard(
                                        Display.getDefault()),
                                context),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.REPLACE.getPrefix()));
        actions.put(ActionID.SWAP,
                new ODOMAction(new SwapActionCommand(manager),
                        context,
                        null,
                        LayoutActions.BUNDLE,
                        ActionID.SWAP.getPrefix()));
        actions.put(ActionID.GRID_MODIFY_MENU,
                new SubMenuAction(
                        // @todo later implement: placeholder only
                        new DefaultActionCommand(),
                        LayoutActions.BUNDLE,
                        ActionID.GRID_MODIFY_MENU.getPrefix()));
        actions.put(ActionID.INSERT_ROWS,
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.ab.actions.SubMenuAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.