private void setupPathComponent(final JPanel northPanel) { northPanel.add(new TextFieldAction() { @Override public void linkSelected(LinkLabel aSource, Object aLinkData) { toggleShowPathComponent(northPanel, this); } }, BorderLayout.EAST); myPathEditor = new EditorTextField(JavaReferenceEditorUtil.createDocument("", myProject, false), myProject, StdFileTypes.JAVA); myPathEditor.addDocumentListener(new DocumentAdapter() { @Override public void documentChanged(DocumentEvent e) { myAlarm.cancelAllRequests(); myAlarm.addRequest(new Runnable() { @Override public void run() { updateTreeFromPath(); } }, 300); } }); myPathEditor.setBorder(BorderFactory.createEmptyBorder(0, 0, 2, 0)); northPanel.add(myPathEditor, BorderLayout.SOUTH); }
protected PsiTypePanel createMainComponent(PsiTypePanel boundedComponent, final Project project) { if (boundedComponent == null) { boundedComponent = new PsiTypePanel(); } return PsiClassControl.initReferenceEditorWithBrowseButton(boundedComponent, new ReferenceEditorWithBrowseButton(null, project, new Function<String, Document>() { public Document fun(final String s) { return JavaReferenceEditorUtil.createTypeDocument(s, project); } }, ""), this); }
ReplaceConstructorWithFactoryDialog(Project project, PsiMethod constructor, PsiClass containingClass) { super(project, true); myContainingClass = containingClass; myConstructor = constructor; myIsInner = myContainingClass.getContainingClass() != null && !myContainingClass.hasModifierProperty(PsiModifier.STATIC); setTitle(ReplaceConstructorWithFactoryHandler.REFACTORING_NAME); myTfTargetClassName = JavaReferenceEditorUtil.createReferenceEditorWithBrowseButton(new ChooseClassAction(), "", project, true); init(); }
public static Document createDocument(final String s, final Project project) { if (ApplicationManager.getApplication().isUnitTestMode() || project.isDefault()) { return new DocumentImpl(s); } else { return JavaReferenceEditorUtil.createTypeDocument(s, project); } }
@RequiredReadAction public static Document createDocument(final String s, final Project project) { if (ApplicationManager.getApplication().isUnitTestMode() || project.isDefault()) { return new DocumentImpl(s); } else { return JavaReferenceEditorUtil.createTypeDocument(s, project); } }