Package com.intellij.openapi.projectRoots

Examples of com.intellij.openapi.projectRoots.SdkModificator


    public void apply() {
        String libPath = myForm.getLibPath();
        String cabalPath = myForm.getCabalPath();
        String ghcOptions = myForm.getGhcOptions();
        HaskellSdkAdditionalData newData = new HaskellSdkAdditionalData(libPath, cabalPath, ghcOptions);
        final SdkModificator modificator = mySdk.getSdkModificator();
        modificator.setSdkAdditionalData(newData);
        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            public void run() {
                modificator.commitChanges();
            }
        });
        myForm.setModified(false);
    }
View Full Code Here


    final HaxeSdkData newData = new HaxeSdkData(haxeSdkData.getHomePath(), haxeSdkData.getVersion());
    newData.setNekoBinPath(FileUtil.toSystemIndependentName(myHaxeAdditionalConfigurablePanel.getNekoBinPath()));
    newData.setHaxelibPath(FileUtil.toSystemIndependentName(myHaxeAdditionalConfigurablePanel.getHaxelibPath()));

    final SdkModificator modificator = mySdk.getSdkModificator();
    modificator.setSdkAdditionalData(newData);
    ApplicationManager.getApplication().runWriteAction(new Runnable() {
      public void run() {
        modificator.commitChanges();
      }
    });
  }
View Full Code Here

                model.setSdk(getSdk());

                // add go sdk to project root
                Sdk sdk = ProjectJdkTable.getInstance().createSdk("go Sdk", GoSdkType.getInstance());

                SdkModificator modificator = sdk.getSdkModificator();

                GoSdkData goSdkData = new GoSdkData();

                modificator.setHomePath("bau");
                modificator.setVersionString("1");
                modificator.setSdkAdditionalData(goSdkData);
                modificator.commitChanges();
            }
        };

    }
View Full Code Here

                        new Notification("Go SDK validator", "Corrupt Go SDK",
                                getContent("Go", sdk.getName()),
                                NotificationType.WARNING), myProject);
            }

            SdkModificator sdkModificator = sdk.getSdkModificator();
            sdkModificator.setSdkAdditionalData(data);
            sdkModificator.commitChanges();
        }

        sdkList.clear();
        sdkList.addAll(GoSdkUtil.getSdkOfType(GoAppEngineSdkType.getInstance(), jdkTable));

        for (Sdk sdk : sdkList) {
            GoAppEngineSdkData sdkData = (GoAppEngineSdkData) sdk.getSdkAdditionalData();

            if (sdkData == null || sdkData.TARGET_ARCH == null || sdkData.TARGET_OS == null) {
                Notifications.Bus.notify(
                        new Notification(
                                "Go AppEngine SDK validator",
                                "Corrupt Go App Engine SDK",
                                getContent("Go App Engine", sdk.getName()),
                                NotificationType.WARNING
                        ), myProject);

                continue;
            }

            boolean needsUpgrade = false;
            try {
                sdkData.checkValid();
            } catch (ConfigurationException ex) {
                needsUpgrade = true;
            }

            if (!needsUpgrade)
                continue;

            needsUpgrade = false;
            GoAppEngineSdkData data = GoSdkUtil.testGoAppEngineSdk(sdk.getHomePath());

            if (data == null)
                needsUpgrade = true;

            try {
                if (data != null) {
                    data.checkValid();
                }
            } catch (ConfigurationException ex) {
                needsUpgrade = true;
            }

            // GAE SDK auto-update needs a bit more love
            if (data != null && !(new File(data.GOAPP_BIN_PATH)).exists()) {
                needsUpgrade = true;
            }

            if (needsUpgrade) {
                Notifications.Bus.notify(
                        new Notification(
                                "Go AppEngine SDK validator",
                                "Corrupt Go App Engine SDK",
                                getContent("Go AppEngine", sdk.getName()),
                                NotificationType.WARNING), myProject);
            }

            SdkModificator sdkModificator = sdk.getSdkModificator();
            sdkModificator.setSdkAdditionalData(data);
            sdkModificator.commitChanges();
        }

        PluginDescriptor pluginDescriptor = PluginManager.getPlugin(PluginId.getId("ro.redeul.google.go"));
        if (pluginDescriptor != null) {
            String version = ((IdeaPluginDescriptorImpl) pluginDescriptor).getVersion();
View Full Code Here

            }
        }
    }

    private void updateSDK(Sdk sdk, String goRoot, String goPath) {
        final SdkModificator sdkModificator = sdk.getSdkModificator();
        final VirtualFile finalGoRoot = StandardFileSystems.local().findFileByPath(goRoot + "/src/pkg");
        final VirtualFile finalGoPath = StandardFileSystems.local().findFileByPath(goPath + "/src");

        ApplicationManager.getApplication().runWriteAction(new Runnable() {
            public void run() {
                sdkModificator.removeRoots(OrderRootType.SOURCES);
                sdkModificator.removeRoots(OrderRootType.CLASSES);

                sdkModificator.addRoot(finalGoRoot, OrderRootType.SOURCES);
                sdkModificator.addRoot(finalGoRoot, OrderRootType.CLASSES);
                sdkModificator.addRoot(finalGoPath, OrderRootType.CLASSES);
            }
        });

        sdkModificator.commitChanges();

        if (GoSdkUtil.getSdkSourcesRoot(sdk) != null) {
            GoSdkUtil.getSdkSourcesRoot(sdk).refresh(false, false);
        }
    }
View Full Code Here

    return new DefaultLightProjectDescriptor() {
      @Override
      public Sdk getSdk() {
        Sdk mockSdk = ErlangSdkType.createMockSdk(ERLANG_SDK_PATH);
        // Set local SDK documentation path
        SdkModificator sdkModificator = mockSdk.getSdkModificator();
        VirtualFile localDocDir = LocalFileSystem.getInstance().findFileByPath(ERLANG_DOC_PATH);
        sdkModificator.addRoot(localDocDir, JavadocOrderRootType.getInstance());
        sdkModificator.commitChanges();
        return mockSdk;
      }
    };
  }
View Full Code Here

    return new DefaultLightProjectDescriptor() {
      @Override
      public Sdk getSdk() {
        Sdk mockSdk = ErlangSdkType.createMockSdk("testData/mockSdk-R15B02/");
        // Set local SDK documentation path
        SdkModificator sdkModificator = mockSdk.getSdkModificator();
        VirtualFile localDocDir = LocalFileSystem.getInstance().findFileByPath("testData/mockSdk-R15B02/");
        sdkModificator.addRoot(localDocDir, JavadocOrderRootType.getInstance());
        sdkModificator.commitChanges();
        return mockSdk;
      }
    };
  }
View Full Code Here

TOP

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

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.