对于Swing-未调用paintComponent方法感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍尚未调用beginbuild,并为您提供关于Angular2:ngSwitch或ViewCo
对于Swing-未调用paintComponent方法感兴趣的读者,本文将会是一篇不错的选择,我们将详细介绍尚未调用beginbuild,并为您提供关于Angular 2:ngSwitch或ViewContainerRef.createComponent、com.intellij.openapi.components.ComponentConfig的实例源码、com.intellij.openapi.components.ProjectComponent的实例源码、com.intellij.openapi.ui.ComponentContainer的实例源码的有用信息。
本文目录一览:- Swing-未调用paintComponent方法(尚未调用beginbuild)
- Angular 2:ngSwitch或ViewContainerRef.createComponent
- com.intellij.openapi.components.ComponentConfig的实例源码
- com.intellij.openapi.components.ProjectComponent的实例源码
- com.intellij.openapi.ui.ComponentContainer的实例源码
Swing-未调用paintComponent方法(尚未调用beginbuild)
我只是实现了继承JPanel的类,如下所示
public class Orpanel extends JPanel {.... @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D)g; g2d.setPaint(tpaint); g2d.fill(rect); }....}
Orpanel类正在加载图像并调整其自身大小。
这是问题。
调用JFrame的setContentpane(Orpanel的实例)使其工作正常,但是当我将Orpanel附加到JFrame时,调用add()方法而不是setContentpane(我知道setcontentpane并不意味着attach
..反正),它就行不通了。
终于弄清楚了当我使用add()方法时,添加到JFrame的Component不会调用paintComponent()方法。即使我手动调用repaint()方法,仍然不会调用paintComponent()方法。
我错过了什么?任何帮助将不胜感激!
提前。海永信
我添加了额外的代码。
public Test(OwPanel op) { super(); Dimension monitor = Toolkit.getDefaultToolkit().getScreenSize(); op.setBackground(Color.white); this.setBackground(Color.white); this.setBounds(monitor.width / 2 - 200 , monitor.height / 2 - 200, 400, 400); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setTitle("test"); this.setLayout(null); this.getContentPane().add(op); //this.setContentPane(op); this.setVisible(true); this.validate();} public static void main(String[] args) { // TODO Auto-generated method stub SwingUtilities.invokeLater(new Runnable() { @Override public void run() { OwPanel op = new OwPanel("d:\\java_workplace\\img\\img1.jpg", 100, 100); OwLabel ol = new OwLabel("d:\\java_workplace\\img\\img2.jpg", 300, 50); Test tst = new Test(op); tst.add(ol); } });
如果将setContentpane()方法替换为getContentpane()。add(),仍然无法正常工作。不要困惑。Owpanel和Orpanel相同:)
答案1
小编典典在您的示例代码中,我看到您选择不使用LayoutManager,这是一个非常糟糕的主意,但是无论如何,按照这种方式,我看到了一个Orpanel.paintComponent()
不被调用的原因:它可能在框架内不可见!
如果没有LayoutManager
,则必须(通过setBounds()
)显式设置添加到框架的所有组件的大小和位置。
您可能没有这样做,因此Orpanel
实例的大小可能为0,因此它永远不会被绘制。
Angular 2:ngSwitch或ViewContainerRef.createComponent
<div *ngFor='let item of items'> <div [ngSwitch]="item.view"> <view-one *ngSwitchCase="'one'"></view-one> <view-two *ngSwitchCase="'two'"></view-two> <view-three *ngSwitchCase="'three'"></view-three> </div> </div>
我想知道是否有更好的更有效的方法,或者这是正确的方法吗?
我见过人们动态创建组件,但api已经改变了很多次,很难知道什么是正确的.似乎ViewContainerRef.createComponent()可能是另一种选择?
解决方法
这是我当前方法的简化形式:
@Component({ selector: "my-item",template: ` <div #placeholder></div> ` }) export class MyItemComponent implements AfterViewInit { @input() item: any; @ViewChild("placeholder",{read: ViewContainerRef}) placeholderRef: ViewContainerRef; constructor( private componentFactoryResolver: ComponentFactoryResolver) { } ngAfterViewInit() { switch(this.item.view) { case "one": this.loadItem(OneItemComponent); case "two": this.loadItem(TwoItemComponent); default: throw new Error("UnkNown item!"); } } private loadItem(component: Type<any>) { const factory = this.componentFactoryResolver.resolveComponentFactory(component); const componentRef = this.placeholderRef.createComponent(factory); componentRef.instance.item = this.item; componentRef.changeDetectorRef.detectChanges(); } }
现在您可以通过以下方式使用它:
<my-item *ngFor="let item of items" [item]="item"></my-item>
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.ProjectComponent的实例源码
@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); } } }); }
public void projectOpened() { final ProjectComponent[] components = getComponents(ProjectComponent.class); for (ProjectComponent component : components) { try { component.projectOpened(); } catch (Throwable e) { LOG.error(component.toString(),e); } } }
@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"); } }
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))); }
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))); }
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; } }
private void projectOpened() { final ProjectComponent[] components = getComponents(ProjectComponent.class); for (ProjectComponent component : components) { try { component.projectOpened(); } catch (Throwable e) { LOG.error(component.toString(),e); } } }
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); } } }
public void projectOpened() { final ProjectComponent[] components = getComponents(ProjectComponent.class); for (ProjectComponent component : components) { try { component.projectOpened(); } catch (Throwable e) { LOG.error(component.toString(),e); } } }
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; } }
private void projectOpened() { final ProjectComponent[] components = getComponents(ProjectComponent.class); for (ProjectComponent component : components) { try { component.projectOpened(); } catch (Throwable e) { LOG.error(component.toString(),e); } } }
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); } } }
public void projectOpened() { final ProjectComponent[] components = getComponents(ProjectComponent.class); for (ProjectComponent component : components) { try { component.projectOpened(); } catch (Throwable e) { LOG.error(component.toString(),e); } } }
@Override protected void tearDown() throws Exception { removeLibs(); ((ProjectComponent)ModuleManager.getInstance(myProject)).projectClosed(); super.tearDown(); }
@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"); } }
@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(); }
@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"); } }
@Override protected void tearDown() throws Exception { removeLibs(); ((ProjectComponent)ModuleManager.getInstance(myProject)).projectClosed(); super.tearDown(); }
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); }
关于Swing-未调用paintComponent方法和尚未调用beginbuild的介绍已经告一段落,感谢您的耐心阅读,如果想了解更多关于Angular 2:ngSwitch或ViewContainerRef.createComponent、com.intellij.openapi.components.ComponentConfig的实例源码、com.intellij.openapi.components.ProjectComponent的实例源码、com.intellij.openapi.ui.ComponentContainer的实例源码的相关信息,请在本站寻找。
本文标签: