class CopyOrMoveToWorkspace extends BasicItem implements NodesManipulator {

    @Override
    public void execute() {
    }

    @Override
    public void setup(Node[] nodes, Node clickedNode) {
        this.nodes = nodes;
    }

    @Override
    public ContextMenuItemManipulator[] getSubItems() {<FILL_FUNCTION_BODY>}

    @Override
    public boolean canExecute() {
        return nodes.length > 0;
    }

    @Override
    public int getType() {
        return 200;
    }

    @Override
    public Icon getIcon() {
        return null;
    }

    protected abstract boolean isCopy();
}

        if (nodes != null) {
            int i = 0;
            ArrayList<GraphContextMenuItem> subItems = new ArrayList<>();
            if (canExecute()) {
                subItems.add(new CopyOrMoveToWorkspaceSubItem(null, true, 0, 0, isCopy()));//New workspace
                ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
                for (final Workspace w : projectController.getCurrentProject().getLookup()
                    .lookup(WorkspaceProvider.class).getWorkspaces()) {
                    GraphContextMenuItem item =
                        new CopyOrMoveToWorkspaceSubItem(w, w != projectController.getCurrentWorkspace(), 1, i,
                            isCopy());
                    subItems.add(item);
                    i++;
                }
                return subItems.toArray(new ContextMenuItemManipulator[0]);
            } else {
                return null;
            }
        } else {
            return null;
        }
    
<methods>public non-sealed void <init>() ,public java.lang.String getDescription() ,public java.lang.Integer getMnemonicKey() ,public org.gephi.datalab.spi.ContextMenuItemManipulator[] getSubItems() ,public org.gephi.datalab.spi.ManipulatorUI getUI() ,public boolean isAvailable() ,public void setup(Node[], Node) ,public void setup(Graph, Node[]) <variables>protected Graph graph,protected Node[] nodes