public static DomFileEditor createDomFileEditor( final String name, @Nullable final Icon icon, final DomElement element, final Factory<? extends CommittablePanel> committablePanel) { final XmlFile file = DomUtil.getFile(element); final Factory<BasicDomElementComponent> factory = new Factory<BasicDomElementComponent>() { @Override public BasicDomElementComponent create() { CaptionComponent captionComponent = new CaptionComponent(name, icon); captionComponent.initErrorPanel(element); BasicDomElementComponent component = createComponentWithCaption(committablePanel.create(), captionComponent, element); Disposer.register(component, captionComponent); return component; } }; return new DomFileEditor<BasicDomElementComponent>( file.getProject(), file.getVirtualFile(), name, factory) { @Override public JComponent getPreferredFocusedComponent() { return null; } }; }
public DomFileEditor(final DomElement element, final String name, final T component) { this( element.getManager().getProject(), DomUtil.getFile(element).getVirtualFile(), name, component); }
protected boolean isRightFile(final VirtualFile file) { return myRootElement == null || (myRootElement.isValid() && file.equals(DomUtil.getFile(myRootElement).getVirtualFile())); }