本文整理汇总了Java中com.intellij.openapi.components.BaseComponent类的典型用法代码示例。如果您正苦于以下问题:Java BaseComponent类的具体用法?Java BaseComponent怎么用?Java BaseComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseComponent类属于com.intellij.openapi.components包,在下文中一共展示了BaseComponent类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: registerComponentInstance
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
private void registerComponentInstance(@NotNull Object instance) {
myInstantiatedComponentCount++;
if (instance instanceof com.intellij.openapi.Disposable) {
Disposer.register(this, (com.intellij.openapi.Disposable)instance);
}
if (!(instance instanceof BaseComponent)) {
return;
}
BaseComponent baseComponent = (BaseComponent)instance;
String componentName = baseComponent.getComponentName();
if (myNameToComponent.containsKey(componentName)) {
BaseComponent loadedComponent = myNameToComponent.get(componentName);
// component may have been already loaded by PicoContainer, so fire error only if components are really different
if (!instance.equals(loadedComponent)) {
LOG.error("Component name collision: " + componentName + " " + loadedComponent.getClass() + " and " + instance.getClass());
}
}
else {
myNameToComponent.put(componentName, baseComponent);
}
myBaseComponents.add(baseComponent);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ComponentManagerImpl.java
示例2: getInstance
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Nullable
private AbstractVcs getInstance(@NotNull Project project, @NotNull String vcsClass) {
try {
final Class<? extends AbstractVcs> foundClass = findClass(vcsClass);
final Class<?>[] interfaces = foundClass.getInterfaces();
for (Class<?> anInterface : interfaces) {
if (BaseComponent.class.isAssignableFrom(anInterface)) {
return PeriodicalTasksCloser.getInstance().safeGetComponent(project, foundClass);
}
}
return instantiate(vcsClass, project.getPicoContainer());
}
catch (ProcessCanceledException pce) {
throw pce;
}
catch(Exception e) {
LOG.error(e);
return null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:VcsEP.java
示例3: getVcs
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
public AbstractVcs getVcs(Project project) {
if (myVcs == null) {
try {
final Class<? extends AbstractVcs> foundClass = findClass(vcsClass);
final Class<?>[] interfaces = foundClass.getInterfaces();
for (Class<?> anInterface : interfaces) {
if (BaseComponent.class.isAssignableFrom(anInterface)) {
myVcs = PeriodicalTasksCloser.getInstance().safeGetComponent(project, foundClass);
myVcs = VcsActiveEnvironmentsProxy.proxyVcs(myVcs);
return myVcs;
}
}
myVcs = VcsActiveEnvironmentsProxy.proxyVcs((AbstractVcs)instantiate(vcsClass, project.getPicoContainer()));
}
catch(Exception e) {
LOG.error(e);
return null;
}
}
return myVcs;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:VcsEP.java
示例4: getInstance
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Nullable
private AbstractVcs getInstance(@Nonnull Project project, @Nonnull String vcsClass) {
try {
final Class<? extends AbstractVcs> foundClass = findClass(vcsClass);
final Class<?>[] interfaces = foundClass.getInterfaces();
for (Class<?> anInterface : interfaces) {
if (BaseComponent.class.isAssignableFrom(anInterface)) {
return PeriodicalTasksCloser.getInstance().safeGetComponent(project, foundClass);
}
}
return instantiate(vcsClass, project.getPicoContainer());
}
catch (ProcessCanceledException pce) {
throw pce;
}
catch(Exception e) {
LOG.error(e);
return null;
}
}
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:VcsEP.java
示例5: updateJavaParameters
import com.intellij.openapi.components.BaseComponent; //导入依赖的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
示例6: ComponentType
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
ComponentType(Class<? extends BaseComponent> clazz, @NonNls String name,
@PropertyKey(resourceBundle = "org.jetbrains.idea.devkit.DevKitBundle") String propertyKey)
{
myPropertyKey = propertyKey;
myClassName = clazz.getName();
myName = name;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ComponentType.java
示例7: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(@NotNull String name) {
return null;
}
开发者ID:JFrogDev,项目名称:jfrog-idea-plugin,代码行数:5,代码来源:NpmProjectImpl.java
示例8: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(@NotNull String s) {
return null;
}
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:5,代码来源:ProjectMock.java
示例9: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(@NotNull String name) {
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:DummyProject.java
示例10: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public synchronized BaseComponent getComponent(@NotNull String name) {
return myNameToComponent.get(name);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ComponentManagerImpl.java
示例11: getComponentInstance
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public Object getComponentInstance(PicoContainer picoContainer) throws PicoInitializationException, PicoIntrospectionException, ProcessCanceledException {
Object instance = myInitializedComponentInstance;
if (instance != null) {
return instance;
}
try {
//noinspection SynchronizeOnThis
synchronized (this) {
instance = myInitializedComponentInstance;
if (instance != null) {
return instance;
}
long startTime = System.nanoTime();
instance = super.getComponentInstance(picoContainer);
if (myInitializing) {
String errorMessage = "Cyclic component initialization: " + getComponentKey();
if (myPluginId != null) {
LOG.error(new PluginException(errorMessage, myPluginId));
}
else {
LOG.error(new Throwable(errorMessage));
}
}
try {
myInitializing = true;
registerComponentInstance(instance);
ProgressIndicator indicator = getProgressIndicator();
if (indicator != null) {
indicator.checkCanceled();
setProgressDuringInit(indicator);
}
initializeComponent(instance, false);
if (instance instanceof BaseComponent) {
((BaseComponent)instance).initComponent();
}
long ms = (System.nanoTime() - startTime) / 1000000;
if (ms > 10 && logSlowComponents()) {
LOG.info(instance.getClass().getName() + " initialized in " + ms + " ms");
}
}
finally {
myInitializing = false;
}
myInitializedComponentInstance = instance;
}
}
catch (ProcessCanceledException e) {
throw e;
}
catch (Throwable t) {
handleInitComponentError(t, ((Class)getComponentKey()).getName(), myPluginId);
}
return instance;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:64,代码来源:ComponentManagerImpl.java
示例12: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(@NotNull String name) {
throw new UnsupportedOperationException();
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:MockProject.java
示例13: updateJavaParameters
import com.intellij.openapi.components.BaseComponent; //导入依赖的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
示例14: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(String name) {
return null;
}
开发者ID:krasa,项目名称:EclipseCodeFormatter,代码行数:5,代码来源:StringUtilsTest.java
示例15: updateJavaParameters
import com.intellij.openapi.components.BaseComponent; //导入依赖的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
示例16: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(String name) {
throw new UnsupportedOperationException();
}
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:MockProject.java
示例17: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(String name) {
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:DummyProject.java
示例18: getComponent
import com.intellij.openapi.components.BaseComponent; //导入依赖的package包/类
@Override
public BaseComponent getComponent(@Nonnull String name) {
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:5,代码来源:MockComponentManager.java
注:本文中的com.intellij.openapi.components.BaseComponent类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论