GVKun编程网logo

如何控制JComponent的工具提示的显示?

12

本文将带您了解关于如何控制JComponent的工具提示的显示?的新内容,另外,我们还将为您提供关于Angular2:如何在该Component中访问自定义Component的FormControl实

本文将带您了解关于如何控制JComponent的工具提示的显示?的新内容,另外,我们还将为您提供关于Angular 2:如何在该Component中访问自定义Component的FormControl实例?、cocoa – IKImageBrowserView:如何显示每个项目的工具提示?、com.intellij.openapi.components.BaseComponent的实例源码、com.intellij.openapi.components.ComponentConfig的实例源码的实用信息。

本文目录一览:

如何控制JComponent的工具提示的显示?

如何控制JComponent的工具提示的显示?

我有一个JComponent可以自己绘制各种形状。我检测到鼠标何时进入这些形状之一,并相应地更改工具提示。

我遇到的问题是:

  • 用户在形状上跟踪鼠标时,工具提示不会跟随鼠标。它停留在最初设置的位置,然后仅在其他形状更改工具提示时才跳转。
  • 工具提示大约需要一秒钟的时间,但我希望它立即显示。

有人可以建议一种无需编写自定义工具提示机制即可获得这些行为的方法吗?

答案1

小编典典

看一下ToolTipManager。

您可以向该管理员注册组件,然后调整许多设置。它非常简单易用。

至少可以解决您的初始延迟问题。

对于第一个问题,您可以从组件中覆盖createTooltip命令,以保留JTooltip实例。然后,只要将鼠标作为JComponent类的子类来移动(也可以跟随鼠标),它就很容易改变位置。

Angular 2:如何在该Component中访问自定义Component的FormControl实例?

Angular 2:如何在该Component中访问自定义Component的FormControl实例?

所以我一直在阅读如何在Angular2中构建自定义FormControls,但我无法得到我正在努力完成验证的工作.我有一个正常的输入控件,我想在自定义组件中包装,以便我可以这样做:

<my-control name="something" [(ngModel)]="model.something" required></my-control>

而不是每次都重复这个:

<divhttps://www.jb51.cc/tag/Feed/" target="_blank">Feedback" [ngClass]="{'has-success': someInput.valid,'has-error': someInput.invalid && someInput.dirty}">
    <labelfor="someId">{{label || 'Some Input'}}</label>
    <input type="test"id="someId" placeholder="Some Input" [ngModel]="value" (ngModel)="onChange($event)" name="someInput" required #someInput="ngModel" minlength="8"/>
    <spanhttps://www.jb51.cc/tag/Feed/" target="_blank">Feedback" aria-hidden="true" [ngClass]="{'glyphicon-ok': someInput.valid,'glyphicon-remove': someInput.invalid && someInput.dirty}"></span>
    <div [hidden]="someInput.valid || someInput.pristine || !someInput.errors.required">Some Input is required</div>
    <div [hidden]="someInput.valid || someInput.pristine || !someInput.errors.minlength">Some Input must be at least 8 characters</div>
</div>

所以我通过自定义组件实现了以下有关如何在线创建自定义组件的文章:

https://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html

缺少的是能够将验证移出组件,但允许自定义组件处理该验证的显示.因此,如果你看一下我的目的是允许组件的用户指定验证而不是让组件强加特定的验证(注意某些验证是组件固有的,例如电子邮件地址组件会验证它是一封没有用户指定的电子邮件).请注意,必需的是该客户组件的使用情况.

那么如何在该组件的定义中获得对自定义组件的FormControl的引用?注意:我理解如何访问模板的FormControl实例中的输入字段,因为上面的代码完全证明了这一点.我要求的是模板所在的自定义控件的FormControl实例.在我引用的文章中,它将是CounterInputComponent的FormControl.

解决方法

添加这似乎工作:

@ViewChild(NgModel) model: NgModel;

然后你可以通过以下方式访问FormControl:

this.model.control

cocoa – IKImageBrowserView:如何显示每个项目的工具提示?

cocoa – IKImageBrowserView:如何显示每个项目的工具提示?

我挖掘了文档,但没有找到怎么做.如何为IK ImagebrowserView中的每个项添加工具提示?

解决方法

IKImagebrowserView是一个NSView,因此您可以使用以下函数添加工具提示矩形:

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/Reference/NSView.html#//apple_ref/doc/uid/20000014-SW47

对于我的实现,我将图像浏览器放在一个不调整大小的scrollview中,因此我只需要在使用此代码更改数据时更新工具提示,其中images是我的数据源数组:

[imagebrowser reloadData];
[imagebrowser removeAllToolTips];
for (int i=0; i<[images count]; i++) {
    NSRect rect = [imagebrowser itemFrameAtIndex:i];
    ImageObject *image = [images objectAtIndex:i];
    [imagebrowser addToolTipRect:rect owner:self userData:image];
}

然后我实现了这个功能:

- (Nsstring*)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data {
    ImageObject *image = (ImageObject*)data;
    return [image imageTitle];
}

如果您的图像浏览器更改其布局(您调整其大小,添加/删除列,或更改缩放等),则需要更新所有工具提示.

com.intellij.openapi.components.BaseComponent的实例源码

com.intellij.openapi.components.BaseComponent的实例源码

项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
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);
}
项目:intellij-ce-playground    文件:VcsEP.java   
@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;
  }
}
项目:tools-idea    文件:VcsEP.java   
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;
}
项目:consulo    文件:VcsEP.java   
@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,project.getpicocontainer());
  }
  catch (ProcessCanceledException pce) {
    throw pce;
  }
  catch(Exception e) {
    LOG.error(e);
    return null;
  }
}
项目:intellij-ce-playground    文件:SnapShooterConfigurationExtension.java   
@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");
  }
}
项目:intellij-ce-playground    文件:ComponentType.java   
ComponentType(Class<? extends BaseComponent> clazz,@NonNls String name,@PropertyKey(resourceBundle = "org.jetbrains.idea.devkit.DevKitBundle") String propertyKey)
{
  myPropertyKey = propertyKey;
  myClassName = clazz.getName();
  myName = name;
}
项目:tools-idea    文件:ComponentType.java   
ComponentType(Class<? extends BaseComponent> clazz,@PropertyKey(resourceBundle = "org.jetbrains.idea.devkit.DevKitBundle") String propertyKey)
{
  myPropertyKey = propertyKey;
  myClassName = clazz.getName();
  myName = name;
}
项目:jfrog-idea-plugin    文件:NpmProjectImpl.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
    return null;
}
项目:stack-intheflow    文件:ProjectMock.java   
@Override
public BaseComponent getComponent(@NotNull String s) {
    return null;
}
项目:intellij-ce-playground    文件:DummyProject.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
  return null;
}
项目:intellij-ce-playground    文件:MockComponentManager.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
  return null;
}
项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
@Override
public synchronized BaseComponent getComponent(@NotNull String name) {
  return myNametoComponent.get(name);
}
项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
@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;
}
项目:aem-ide-tooling-4-intellij    文件:MockProject.java   
@Override
public BaseComponent getComponent(@NotNull String s) {
    return null;
}
项目:shared-views    文件:MockProject.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
    return null;
}
项目:tools-idea    文件:DummyProject.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
  return null;
}
项目:tools-idea    文件:MockComponentManager.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
  return null;
}
项目:tools-idea    文件:MockProject.java   
@Override
public BaseComponent getComponent(@NotNull String name) {
  throw new UnsupportedOperationException();
}
项目:tools-idea    文件:SnapShooterConfigurationExtension.java   
@Override
public void updateJavaParameters(runconfigurationBase configuration,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");
  }
}
项目:EclipseCodeFormatter    文件:StringUtilsTest.java   
@Override
public BaseComponent getComponent(String name) {
    return null;
}
项目:consulo-ui-designer    文件:SnapShooterConfigurationExtension.java   
@Override
public void updateJavaParameters(runconfigurationBase configuration,OwnJavaParameters params,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");
  }
}
项目:consulo    文件:MockProject.java   
@Override
public BaseComponent getComponent(String name) {
  throw new UnsupportedOperationException();
}
项目:consulo    文件:DummyProject.java   
@Override
public BaseComponent getComponent(String name) {
  return null;
}
项目:consulo    文件:MockComponentManager.java   
@Override
public BaseComponent getComponent(@Nonnull String name) {
  return null;
}

com.intellij.openapi.components.ComponentConfig的实例源码

com.intellij.openapi.components.ComponentConfig的实例源码

项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
protected final void init(@Nullable ProgressIndicator indicator,@Nullable Runnable componentsRegistered) {
  List<ComponentConfig> componentConfigs = getComponentConfigs();
  for (ComponentConfig config : componentConfigs) {
    registerComponents(config);
  }
  myComponentConfigCount = componentConfigs.size();

  if (componentsRegistered != null) {
    componentsRegistered.run();
  }

  if (indicator != null) {
    indicator.setIndeterminate(false);
  }
  createComponents(indicator);
  myComponentsCreated = true;
}
项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
@NotNull
private List<ComponentConfig> getComponentConfigs() {
  ArrayList<ComponentConfig> componentConfigs = new ArrayList<ComponentConfig>();
  boolean isDefaultProject = this instanceof Project && ((Project)this).isDefault();
  boolean headless = ApplicationManager.getApplication().isHeadlessEnvironment();
  for (IdeaPluginDescriptor plugin : PluginManagerCore.getPlugins()) {
    if (PluginManagerCore.shouldSkipPlugin(plugin)) {
      continue;
    }

    ComponentConfig[] configs = getMyComponentConfigsFromDescriptor(plugin);
    componentConfigs.ensureCapacity(componentConfigs.size() + configs.length);
    for (ComponentConfig config : configs) {
      if ((!isDefaultProject || config.isLoadForDefaultProject()) && isComponentSuitable(config.options) && config.prepareClasses(headless)) {
        config.pluginDescriptor = plugin;
        componentConfigs.add(config);
      }
    }
  }
  return componentConfigs;
}
项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
private void registerComponents(@NotNull ComponentConfig config) {
  ClassLoader loader = config.getClassLoader();
  try {
    final Class<?> interfaceClass = Class.forName(config.getInterfaceClass(),true,loader);
    final Class<?> implementationClass = Comparing.equal(config.getInterfaceClass(),config.getImplementationClass())
                                         ?
                                         interfaceClass
                                         : StringUtil.isEmpty(config.getImplementationClass()) ? null : Class.forName(config.getImplementationClass(),loader);
    Mutablepicocontainer picocontainer = getpicocontainer();
    if (config.options != null && Boolean.parseBoolean(config.options.get("overrides"))) {
      ComponentAdapter oldAdapter = picocontainer.getComponentAdapterOfType(interfaceClass);
      if (oldAdapter == null) {
        throw new RuntimeException(config + " does not override anything");
      }
      picocontainer.unregisterComponent(oldAdapter.getComponentKey());
    }
    // implementationClass == null means we want to unregister this component
    if (implementationClass != null) {
      picocontainer.registerComponent(new ComponentConfigComponentAdapter(interfaceClass,implementationClass,config.getPluginId(),config.options != null && Boolean.parseBoolean(config.options.get("workspace"))));
    }
  }
  catch (Throwable t) {
    handleInitComponentError(t,null,config.getPluginId());
  }
}
项目:tools-idea    文件:PluginManager.java   
public static void handleComponentError(Throwable t,String componentClassName,ComponentConfig config) {
  if (t instanceof StartupAbortedException) {
    throw (StartupAbortedException)t;
  }

  PluginId pluginId = config != null ? config.getPluginId() : getPluginByClassName(componentClassName);

  if (pluginId != null && !CORE_PLUGIN_ID.equals(pluginId.getIdString())) {
    getLogger().warn(t);

    disablePlugin(pluginId.getIdString());

    String message =
      "Plugin '" + pluginId.getIdString() + "' Failed to initialize and will be disabled\n" +
      "(reason: " + t.getMessage() + ")\n\n" +
      ApplicationNamesInfo.getInstance().getFullProductName() + " will be restarted.";
    Main.showMessage("Plugin Error",message,false);

    throw new StartupAbortedException(t).exitCode(Main.PLUGIN_ERROR).logError(false);
  }
  else {
    throw new StartupAbortedException("Fatal error initializing '" + componentClassName + "'",t);
  }
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptorImpl.java   
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,ComponentConfig[] second) {
  if (first == null) {
    return second;
  }
  if (second == null) {
    return first;
  }
  return ArrayUtil.mergeArrays(first,second);
}
项目:tools-idea    文件:ApplicationImpl.java   
@Override
protected void handleInitComponentError(Throwable t,ComponentConfig config) {
  if (!myHandlingInitComponentError) {
    myHandlingInitComponentError = true;
    try {
      PluginManager.handleComponentError(t,componentClassName,config);
    }
    finally {
      myHandlingInitComponentError = false;
    }
  }
}
项目:tools-idea    文件:ComponentManagerConfigurator.java   
public void loadComponentsConfiguration(final ComponentConfig[] components,final PluginDescriptor descriptor,final boolean defaultProject) {
  if (components == null) return;

  loadConfiguration(components,defaultProject,descriptor);
}
项目:tools-idea    文件:IdeaPluginDescriptorImpl.java   
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,second);
}
项目:consulo    文件:PlatformComponentManagerImpl.java   
@Override
protected void handleInitComponentError(@Nonnull Throwable ex,@Nullable String componentClassName,@Nullable ComponentConfig config) {
  if (!myHandlingInitComponentError) {
    myHandlingInitComponentError = true;
    try {
      PluginManager.handleComponentError(ex,config);
    }
    finally {
      myHandlingInitComponentError = false;
    }
  }
}
项目:consulo    文件:PluginManager.java   
public static void handleComponentError(@Nonnull Throwable t,@Nullable ComponentConfig config) {
  if (t instanceof StartupAbortedException) {
    throw (StartupAbortedException)t;
  }

  PluginId pluginId = null;
  if (config != null) {
    pluginId = config.getPluginId();
  }
  if (pluginId == null || CORE_PLUGIN.equals(pluginId)) {
    pluginId = componentClassName == null ? null : getPluginByClassName(componentClassName);
  }
  if (pluginId == null || CORE_PLUGIN.equals(pluginId)) {
    if (t instanceof PicopluginExtensionInitializationException) {
      pluginId = ((PicopluginExtensionInitializationException)t).getPluginId();
    }
  }

  if (pluginId != null && !isSystemPlugin(pluginId)) {
    getLogger().warn(t);

    if(!ApplicationProperties.isInSandBox()) {
      disablePlugin(pluginId.getIdString());
    }

    StringWriter message = new StringWriter();
    message.append("Plugin '").append(pluginId.getIdString()).append("' Failed to initialize and will be disabled. ");
    message.append(" Please restart ").append(ApplicationNamesInfo.getInstance().getFullProductName()).append('.');
    message.append("\n\n");
    t.printstacktrace(new PrintWriter(message));
    Main.showMessage("Plugin Error",message.toString(),t);
  }
}
项目:consulo    文件:ComponentManagerConfigurator.java   
public void loadComponentsConfiguration(final ComponentConfig[] components,descriptor);
}
项目:consulo    文件:IdeaPluginDescriptorImpl.java   
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,second);
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getAppComponents();
项目:intellij-ce-playground    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getProjectComponents();
项目:intellij-ce-playground    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getModuleComponents();
项目:intellij-ce-playground    文件:ApplicationImpl.java   
@NotNull
@Override
public ComponentConfig[] getMyComponentConfigsFromDescriptor(@NotNull IdeaPluginDescriptor plugin) {
  return plugin.getAppComponents();
}
项目:intellij-ce-playground    文件:DummyProject.java   
@NotNull
public ComponentConfig[] getComponentConfigurations() {
  return new ComponentConfig[0];
}
项目:intellij-ce-playground    文件:DummyProject.java   
@Nullable
public Object getComponent(final ComponentConfig componentConfig) {
  return null;
}
项目:intellij-ce-playground    文件:DummyProject.java   
public ComponentConfig getConfig(Class componentImplementation) {
  throw new UnsupportedOperationException("Method getConfig not implemented in " + getClass());
}
项目:intellij-ce-playground    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getAppComponents() {
  throw new IllegalStateException();
}
项目:intellij-ce-playground    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getProjectComponents() {
  throw new IllegalStateException();
}
项目:intellij-ce-playground    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getModuleComponents() {
  throw new IllegalStateException();
}
项目:intellij-ce-playground    文件:ComponentManagerImpl.java   
@NotNull
public ComponentConfig[] getMyComponentConfigsFromDescriptor(@NotNull IdeaPluginDescriptor plugin) {
  return plugin.getAppComponents();
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getAppComponents() {
  return myAppComponents;
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getProjectComponents() {
  return myProjectComponents;
}
项目:intellij-ce-playground    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getModuleComponents() {
  return myModuleComponents;
}
项目:tools-idea    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getAppComponents();
项目:tools-idea    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getProjectComponents();
项目:tools-idea    文件:IdeaPluginDescriptor.java   
@NotNull
ComponentConfig[] getModuleComponents();
项目:tools-idea    文件:DummyProject.java   
@NotNull
public ComponentConfig[] getComponentConfigurations() {
  return new ComponentConfig[0];
}
项目:tools-idea    文件:DummyProject.java   
@Nullable
public Object getComponent(final ComponentConfig componentConfig) {
  return null;
}
项目:tools-idea    文件:DummyProject.java   
public ComponentConfig getConfig(Class componentImplementation) {
  throw new UnsupportedOperationException("Method getConfig not implemented in " + getClass());
}
项目:tools-idea    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getAppComponents() {
  throw new IllegalStateException();
}
项目:tools-idea    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getProjectComponents() {
  throw new IllegalStateException();
}
项目:tools-idea    文件:PluginNode.java   
@NotNull
public ComponentConfig[] getModuleComponents() {
  throw new IllegalStateException();
}
项目:tools-idea    文件:ComponentManagerConfigurator.java   
private void loadConfiguration(final ComponentConfig[] configs,final boolean defaultProject,final PluginDescriptor descriptor) {
  for (ComponentConfig config : configs) {
    loadSingleConfig(defaultProject,config,descriptor);
  }
}
项目:tools-idea    文件:ComponentManagerConfigurator.java   
private void loadSingleConfig(final boolean defaultProject,final ComponentConfig config,final PluginDescriptor descriptor) {
  if (defaultProject && !config.isLoadForDefaultProject()) return;
  if (!myComponentManager.isComponentSuitable(config.options)) return;

  myComponentManager.registerComponent(config,descriptor);
}
项目:tools-idea    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getAppComponents() {
  return myAppComponents;
}
项目:tools-idea    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getProjectComponents() {
  return myProjectComponents;
}
项目:tools-idea    文件:IdeaPluginDescriptorImpl.java   
@Override
@NotNull
public ComponentConfig[] getModuleComponents() {
  return myModuleComponents;
}

关于如何控制JComponent的工具提示的显示?的问题我们已经讲解完毕,感谢您的阅读,如果还想了解更多关于Angular 2:如何在该Component中访问自定义Component的FormControl实例?、cocoa – IKImageBrowserView:如何显示每个项目的工具提示?、com.intellij.openapi.components.BaseComponent的实例源码、com.intellij.openapi.components.ComponentConfig的实例源码等相关内容,可以在本站寻找。

本文标签: