Package org.openide.util.datatransfer

Examples of org.openide.util.datatransfer.PasteType


        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);

        if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
            try {
                final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        Query f = filterController.createQuery(fb.getFilter());
                        filterController.add(f);
                        return null;
                    }
                };
            } catch (UnsupportedFlavorException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        } else if (dropNode != null && dropNode instanceof SavedQueryNode) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    SavedQueryNode node = (SavedQueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    filterController.add(node.getQuery());
                    return null;
                }
            };
        } else if (dropNode != null && dropNode instanceof QueryNode && ((QueryNode) dropNode).getQuery().getParent() != null) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
View Full Code Here


        @Override
        public PasteType getDropType(Transferable t, int action, int index) {
            if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
                try {
                    final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                    return new PasteType() {

                        @Override
                        public Transferable paste() throws IOException {
                            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                            Query f = filterController.createQuery(fb.getFilter());
View Full Code Here

    public PasteType getDropType(final Transferable t, int action, int index) {
        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
        if (dropNode != null && dropNode instanceof QueryNode) {
            Query q = ((QueryNode) dropNode).getQuery();
            if (!Arrays.asList(q.getDescendantsAndSelf()).contains(parent)) { //Check if not parent
                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        QueryNode queryNode = (QueryNode) dropNode;
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        filterController.setSubQuery(parent, queryNode.getQuery());
                        return null;
                    }
                };
            }
        } else if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    try {
                        FilterBuilder builder = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
View Full Code Here

        if (category == null || !category.equals(FiltersExplorer.QUERIES)) {
            return null;
        }
        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
        if (dropNode != null && dropNode instanceof QueryNode) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
View Full Code Here

        if (category == null || !category.equals(FiltersExplorer.QUERIES)) {
            return null;
        }
        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
        if (dropNode != null && dropNode instanceof QueryNode) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
View Full Code Here

        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);

        if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
            try {
                final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        Query f = filterController.createQuery(fb.getFilter());
                        filterController.add(f);
                        return null;
                    }
                };
            } catch (UnsupportedFlavorException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        } else if (dropNode != null && dropNode instanceof SavedQueryNode) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    SavedQueryNode node = (SavedQueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                    filterController.add(node.getQuery());
                    return null;
                }
            };
        } else if (dropNode != null && dropNode instanceof QueryNode && ((QueryNode) dropNode).getQuery().getParent() != null) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    QueryNode queryNode = (QueryNode) dropNode;
                    FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
View Full Code Here

        @Override
        public PasteType getDropType(Transferable t, int action, int index) {
            if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
                try {
                    final FilterBuilder fb = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
                    return new PasteType() {

                        @Override
                        public Transferable paste() throws IOException {
                            FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                            Query f = filterController.createQuery(fb.getFilter());
View Full Code Here

    public PasteType getDropType(final Transferable t, int action, int index) {
        final Node dropNode = NodeTransfer.node(t, DnDConstants.ACTION_COPY_OR_MOVE);
        if (dropNode != null && dropNode instanceof QueryNode) {
            Query q = ((QueryNode) dropNode).getQuery();
            if (!Arrays.asList(q.getDescendantsAndSelf()).contains(parent)) { //Check if not parent
                return new PasteType() {

                    @Override
                    public Transferable paste() throws IOException {
                        QueryNode queryNode = (QueryNode) dropNode;
                        FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
                        filterController.setSubQuery(parent, queryNode.getQuery());
                        return null;
                    }
                };
            }
        } else if (t.isDataFlavorSupported(FilterBuilderNode.DATA_FLAVOR)) {
            return new PasteType() {

                @Override
                public Transferable paste() throws IOException {
                    try {
                        FilterBuilder builder = (FilterBuilder) t.getTransferData(FilterBuilderNode.DATA_FLAVOR);
View Full Code Here

TOP

Related Classes of org.openide.util.datatransfer.PasteType

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.