在本文中,我们将带你了解com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码在这篇文章中,我们将为您详细介绍com.intel
在本文中,我们将带你了解com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码在这篇文章中,我们将为您详细介绍com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码的方方面面,并解答comparable源码常见的疑惑,同时我们还将给您一些技巧,以帮助您实现更有效的com.intellij.openapi.components.ComponentConfig的实例源码、com.intellij.openapi.components.ComponentManager的实例源码、com.intellij.openapi.ui.ComponentContainer的实例源码、com.intellij.openapi.ui.popup.ComponentPopupBuilder的实例源码。
本文目录一览:- com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码(comparable源码)
- com.intellij.openapi.components.ComponentConfig的实例源码
- com.intellij.openapi.components.ComponentManager的实例源码
- com.intellij.openapi.ui.ComponentContainer的实例源码
- com.intellij.openapi.ui.popup.ComponentPopupBuilder的实例源码
com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码(comparable源码)
public static void selectSingleComponent(final GuiEditor editor,final RadComponent component) { final RadContainer root = (RadContainer)getRoot(component); if (root == null) return; ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); // this can return null if the click to select the control also requested to grab the focus - // the component tree will be instantiated after the event has been processed completely if (builder != null) { builder.beginUpdateSelection(); } try { clearSelection(root); selectComponent(editor,component); editor.setSelectionAnchor(component); editor.scrollComponentInView(component); } finally { if (builder != null) { builder.endUpdateSelection(); } } }
public static void selectComponents(final GuiEditor editor,List<RadComponent> components) { if (components.size() > 0) { RadComponent component = components.get(0); ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); if (builder == null) { // race condition when handling event? return; } builder.beginUpdateSelection(); try { clearSelection((RadContainer)getRoot(component)); for (RadComponent aComponent : components) { selectComponent(editor,aComponent); } } finally { builder.endUpdateSelection(); } } }
public static void selectSingleComponent(final GuiEditor editor,final RadComponent component) { final RadContainer root = (RadContainer)getRoot(component); if (root == null) return; ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(component.getProject()).getComponentTreeBuilder(); // this can return null if the click to select the control also requested to grab the focus - // the component tree will be instantiated after the event has been processed completely if (builder != null) { builder.beginUpdateSelection(); } try { clearSelection(root); selectComponent(editor,component); editor.setSelectionAnchor(component); editor.scrollComponentInView(component); } finally { if (builder != null) { builder.endUpdateSelection(); } } }
public static void selectComponents(final GuiEditor editor,List<RadComponent> components) { if (components.size() > 0) { RadComponent component = components.get(0); ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(component.getProject()).getComponentTreeBuilder(); if (builder == null) { // race condition when handling event? return; } builder.beginUpdateSelection(); try { clearSelection((RadContainer)getRoot(component)); for (RadComponent aComponent : components) { selectComponent(editor,aComponent); } } finally { builder.endUpdateSelection(); } } }
public static void selectComponents(final GuiEditor editor,List<RadComponent> components) { if(components.size() > 0) { RadComponent component = components.get(0); ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); if(builder == null) { // race condition when handling event? return; } builder.beginUpdateSelection(); try { clearSelection((RadContainer) getRoot(component)); for(RadComponent aComponent : components) { selectComponent(editor,aComponent); } } finally { builder.endUpdateSelection(); } } }
public void update(GuiEditor designer) { clearTreeBuilder(); myComponentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode())); myComponentTree.setEditor(designer); myPropertyInspector.setEditor(designer); if(designer == null) { myComponentTree.setFormEditor(null); } else { myComponentTree.setFormEditor(designer.getEditor()); myComponentTreeBuilder = new ComponentTreeBuilder(myComponentTree,designer); } }
@Override protected void actionPerformed(final GuiEditor editor,final List<RadComponent> selection,final AnActionEvent e) { final ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); builder.beginUpdateSelection(); try { FormEditingUtil.iterate(editor.getRootContainer(),new FormEditingUtil.ComponentVisitor() { @Override public boolean visit(final IComponent component) { ((RadComponent) component).setSelected(true); return true; } }); } finally { builder.endUpdateSelection(); } }
public void update(GuiEditor designer) { clearTreeBuilder(); myComponentTree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode())); myComponentTree.setEditor(designer); myPropertyInspector.setEditor(designer); if (designer == null) { myComponentTree.setFormEditor(null); } else { myComponentTree.setFormEditor(designer.getEditor()); myComponentTreeBuilder = new ComponentTreeBuilder(myComponentTree,designer); } }
protected void actionPerformed(final GuiEditor editor,final AnActionEvent e) { final ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); builder.beginUpdateSelection(); try { FormEditingUtil.iterate(editor.getRootContainer(),new FormEditingUtil.ComponentVisitor() { public boolean visit(final IComponent component) { ((RadComponent) component).setSelected(true); return true; } }); } finally { builder.endUpdateSelection(); } }
protected void actionPerformed(final GuiEditor editor,final AnActionEvent e) { final ComponentTreeBuilder builder = UIDesignerToolWindowManager.getInstance(editor.getProject()).getComponentTreeBuilder(); builder.beginUpdateSelection(); try { FormEditingUtil.iterate(editor.getRootContainer(),new FormEditingUtil.ComponentVisitor() { public boolean visit(final IComponent component) { ((RadComponent) component).setSelected(true); return true; } }); } finally { builder.endUpdateSelection(); } }
public static void selectSingleComponent(final GuiEditor editor,final RadComponent component) { final RadContainer root = (RadContainer) getRoot(component); if(root == null) { return; } ComponentTreeBuilder builder = DesignerToolWindowManager.getInstance(editor).getComponentTreeBuilder(); // this can return null if the click to select the control also requested to grab the focus - // the component tree will be instantiated after the event has been processed completely if(builder != null) { builder.beginUpdateSelection(); } try { clearSelection(root); selectComponent(editor,component); editor.setSelectionAnchor(component); editor.scrollComponentInView(component); } finally { if(builder != null) { builder.endUpdateSelection(); } } }
public ComponentTreeBuilder getComponentTreeBuilder() { return myComponentTreeBuilder; }
public ComponentTreeBuilder getComponentTreeBuilder() { return myComponentTreeBuilder; }
public void updateComponentTree() { final ComponentTreeBuilder builder = myComponentTreeBuilder; if (builder != null) { builder.queueUpdate(); } }
public ComponentTreeBuilder getComponentTreeBuilder() { return myComponentTreeBuilder; }
com.intellij.openapi.components.ComponentConfig的实例源码
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; }
@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; }
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()); } }
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); } }
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,ComponentConfig[] second) { if (first == null) { return second; } if (second == null) { return first; } return ArrayUtil.mergeArrays(first,second); }
@Override protected void handleInitComponentError(Throwable t,ComponentConfig config) { if (!myHandlingInitComponentError) { myHandlingInitComponentError = true; try { PluginManager.handleComponentError(t,componentClassName,config); } finally { myHandlingInitComponentError = false; } } }
public void loadComponentsConfiguration(final ComponentConfig[] components,final PluginDescriptor descriptor,final boolean defaultProject) { if (components == null) return; loadConfiguration(components,defaultProject,descriptor); }
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,second); }
@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; } } }
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); } }
public void loadComponentsConfiguration(final ComponentConfig[] components,descriptor); }
private static ComponentConfig[] mergeComponents(ComponentConfig[] first,second); }
@NotNull ComponentConfig[] getAppComponents();
@NotNull ComponentConfig[] getProjectComponents();
@NotNull ComponentConfig[] getModuleComponents();
@NotNull @Override public ComponentConfig[] getMyComponentConfigsFromDescriptor(@NotNull IdeaPluginDescriptor plugin) { return plugin.getAppComponents(); }
@NotNull public ComponentConfig[] getComponentConfigurations() { return new ComponentConfig[0]; }
@Nullable public Object getComponent(final ComponentConfig componentConfig) { return null; }
public ComponentConfig getConfig(Class componentImplementation) { throw new UnsupportedOperationException("Method getConfig not implemented in " + getClass()); }
@NotNull public ComponentConfig[] getAppComponents() { throw new IllegalStateException(); }
@NotNull public ComponentConfig[] getProjectComponents() { throw new IllegalStateException(); }
@NotNull public ComponentConfig[] getModuleComponents() { throw new IllegalStateException(); }
@NotNull public ComponentConfig[] getMyComponentConfigsFromDescriptor(@NotNull IdeaPluginDescriptor plugin) { return plugin.getAppComponents(); }
@Override @NotNull public ComponentConfig[] getAppComponents() { return myAppComponents; }
@Override @NotNull public ComponentConfig[] getProjectComponents() { return myProjectComponents; }
@Override @NotNull public ComponentConfig[] getModuleComponents() { return myModuleComponents; }
@NotNull ComponentConfig[] getAppComponents();
@NotNull ComponentConfig[] getProjectComponents();
@NotNull ComponentConfig[] getModuleComponents();
@NotNull public ComponentConfig[] getComponentConfigurations() { return new ComponentConfig[0]; }
@Nullable public Object getComponent(final ComponentConfig componentConfig) { return null; }
public ComponentConfig getConfig(Class componentImplementation) { throw new UnsupportedOperationException("Method getConfig not implemented in " + getClass()); }
@NotNull public ComponentConfig[] getAppComponents() { throw new IllegalStateException(); }
@NotNull public ComponentConfig[] getProjectComponents() { throw new IllegalStateException(); }
@NotNull public ComponentConfig[] getModuleComponents() { throw new IllegalStateException(); }
private void loadConfiguration(final ComponentConfig[] configs,final boolean defaultProject,final PluginDescriptor descriptor) { for (ComponentConfig config : configs) { loadSingleConfig(defaultProject,config,descriptor); } }
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); }
@Override @NotNull public ComponentConfig[] getAppComponents() { return myAppComponents; }
@Override @NotNull public ComponentConfig[] getProjectComponents() { return myProjectComponents; }
@Override @NotNull public ComponentConfig[] getModuleComponents() { return myModuleComponents; }
com.intellij.openapi.components.ComponentManager的实例源码
private static void collect(@NotNull ComponentManager componentManager,@NotNull Set<String> unkNownMacros,@NotNull Map<TrackingPathMacroSubstitutor,IComponentStore> substitutorToStore) { IComponentStore store = ServiceKt.getStateStore(componentManager); TrackingPathMacroSubstitutor substitutor = store.getStateStorageManager().getMacroSubstitutor(); if (substitutor == null) { return; } Set<String> macros = substitutor.getUnkNownMacros(null); if (macros.isEmpty()) { return; } unkNownMacros.addAll(macros); substitutorToStore.put(substitutor,store); }
@Override public String getSdkHomePath(@Nullable final Module module) { if (isSquirrelModule(module)) { ComponentManager holder = ObjectUtils.notNull(module,myProject); return CachedValuesManager.getManager(myProject).getCachedValue(holder,new CachedValueProvider<String>() { @Nullable @Override public Result<String> compute() { Sdk sdk = getSquirrelSdk(module); return Result.create(sdk != null ? sdk.getHomePath() : null,SquirrelIdeaSdkService.this); } }); } else { return super.getSdkHomePath(module); } }
@Nullable @Override public String getSdkVersion(@Nullable final Module module) { if (isSquirrelModule(module)) { ComponentManager holder = ObjectUtils.notNull(module,new CachedValueProvider<String>() { @Nullable @Override public Result<String> compute() { Sdk sdk = getSquirrelSdk(module); return Result.create(sdk != null ? sdk.getVersionString() : null,SquirrelIdeaSdkService.this); } }); } else { return super.getSdkVersion(module); } }
@Nullable public String getSdkVersion(@Nullable final Module module) { ComponentManager holder = ObjectUtils.notNull(module,myProject); return CachedValuesManager.getManager(myProject).getCachedValue(holder,new CachedValueProvider<String>() { @Nullable @Override public Result<String> compute() { String result = null; String sdkHomePath = getSdkHomePath(module); if (sdkHomePath != null) { result = SquirrelSdkUtil.retrieveSquirrelVersion(sdkHomePath); } return Result.create(result,SquirrelSdkService.this); } }); }
protected void installEP(final ExtensionPointName<ServiceDescriptor> pointName,final ComponentManager componentManager) { myExtensionPointName = pointName; final ExtensionPoint<ServiceDescriptor> extensionPoint = Extensions.getArea(null).getExtensionPoint(pointName); assert extensionPoint != null; final Mutablepicocontainer picocontainer = (Mutablepicocontainer)componentManager.getpicocontainer(); myExtensionPointListener = new ExtensionPointListener<ServiceDescriptor>() { public void extensionAdded(@NotNull final ServiceDescriptor descriptor,final PluginDescriptor pluginDescriptor) { if (descriptor.overrides) { ComponentAdapter oldAdapter = picocontainer.unregisterComponent(descriptor.getInterface());// Allow to re-define service implementations in plugins. if (oldAdapter == null) { throw new RuntimeException("Service: " + descriptor.getInterface() + " doesn't override anything"); } } picocontainer.registerComponent(new MyComponentAdapter(descriptor,pluginDescriptor,(ComponentManagerEx)componentManager)); } public void extensionRemoved(@NotNull final ServiceDescriptor extension,final PluginDescriptor pluginDescriptor) { picocontainer.unregisterComponent(extension.getInterface()); } }; extensionPoint.addExtensionPointListener(myExtensionPointListener); }
@Override public void run() { Object res = get(); if (res == null) return; if (res instanceof PsiElement) { if (!((PsiElement)res).isValid()) return; } else if (res instanceof ComponentManager) { if (((ComponentManager)res).isdisposed()) return; } myDelegate.run(); }
protected void installEP(@NotNull ExtensionPointName<ServiceDescriptor> pointName,@NotNull final ComponentManager componentManager) { LOG.assertTrue(myExtensionPointName == null,"Already called installEP with " + myExtensionPointName); myExtensionPointName = pointName; final ExtensionPoint<ServiceDescriptor> extensionPoint = Extensions.getArea(null).getExtensionPoint(pointName); final Mutablepicocontainer picocontainer = (Mutablepicocontainer)componentManager.getpicocontainer(); myExtensionPointListener = new ExtensionPointListener<ServiceDescriptor>() { @Override public void extensionAdded(@NotNull final ServiceDescriptor descriptor,final PluginDescriptor pluginDescriptor) { if (descriptor.overrides) { // Allow to re-define service implementations in plugins. ComponentAdapter oldAdapter = picocontainer.unregisterComponent(descriptor.getInterface()); if (oldAdapter == null) { throw new RuntimeException("Service: " + descriptor.getInterface() + " doesn't override anything"); } } if (!ComponentManagerImpl.isComponentSuitableForOs(descriptor.os)) { return; } // empty serviceImplementation means we want to unregister service if (!StringUtil.isEmpty(descriptor.getImplementation())) { picocontainer.registerComponent(new MyComponentAdapter(descriptor,(ComponentManagerEx)componentManager)); } } @Override public void extensionRemoved(@NotNull final ServiceDescriptor extension,final PluginDescriptor pluginDescriptor) { picocontainer.unregisterComponent(extension.getInterface()); } }; extensionPoint.addExtensionPointListener(myExtensionPointListener); }
private String getSdkHomeLibPath(@Nullable Module module) { ComponentManager holder = ObjectUtils.notNull(module,new CachedValueProvider<String>() { @Nullable @Override public Result<String> compute() { return Result.create(ApplicationManager.getApplication().runReadAction(new Computable<String>() { @Nullable @Override public String compute() { LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable(myProject); for (Library library : table.getLibraries()) { String libraryName = library.getName(); if (libraryName != null && libraryName.startsWith(LIBRARY_NAME)) { for (VirtualFile root : library.getFiles(OrderRoottype.CLASSES)) { if (isSquirrelSdkLibroot(root)) { return root.getCanonicalPath(); } } } } return null; } }),SquirrelSdkService.this); } }); }
public static StorageData loadStorageFile(ComponentManager componentManager,VirtualFile modulesXml) throws JDOMException,IOException { final Document document = JDOMUtil.loadDocument(new ByteArrayInputStream(modulesXml.contentsToByteArray())); StorageData storageData = new StorageData("project"); final Element element = document.getRootElement(); PathMacroManager.getInstance(componentManager).expandpaths(element); storageData.load(element); return storageData; }
@Override public void run() { Object res = get(); if (res == null) return; if (res instanceof PsiElement) { if (!((PsiElement)res).isValid()) return; } else if (res instanceof ComponentManager) { if (((ComponentManager)res).isdisposed()) return; } myDelegate.run(); }
@Override public void run() { Object res = get(); if (res == null) return; if (res instanceof PsiElement) { if (!((PsiElement)res).isValid()) return; } else if (res instanceof ComponentManager) { if (((ComponentManager)res).isdisposed()) return; } myDelegate.run(); }
@NotNull public static TreeMap<String,Element> loadStorageFile(@NotNull ComponentManager componentManager,@NotNull VirtualFile modulesXml) throws JDOMException,IOException { return FileStorageCoreUtil.load(JDOMUtil.loadDocument(modulesXml.contentsToByteArray()).getRootElement(),PathMacroManager.getInstance(componentManager),false); }
protected disposeAwareProjectChange(@NotNull ComponentManager componentManager) { myComponentManager = componentManager; }
public static <T> T registerComponentInstance(final ComponentManager container,final Class<T> key,final T implementation) { return registerComponentInstance((Mutablepicocontainer)container.getpicocontainer(),key,implementation); }
protected ConfigurablesGroupBase(ComponentManager componentManager,final ExtensionPointName<ConfigurableEP<Configurable>> configurablesExtensionPoint,boolean loadComponents) { myComponentManager = componentManager; myConfigurablesExtensionPoint = configurablesExtensionPoint; myLoadComponents = loadComponents; }
protected PlatformComponentManagerImpl(@Nullable ComponentManager parent) { super(parent); }
protected PlatformComponentManagerImpl(@Nullable ComponentManager parent,@NotNull String name) { super(parent,name); }
protected ComponentManagerImpl(@Nullable ComponentManager parentComponentManager) { myParentComponentManager = parentComponentManager; bootstrappicocontainer(toString()); }
protected ComponentManagerImpl(@Nullable ComponentManager parentComponentManager,@NotNull String name) { myParentComponentManager = parentComponentManager; bootstrappicocontainer(name); }
protected final ComponentManager getParentComponentManager() { return myParentComponentManager; }
public static <T> T registerComponentInstance(final ComponentManager container,implementation); }
protected ConfigurablesGroupBase(ComponentManager componentManager,boolean loadComponents) { myComponentManager = componentManager; myConfigurablesExtensionPoint = configurablesExtensionPoint; myLoadComponents = loadComponents; }
protected disposeAwareProjectChange(@Nonnull ComponentManager componentManager) { myComponentManager = componentManager; }
public static <T> T registerComponentInstance(final ComponentManager container,implementation); }
@Nonnull public MultiHostInjector getInstance(@Nonnull ComponentManager componentManager) { return instantiate(myImplementationClassHandler.getValue(),componentManager.getpicocontainer()); }
protected PlatformComponentManagerImpl(ComponentManager parent) { super(parent); }
protected PlatformComponentManagerImpl(ComponentManager parent,@Nonnull String name) { super(parent,name); }
com.intellij.openapi.ui.ComponentContainer的实例源码
protected AbstractRerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { myParent = componentContainer.getComponent(); registry.add(this); disposer.register(componentContainer,this); copyFrom(ActionManager.getInstance().getAction("RerunFailedTests")); registerCustomShortcutSet(getShortcutSet(),myParent); }
private void showInToolWindow(ComponentContainer consoleView,String tabName) { ToolWindow toolWindow = getToolWindow(); toolWindow.activate(null); ContentManager contentManager = toolWindow.getContentManager(); Content content = contentManager.getFactory() .createContent(consoleView.getComponent(),tabName,false); disposer.register(content,consoleView); contentManager.addContent(content); contentManager.setSelectedContent(content); }
public JavaRerunFailedTestsAction(@NotNull ComponentContainer componentContainer,@NotNull TestConsoleProperties consoleProperties) { super(componentContainer); init(consoleProperties); }
protected AbstractRerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { copyFrom(ActionManager.getInstance().getAction("RerunFailedTests")); registerCustomShortcutSet(getShortcutSet(),componentContainer.getComponent()); }
protected PyRerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { super(componentContainer); }
public RerunFailedTestsAction(@NotNull ComponentContainer componentContainer,@NotNull TestConsoleProperties consoleProperties) { super(componentContainer,consoleProperties); }
BlazeRerunFailedTestsAction( BlazeTestEventsHandler eventsHandler,ComponentContainer componentContainer) { super(componentContainer); this.eventsHandler = eventsHandler; }
protected PTestRerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { super(componentContainer); }
public GaugeRerunFailedAction(@NotNull ComponentContainer componentContainer) { super(componentContainer); }
protected JavaRerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { super(componentContainer); }
public RerunFailedTestsAction(@NotNull ComponentContainer componentContainer) { super(componentContainer); }
protected AbstractRerunFailedTestsAction(@Nonnull ComponentContainer componentContainer) { copyFrom(ActionManager.getInstance().getAction("RerunFailedTests")); registerCustomShortcutSet(getShortcutSet(),componentContainer.getComponent()); }
public JavaRerunFailedTestsAction(@NotNull ComponentContainer componentContainer,@NotNull TestConsoleProperties consoleProperties) { super(componentContainer); init(consoleProperties); }
com.intellij.openapi.ui.popup.ComponentPopupBuilder的实例源码
@NotNull JBPopup createPopup() { JPanel panel = new JPanel(new BorderLayout()); panel.add(myTextField,BorderLayout.CENTER); ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(panel,myTextField) .setCancelOnClickOutside(true) .setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish") .setRequestFocus(true) .setResizable(true) .setMayBeParent(true); final JBPopup popup = builder.createPopup(); popup.setMinimumSize(new Dimension(200,90)); AnAction okAction = new DumbAwareAction() { @Override public void actionPerformed(@NotNull AnActionEvent e) { unregisterCustomShortcutSet(popup.getContent()); popup.cloSEOk(e.getInputEvent()); } }; okAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER,popup.getContent()); return popup; }
@Nonnull JBPopup createPopup() { JPanel panel = new JPanel(new BorderLayout()); panel.add(myTextField,myTextField) .setCancelOnClickOutside(true) .setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish") .setRequestFocus(true) .setResizable(true) .setMayBeParent(true); final JBPopup popup = builder.createPopup(); popup.setMinimumSize(new JBDimension(200,90)); AnAction okAction = new DumbAwareAction() { @Override public void actionPerformed(@Nonnull AnActionEvent e) { unregisterCustomShortcutSet(popup.getContent()); popup.cloSEOk(e.getInputEvent()); } }; okAction.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER,popup.getContent()); return popup; }
private void showNotePopup(Project project,final DnDAwareTree tree,final Consumer<String> after,final String initText) { final JTextArea textArea = new JTextArea(3,50); textArea.setFont(UIUtil.getTreeFont()); textArea.setText(initText); final JBScrollPane pane = new JBScrollPane(textArea); final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(pane,textArea) .setCancelOnClickOutside(true) .setAdText(KeymapUtil.getShortcutsText(CommonShortcuts.CTRL_ENTER.getShortcuts()) + " to finish") .setTitle("Comment") .setMovable(true) .setRequestFocus(true).setResizable(true).setMayBeParent(true); final JBPopup popup = builder.createPopup(); final JComponent content = popup.getContent(); final AnAction action = new AnAction() { @Override public void actionPerformed(AnActionEvent e) { popup.cloSEOk(e.getInputEvent()); unregisterCustomShortcutSet(content); after.consume(textArea.getText()); } }; action.registerCustomShortcutSet(CommonShortcuts.CTRL_ENTER,content); ApplicationManager.getApplication().invokelater(new Runnable() { @Override public void run() { popup.showInCenterOf(tree); } },ModalityState.NON_MODAL,project.getdisposed()); }
/** Opens up the Google Login panel as a popup. */ private static void showPopup(AnActionEvent event) { GoogleLoginUsersPanel usersPanel = new GoogleLoginUsersPanel(); ComponentPopupBuilder popupBuilder = JBPopupFactory.getInstance().createComponentPopupBuilder(usersPanel,usersPanel.getList()); JBPopup popup = popupBuilder.setCancelOnWindowDeactivation(true).createPopup(); JComponent source = (JComponent) event.getInputEvent().getSource(); popup.showUnderneathOf(source); }
private void showNotePopup(Project project,project.getdisposed()); }
private void showNotePopup(Project project,project.getdisposed()); }
public static JBPopup createRegExHelpPopup() throws BadLocationException { final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(new RegExHelpPopup(),null); return builder.setCancelOnClickOutside(false).setBelongsToGlobalPopupStack(true).setFocusable(true).setRequestFocus(true).setMovable(true).setResizable(true) .setCancelOnOtherWindowOpen(false).setCancelButton(new MinimizeButton("Hide")) .setTitle("Regular expressions Syntax").setDimensionServiceKey(null,"RegExHelpPopup",true).createPopup(); }
public static JBPopup createRegExHelpPopup() throws BadLocationException { final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(new RegExHelpPopup(),true).createPopup(); }
@Override public void showUI() { if (myBalloon != null && myBalloon.isVisible()) { return; } if (myBalloon != null && !myBalloon.isdisposed()) { myBalloon.cancel(); } if (myBalloon == null || myBalloon.isdisposed()) { final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(this,mySearchComponent); myBalloon = builder .setProject(myHelper.getProject()) .setMovable(true) .setResizable(true) .setMayBeParent(true) .setCancelOnClickOutside(true) .setRequestFocus(true) .setCancelKeyEnabled(false) .setCancelCallback(() -> { if (!myCanClose.get()) return false; if (myIsPinned.get()) return false; if (!ApplicationManager.getApplication().isActive()) return false; if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow() == null) return false; List<JBPopup> popups = JBPopupFactory.getInstance().getChildPopups(this); if (!popups.isEmpty()) { for (JBPopup popup : popups) { popup.cancel(); } return false; } if (myScopeUI.hideAllPopups()) { return false; } DimensionService.getInstance().setSize(SERVICE_KEY,myBalloon.getSize(),myHelper.getProject() ); DimensionService.getInstance().setLocation(SERVICE_KEY,myBalloon.getLocationOnScreen(),myHelper.getProject() ); ((FindManagerImpl)FindManager.getInstance(myProject)).changeGlobalSettings(myHelper.getModel()); return true; }) .createPopup(); disposer.register(myBalloon,mydisposable); registerCloseAction(myBalloon); final Window window = WindowManager.getInstance().suggestParentwindow(myProject); Component parent = UIUtil.findUltimateParent(window); RelativePoint showPoint = null; Point screenPoint = DimensionService.getInstance().getLocation(SERVICE_KEY); if (screenPoint != null) { showPoint = new RelativePoint(screenPoint); } if (parent != null && showPoint == null) { int height = UISettings.getInstance().getShowNavigationBar() ? 135 : 115; if (parent instanceof IdeFrameImpl && ((IdeFrameImpl)parent).isInFullScreen()) { height -= 20; } showPoint = new RelativePoint(parent,new Point((parent.getSize().width - getPreferredSize().width) / 2,height)); } mySearchComponent.selectAll(); WindowMoveListener windowListener = new WindowMoveListener(this); myTitlePanel.addMouseListener(windowListener); myTitlePanel.addMouseMotionListener(windowListener); Dimension panelSize = getPreferredSize(); Dimension prev = DimensionService.getInstance().getSize(SERVICE_KEY); if (!myCbPreserveCase.isVisible()) { panelSize.width += myCbPreserveCase.getPreferredSize().width + 8; } panelSize.width += JBUI.scale(24);//hidden 'loading' icon panelSize.height *= 2; if (prev != null && prev.height < panelSize.height) prev.height = panelSize.height; myBalloon.setMinimumSize(panelSize); if (prev == null) { panelSize.height *= 1.5; panelSize.width *= 1.15; } myBalloon.setSize(prev != null ? prev : panelSize); if (showPoint != null && showPoint.getComponent() != null) { myBalloon.show(showPoint); } else { myBalloon.showCenteredInCurrentwindow(myProject); } } }
public static JBPopup createRegExHelpPopup() throws BadLocationException { final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(new RegExHelpPopup(),null); return builder.setCancelOnClickOutside(false).setBelongsToGlobalPopupStack(true).setFocusable(true).setRequestFocus(true).setMovable(true).setResizable(true) .setCancelOnOtherWindowOpen(false).setCancelButton(new MinimizeButton("Hide")) .setTitle("Regular expressions Syntax").setDimensionServiceKey(null,true).createPopup(); }
@SuppressWarnings("SSBasedinspection") private void updatePopup() { check(); SwingUtilities.invokelater(new Runnable() { @Override public void run() { myListModel.update(); myList.revalidate(); myList.repaint(); myRenderer.recalculateWidth(); if (myBalloon == null || myBalloon.isdisposed()) { return; } if (myPopup == null || !myPopup.isVisible()) { final ActionCallback callback = ListDelegationUtil.installKeyboardDelegation(getField().getTextEditor(),myList); JBScrollPane content = new JBScrollPane(myList); content.setMinimumSize(new Dimension(myBalloon.getSize().width,30)); final ComponentPopupBuilder builder = JBPopupFactory.getInstance().createComponentPopupBuilder(content,null); myPopup = builder.setRequestFocus(false).setCancelKeyEnabled(false).setCancelCallback(new Computable<Boolean>() { @Override public Boolean compute() { return myBalloon == null || myBalloon.isdisposed() || (!getField().getTextEditor().hasFocus() && !mySkipFocusGain); } }).createPopup(); myPopup.setMinimumSize(new Dimension(myBalloon.getSize().width,30)); myPopup.getContent().setBorder(new EmptyBorder(0,0)); disposer.register(myPopup,new disposable() { @Override public void dispose() { callback.setDone(); resetFields(); myNonProjectCheckBox.setSelected(false); ActionToolbarImpl.updateallToolbarsImmediately(); if (myActionEvent != null && myActionEvent.getInputEvent() instanceof MouseEvent) { final Component component = myActionEvent.getInputEvent().getComponent(); if (component != null) { final JLabel label = UIUtil.getParentOfType(JLabel.class,component); if (label != null) { label.setIcon(AllIcons.Actions.Findplain); } } } myActionEvent = null; } }); myPopup.show(new RelativePoint(getField().getParent(),new Point(0,getField().getParent().getHeight()))); //updatePopupBounds(); ActionManager.getInstance().addAnActionListener(new AnActionListener.Adapter() { @Override public void beforeActionPerformed(AnAction action,DataContext dataContext,AnActionEvent event) { if (action instanceof TextComponentEditorAction) { return; } myPopup.cancel(); } },myPopup); } else { myList.revalidate(); myList.repaint(); } ScrollingUtil.ensureSelectionExists(myList); if (myList.getModel().getSize() > 0) { updatePopupBounds(); } } }); }
我们今天的关于com.intellij.uiDesigner.componentTree.ComponentTreeBuilder的实例源码和comparable源码的分享就到这里,谢谢您的阅读,如果想了解更多关于com.intellij.openapi.components.ComponentConfig的实例源码、com.intellij.openapi.components.ComponentManager的实例源码、com.intellij.openapi.ui.ComponentContainer的实例源码、com.intellij.openapi.ui.popup.ComponentPopupBuilder的实例源码的相关信息,可以在本站进行搜索。
本文标签: