本文整理汇总了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);
}
}
});
}
示例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);
}
}
}
示例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");
}
}
示例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)));
}
示例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;
}
}
示例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);
}
}
}
示例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);
}
}
}
示例8: tearDown
import com.intellij.openapi.components.ProjectComponent; //导入依赖的package包/类
@Override
protected void tearDown() throws Exception {
removeLibs();
((ProjectComponent)ModuleManager.getInstance(myProject)).projectClosed();
super.tearDown();
}
示例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");
}
}
示例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();
}
示例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");
}
}