Package floobits.impl

Examples of floobits.impl.ContextImpl


            return null;
        }
        return project.getComponent(FloobitsPlugin.class);
    }
    public FloobitsPlugin(Project project) {
        context = new ContextImpl(project);
        Flog.info("Floobits plugin");
    }
View Full Code Here


                Project projectForPath = getProject(location);
                if (projectForPath == null) {
                    Flog.errorMessage("The editor could not open the project :(", null);
                    return;
                }
                final ContextImpl context = FloobitsPlugin.getInstance(projectForPath).context;
                context.writeThread(new Runnable() {
                    @Override
                    public void run() {
                        context.project.save();
                        Window window = WindowManager.getInstance().suggestParentWindow(context.project);
                        if (window != null) {
                            window.toFront();
                        }
                        context.joinWorkspace(f, location, false);
                    }
                });
            }
        });
View Full Code Here

                return;
            }
            context = FloobitsPlugin.getInstance(projectForPath).context;
        }
        // not gonna work here
        final ContextImpl finalContext = context;
        context.writeThread(new Runnable() {
            @Override
            public void run() {
                Window window = WindowManager.getInstance().suggestParentWindow(finalContext.project);
                if (window != null) {
                    window.toFront();
                }
                finalContext.joinWorkspace(flooUrl, location, false);
            }
        });
    }
View Full Code Here

        final VirtualFile[] virtualFiles = PlatformDataKeys.VIRTUAL_FILE_ARRAY.getData(e.getDataContext());

        if (virtualFiles == null) {
            return;
        }
        ContextImpl context = FloobitsPlugin.getInstance(e.getProject()).context;
        for (final VirtualFile virtualFile : virtualFiles) {
            FileImpl fileImpl = new FileImpl(virtualFile);
            if (filesToAdd.contains(fileImpl)) {
                continue;
            }
            if (!IntelliUtils.isSharable(virtualFile)) {
                context.statusMessage(String.format("Skipped adding %s because it is a special file.", virtualFile.getPath()));
                continue;
            }
            if (!context.isShared(virtualFile.getPath())) {
                context.statusMessage(String.format("Skipped adding %s because it is not in %s.", virtualFile.getPath(), context.colabDir));
                continue;
            }
            if (context.isIgnored(fileImpl)) {
                context.statusMessage(String.format("Skipped adding %s because it is ignored.", virtualFile.getPath()));
                continue;
            }

            ArrayList<IFile> allValidNestedFiles = IntelliUtils.getAllValidNestedFiles(context, virtualFile);
            filesToAdd.addAll(allValidNestedFiles);
        }
        // Let's show a status message when we're uploading lots because it can lag before we get create bufs back.
        if (filesToAdd.size() > 10 ) {
            context.statusMessage(String.format("Uploading %d files.", filesToAdd.size()));
        }
        for (IFile virtualFile : filesToAdd) {
            editorEventHandler.upload(virtualFile);
        }
    }
View Full Code Here

        String url = "https://floobits.com/";
        FloobitsPlugin floobitsPlugin = FloobitsPlugin.getInstance(e.getProject());
        if (floobitsPlugin == null) {
            return;
        }
        ContextImpl context = floobitsPlugin.context;
        FlooUrl floourl = DotFloo.read(context.project.getBasePath());
        if (floourl != null) {
            url = floourl.toString();
        }
        String inputValue = JOptionPane.showInputDialog("Workspace URL", url);
View Full Code Here

    @Override
    public void doCancelAction() {
        super.doCancelAction();
        IContext context;
        if (project == null) {
            context = new ContextImpl(null);
        } else {
            context = FloobitsPlugin.getInstance(project).context;
        }
        context.linkEditor();
    }
View Full Code Here

    @Override
    protected void doOKAction() {
        super.doOKAction();
        IContext context;
        if (project == null) {
            context = new ContextImpl(null);
        } else {
            context = FloobitsPlugin.getInstance(project).context;
        }
        context.createAccount();
    }
View Full Code Here

/**
* Created by kans on 2/18/14.
*/
public class OpenProjectInWorkspace extends CanFloobits {
    public void actionPerformed(AnActionEvent actionEvent) {
        ContextImpl context = FloobitsPlugin.getInstance(actionEvent.getProject()).context;
        FlooUrl flooUrl = DotFloo.read(context.project.getBasePath());
        if (flooUrl != null) {
            FloobitsApplication.self.joinWorkspace(context, flooUrl.toString());
            return;
        }

        String project_path = context.project.getBasePath();
        PersistentJson persistentJson = PersistentJson.getInstance();
        for (Map.Entry<String, Map<String, Workspace>> i : persistentJson.workspaces.entrySet()) {
            Map<String, Workspace> workspaces = i.getValue();
            for (Map.Entry<String, Workspace> j : workspaces.entrySet()) {
                Workspace w = j.getValue();
                if (Utils.isSamePath(w.path, project_path)) {
                    try {
                        flooUrl = new FlooUrl(w.url);
                    } catch (MalformedURLException e) {
                        Flog.warn(e);
                        continue;
                    }
                    FloobitsApplication.self.joinWorkspace(context, flooUrl.toString());
                    return;
                }
            }
        }
        context.errorMessage("This project doesn't seem to be associated with a Floobits workspace.");
    }
View Full Code Here

        final Editor editor = PlatformDataKeys.EDITOR.getData(e.getDataContext());
        if (editor == null) {
            return;
        }
        Document document = editor.getDocument();
        ContextImpl context = FloobitsPlugin.getInstance(e.getProject()).context;
        FactoryImpl iFactory = (FactoryImpl) context.iFactory;
        String path = iFactory.getPathForDoc(document);
        if (path == null) {
            return;
        }
View Full Code Here

    @Override
    protected void doOKAction() {
        super.doOKAction();
        if (project != null) {
            ContextImpl context = project.getComponent(FloobitsPlugin.class).context;
            FloobitsApplication.self.joinWorkspace(context, selectWorkspace.getSelectedItem());
            return;
        }
        FloobitsApplication.self.joinWorkspace(null, selectWorkspace.getSelectedItem());
View Full Code Here

TOP

Related Classes of floobits.impl.ContextImpl

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.