Package com.intellij.openapi.projectRoots

Examples of com.intellij.openapi.projectRoots.ProjectJdkTable


        return sdkType == HaskellSdkType.INSTANCE;
    }

    @Override
    public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
        ProjectJdkTable table = ProjectJdkTable.getInstance();
        Sdk[] sdks = table.getAllJdks();
        Sdk ghc = null;
        for (Sdk sdk : sdks) {
            if (sdk.getSdkType().equals(HaskellSdkType.INSTANCE)) {
                ghc = sdk;
                break;
View Full Code Here


                    }

                    Sdk existingSdk = ProjectJdkTable.getInstance().findJdk(goSdkType.getSdkLongName());

                    if (existingSdk == null) {
                        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();

                        String newSdkName = SdkConfigurationUtil.createUniqueSdkName(goSdkType, sdkData.GO_GOROOT_PATH, Arrays.asList(jdkTable.getAllJdks()));
                        ProjectJdkImpl goSdk = new ProjectJdkImpl(newSdkName, goSdkType);

                        goSdk.setHomePath(goRootPath);

                        goSdkType.setupSdkPaths(goSdk);
                        jdkTable.addJdk(goSdk);

                        ProjectRootManager.getInstance(project).setProjectSdk(goSdk);
                    } else {
                        ProjectRootManager.getInstance(project).setProjectSdk(existingSdk);
                    }
View Full Code Here

                    }

                    Sdk existingSdk = ProjectJdkTable.getInstance().findJdk(gaeSdkType.getSdkLongName());

                    if (existingSdk == null) {
                        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();

                        String newSdkName = SdkConfigurationUtil.createUniqueSdkName(gaeSdkType, sdkData.SDK_HOME_PATH, Arrays.asList(jdkTable.getAllJdks()));
                        ProjectJdkImpl goSdk = new ProjectJdkImpl(newSdkName, gaeSdkType);

                        goSdk.setHomePath(goRootPath);

                        gaeSdkType.setupSdkPaths(goSdk);
                        jdkTable.addJdk(goSdk);

                        ProjectRootManager.getInstance(project).setProjectSdk(goSdk);
                    } else {
                        ProjectRootManager.getInstance(project).setProjectSdk(existingSdk);
                    }
View Full Code Here

        super.projectClosed();
    }

    @Override
    public void initComponent() {
        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
        List<Sdk> sdkList = new ArrayList<Sdk>();

        sdkList.addAll(GoSdkUtil.getSdkOfType(GoSdkType.getInstance(), jdkTable));

        for (Sdk sdk : sdkList) {
View Full Code Here

    private static final Logger LOG = Logger.getInstance("#ro.redeul.google.go.components.GoBundledSdkDetector");

    @Override
    public void initComponent() {
        final ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();

        List<Sdk> goSdks = GoSdkUtil.getSdkOfType(GoSdkType.getInstance());

        String homePath = PathManager.getHomePath() + "/bundled/go-sdk";

        File bundledGoSdkHomePath = new File(homePath);
        if ( ! bundledGoSdkHomePath.exists() || ! bundledGoSdkHomePath.isDirectory() ) {
            return;
        }

        LOG.debug("Bundled Go SDK path exists: " + homePath);

        for (Sdk sdk : goSdks) {
            if (sdk.getHomePath() == null) {
                continue;
            }

            if ( homePath.startsWith(sdk.getHomePath()) ) {
                LOG.debug("Bundled Go SDK at registered already with name: " + sdk.getName());
                return;
            }
        }

        // validate the sdk
        GoSdkData sdkData = GoSdkUtil.testGoogleGoSdk(homePath);

        if ( sdkData == null ) {
            // skip since the folder isn't a proper go sdk
            return;
        }

        LOG.info("We have a bundled go sdk (at " + homePath + ") that is not in the jdk table. Attempting to add");
        try {
            final ProjectJdkImpl bundledGoSdk;
            final GoSdkType goSdkType = GoSdkType.getInstance();

            goSdkType.setSdkData(sdkData);
            String newSdkName = SdkConfigurationUtil.createUniqueSdkName(goSdkType, sdkData.GO_GOROOT_PATH, Arrays.asList(jdkTable.getAllJdks()));
            bundledGoSdk = new ProjectJdkImpl(newSdkName, goSdkType);
            bundledGoSdk.setHomePath(homePath);
            ApplicationManager.getApplication().runWriteAction(new Runnable() {
                @Override
                public void run() {
                    goSdkType.setupSdkPaths(bundledGoSdk);
                    jdkTable.addJdk(bundledGoSdk);
                }
            });

        } catch (Exception e) {
            LOG.error("Exception while adding the bundled sdk", e);
View Full Code Here

        }

        ProjectFileIndex projectFileIndex =
            ProjectRootManager.getInstance(project).getFileIndex();

        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
        List<Sdk> sdkList = new ArrayList<Sdk>();


        sdkList.addAll(GoSdkUtil.getSdkOfType(GoSdkType.getInstance(), jdkTable));
        sdkList.addAll(GoSdkUtil.getSdkOfType(GoAppEngineSdkType.getInstance(), jdkTable));
View Full Code Here

    public void setPaths(String goRoot, String goAppEngineRoot, String goPath) {
        bean.GO_GOROOT = goRoot;
        bean.GO_GOAPPENGINEROOT = goAppEngineRoot;
        bean.GO_GOPATH = goPath;

        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
        List<Sdk> sdkList = new ArrayList<Sdk>();

        if (!goRoot.equals("")) {
            sdkList.addAll(GoSdkUtil.getSdkOfType(GoSdkType.getInstance(), jdkTable));
            for (Sdk sdk : sdkList) {
View Full Code Here

        populateFromSDKs();
    }

    private void populateFromSDKs() {
        ProjectJdkTable jdkTable = ProjectJdkTable.getInstance();
        List<Sdk> sdkList = new ArrayList<Sdk>();
        sdkList.addAll(GoSdkUtil.getSdkOfType(GoSdkType.getInstance(), jdkTable));
        sdkList.addAll(GoSdkUtil.getSdkOfType(GoAppEngineSdkType.getInstance(), jdkTable));

        if (sdkList.size() == 0) {
View Full Code Here

TOP

Related Classes of com.intellij.openapi.projectRoots.ProjectJdkTable

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.