com.intellij.openapi.components.ProjectComponent Java Examples

The following examples show how to use com.intellij.openapi.components.ProjectComponent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractVcsTestCase.java    From consulo with Apache License 2.0 5 votes vote down vote up
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;
  }
}
 
Example #2
Source File: ProjectImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
protected void notifyAboutInitialization(float percentOfLoad, Object component) {
  ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
  if (indicator != null) {
    indicator.setText2(getComponentName(component));
  }

  if (component instanceof ProjectComponent) {
    myProjectComponents.add((ProjectComponent)component);
  }
}
 
Example #3
Source File: ProjectImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void projectOpened() {
  for (ProjectComponent component : myProjectComponents) {
    try {
      component.projectOpened();
    }
    catch (Throwable e) {
      LOG.error(component.toString(), e);
    }
  }
}
 
Example #4
Source File: ProjectImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void projectClosed() {
  List<ProjectComponent> components = new ArrayList<>(myProjectComponents);
  Collections.reverse(components);
  for (ProjectComponent component : components) {
    try {
      component.projectClosed();
    }
    catch (Throwable e) {
      LOG.error(e);
    }
  }
}
 
Example #5
Source File: IdeaLightweightExtension.java    From p4ic4idea with Apache License 2.0 4 votes vote down vote up
public void registerProjectComponent(@NotNull String name, @NotNull ProjectComponent component) {
    when(getMockProject().getComponent(name)).thenReturn(component);
}