/** * Adds textfield into placeholder panel and assigns a directly preceding label */ private void addField(JPanel panel, ReferenceEditorWithBrowseButton field) { panel.add(field, BorderLayout.CENTER); final Component[] components = panel.getParent().getComponents(); final int index = Arrays.asList(components).indexOf(panel); if(index > 0) { final Component component = components[index - 1]; if(component instanceof JLabel) { ((JLabel) component).setLabelFor(field); } } }
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); }
@Override protected EditorTextField getEditorTextField(@NotNull final TextPanel panel) { final Component component = panel.getComponent(0); if (component instanceof ReferenceEditorWithBrowseButton) { return ((ReferenceEditorWithBrowseButton)component).getEditorTextField(); } return (EditorTextField)component; }
/** * Adds textfield into placeholder panel and assigns a directly preceding label */ private void addField(JPanel panel, ReferenceEditorWithBrowseButton field) { panel.add(field, BorderLayout.CENTER); final Component[] components = panel.getParent().getComponents(); final int index = Arrays.asList(components).indexOf(panel); if (index > 0) { final Component component = components[index - 1]; if (component instanceof JLabel) { ((JLabel)component).setLabelFor(field); } } }
protected EditorTextField getEditorTextField(@NotNull final TextPanel panel) { final Component component = panel.getComponent(0); if (component instanceof ReferenceEditorWithBrowseButton) { return ((ReferenceEditorWithBrowseButton)component).getEditorTextField(); } return (EditorTextField)component; }
/** * Adds textfield into placeholder panel and assigns a directly preceding label */ private static void addField(JPanel panel, ReferenceEditorWithBrowseButton field) { panel.add(field, BorderLayout.CENTER); final Component[] components = panel.getParent().getComponents(); final int index = Arrays.asList(components).indexOf(panel); if (index > 0) { final Component component = components[index - 1]; if (component instanceof JLabel) { ((JLabel)component).setLabelFor(field); } } }
@Override protected EditorTextField getEditorTextField(@NotNull final TextPanel panel) { final Component component = panel.getComponent(0); if(component instanceof ReferenceEditorWithBrowseButton) { return ((ReferenceEditorWithBrowseButton) component).getEditorTextField(); } return (EditorTextField) component; }
protected EditorTextField getEditorTextField(@NotNull final PsiTypePanel component) { return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField(); }
protected EditorTextField getEditorTextField(@NotNull final PsiClassPanel component) { return ((ReferenceEditorWithBrowseButton)component.getComponent(0)).getEditorTextField(); }
private BrowseClassListener(Project project, ReferenceEditorWithBrowseButton annotationField) { myProject = project; myField = annotationField; }