當前位置: 首頁>>代碼示例>>Java>>正文


Java ProjectComponent類代碼示例

本文整理匯總了Java中com.intellij.openapi.components.ProjectComponent的典型用法代碼示例。如果您正苦於以下問題:Java ProjectComponent類的具體用法?Java ProjectComponent怎麽用?Java ProjectComponent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ProjectComponent類屬於com.intellij.openapi.components包,在下文中一共展示了ProjectComponent類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: tearDown

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@After
public void tearDown() throws Exception {
  UIUtil.invokeAndWaitIfNeeded(new Runnable() {
    @Override
    public void run() {
      try {
        myVcsManager.unregisterVcs(myVcs);
        myVcsManager = null;
        myVcs = null;

        ((ProjectComponent)myChangeListManager).projectClosed();
        ((ProjectComponent)myVcsDirtyScopeManager).projectClosed();

        tearDownProject();
        if (myTempDirFixture != null) {
          myTempDirFixture.tearDown();
          myTempDirFixture = null;
        }
        FileUtil.delete(myClientRoot);
      }
      catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
  });
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:27,代碼來源:IgnoredFilesTest.java

示例2: projectOpened

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
public void projectOpened() {
  final ProjectComponent[] components = getComponents(ProjectComponent.class);
  for (ProjectComponent component : components) {
    try {
      component.projectOpened();
    }
    catch (Throwable e) {
      LOG.error(component.toString(), e);
    }
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:MockProject.java

示例3: updateJavaParameters

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@Override
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    settings.setLastPort(NetUtils.tryToFindAvailableSocketPort());
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(PaletteGroup.class));        // openapi
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:41,代碼來源:SnapShooterConfigurationExtension.java

示例4: startChangeProvider

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
protected void startChangeProvider() {
  ((StartupManagerImpl) StartupManager.getInstance(myProject)).runPostStartupActivities();
  myChangeListManager = ChangeListManager.getInstance(myProject);
  ((ProjectComponent) myChangeListManager).projectOpened();
  myDirtyScopeManager = VcsDirtyScopeManager.getInstance(myProject);
  ((ProjectComponent) myDirtyScopeManager).projectOpened();
  // mapping
  myVcsManager = ProjectLevelVcsManager.getInstance(myProject);
  myVcsManager.setDirectoryMappings(Collections.singletonList(new VcsDirectoryMapping(myBaseVf.getPath(), FossilVcs.NAME)));
}
 
開發者ID:irengrig,項目名稱:fossil4idea,代碼行數:11,代碼來源:BaseFossilTest.java

示例5: tearDownProject

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
protected void tearDownProject() throws Exception {
  if (myProject != null) {
    ((ProjectComponent) VcsDirtyScopeManager.getInstance(myProject)).projectClosed();
    ((ProjectComponent) ChangeListManager.getInstance(myProject)).projectClosed();
    ((ChangeListManagerImpl)ChangeListManager.getInstance(myProject)).stopEveryThingIfInTestMode();
    ((ProjectComponent)ProjectLevelVcsManager.getInstance(myProject)).projectClosed();
    myProject = null;
  }
  if (myProjectFixture != null) {
    myProjectFixture.tearDown();
    myProjectFixture = null;
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:14,代碼來源:AbstractVcsTestCase.java

示例6: projectOpened

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
private void projectOpened() {
  final ProjectComponent[] components = getComponents(ProjectComponent.class);
  for (ProjectComponent component : components) {
    try {
      component.projectOpened();
    }
    catch (Throwable e) {
      LOG.error(component.toString(), e);
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:12,代碼來源:ProjectImpl.java

示例7: projectClosed

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
private void projectClosed() {
  List<ProjectComponent> components = new ArrayList<ProjectComponent>(Arrays.asList(getComponents(ProjectComponent.class)));
  Collections.reverse(components);
  for (ProjectComponent component : components) {
    try {
      component.projectClosed();
    }
    catch (Throwable e) {
      LOG.error(e);
    }
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:13,代碼來源:ProjectImpl.java

示例8: tearDown

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@Override
protected void tearDown() throws Exception {
  removeLibs();
  ((ProjectComponent)ModuleManager.getInstance(myProject)).projectClosed();
  super.tearDown();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:7,代碼來源:OrderEntryTest.java

示例9: updateJavaParameters

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@Override
public void updateJavaParameters(RunConfigurationBase configuration, JavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    try {
      settings.setLastPort(NetUtils.findAvailableSocketPort());
    }
    catch(IOException ex) {
      settings.setLastPort(-1);
    }
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:45,代碼來源:SnapShooterConfigurationExtension.java

示例10: setUp

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@Before
@Order(0)
public void setUp() throws Throwable {
  PlatformTestCase.initPlatformLangPrefix();
  IdeaTestApplication.getInstance(null);

  String tempFileName = getClass().getName() + "-" + new Random().nextInt();
  myProjectFixture = IdeaTestFixtureFactory.getFixtureFactory().createFixtureBuilder(tempFileName).getFixture();

  edt(new ThrowableRunnable<Exception>() {
    @Override
    public void run() throws Exception {
      myProjectFixture.setUp();
    }
  });

  myProject = myProjectFixture.getProject();

  ((ProjectComponent)ChangeListManager.getInstance(myProject)).projectOpened();
  ((ProjectComponent)VcsDirtyScopeManager.getInstance(myProject)).projectOpened();

  myProjectRoot = myProject.getBasePath();
  myProjectDir = myProject.getBaseDir();
  myTestRoot = myProjectRoot;

  myPlatformFacade = ServiceManager.getService(myProject, GitPlatformFacade.class);
  myGit = ServiceManager.getService(myProject, Git.class);
  mySettings = myPlatformFacade.getSettings(myProject);
  mySettings.getAppSettings().setPathToGit(GitExecutor.GIT_EXECUTABLE);

  // dynamic overriding is used instead of making it in plugin.xml,
  // because MockVcsHelper is not ready to be a full featured implementation for all tests.
  myVcsHelper = overrideService(myProject, AbstractVcsHelper.class, MockVcsHelper.class);
  myChangeListManager = (ChangeListManagerImpl)myPlatformFacade.getChangeListManager(myProject);
  myNotificator = (TestNotificator)ServiceManager.getService(myProject, Notificator.class);
  myVcs = GitVcs.getInstance(myProject);

  virtualCommits = new GitTestVirtualCommitsHolder();
  myAsyncTasks = new ArrayList<Future>();

  cd(myProjectRoot);
  myRepository = GitTestUtil.createRepository(myProject, myProjectRoot);

  ProjectLevelVcsManagerImpl vcsManager = (ProjectLevelVcsManagerImpl)ProjectLevelVcsManager.getInstance(myProject);
  AbstractVcs vcs = vcsManager.findVcsByName("Git");
  Assert.assertEquals(1, vcsManager.getRootsUnderVcs(vcs).length);

  assumeSupportedGitVersion();
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:50,代碼來源:GitCucumberWorld.java

示例11: updateJavaParameters

import com.intellij.openapi.components.ProjectComponent; //導入依賴的package包/類
@Override
public void updateJavaParameters(RunConfigurationBase configuration, OwnJavaParameters params, RunnerSettings runnerSettings) {
  if (!isApplicableFor(configuration)) {
    return;
  }
  ApplicationConfiguration appConfiguration = (ApplicationConfiguration) configuration;
  SnapShooterConfigurationSettings settings = appConfiguration.getUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY);
  if (settings == null) {
    settings = new SnapShooterConfigurationSettings();
    appConfiguration.putUserData(SnapShooterConfigurationSettings.SNAP_SHOOTER_KEY, settings);
  }
  if (appConfiguration.ENABLE_SWING_INSPECTOR) {
    try {
      settings.setLastPort(NetUtils.findAvailableSocketPort());
    }
    catch(IOException ex) {
      settings.setLastPort(-1);
    }
  }

  if (appConfiguration.ENABLE_SWING_INSPECTOR && settings.getLastPort() != -1) {
    params.getProgramParametersList().prepend(appConfiguration.MAIN_CLASS_NAME);
    params.getProgramParametersList().prepend(Integer.toString(settings.getLastPort()));
    // add +1 because idea_rt.jar will be added as the last entry to the classpath
    params.getProgramParametersList().prepend(Integer.toString(params.getClassPath().getPathList().size() + 1));
    Set<String> paths = new TreeSet<String>();
    paths.add(PathUtil.getJarPathForClass(SnapShooter.class));         // ui-designer-impl
    paths.add(PathUtil.getJarPathForClass(BaseComponent.class));       // appcore-api
    paths.add(PathUtil.getJarPathForClass(ProjectComponent.class));    // openapi
    paths.add(PathUtil.getJarPathForClass(LwComponent.class));         // UIDesignerCore
    paths.add(PathUtil.getJarPathForClass(GridConstraints.class));     // forms_rt
    paths.add(PathUtil.getJarPathForClass(LafManagerListener.class));  // ui-impl
    paths.add(PathUtil.getJarPathForClass(DataProvider.class));        // action-system-openapi
    paths.add(PathUtil.getJarPathForClass(XmlStringUtil.class));       // idea
    paths.add(PathUtil.getJarPathForClass(Navigatable.class));         // pom
    paths.add(PathUtil.getJarPathForClass(AreaInstance.class));        // extensions
    paths.add(PathUtil.getJarPathForClass(FormLayout.class));          // jgoodies
    paths.addAll(PathManager.getUtilClassPath());
    for(String path: paths) {
      params.getClassPath().addFirst(path);
    }
    params.setMainClass("com.intellij.uiDesigner.snapShooter.SnapShooter");
  }
}
 
開發者ID:consulo,項目名稱:consulo-ui-designer,代碼行數:45,代碼來源:SnapShooterConfigurationExtension.java


注:本文中的com.intellij.openapi.components.ProjectComponent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。