private void createUIComponents() { final EditorTextField editorTextField = new LanguageTextField(PlainTextLanguage.INSTANCE, myProject, "") { @Override protected EditorEx createEditor() { final EditorEx editor = super.createEditor(); final PsiFile file = PsiDocumentManager.getInstance(myProject).getPsiFile(editor.getDocument()); if (file != null) { DaemonCodeAnalyzer.getInstance(myProject).setHighlightingEnabled(file, false); } editor.putUserData(ACTIVITY_CLASS_TEXT_FIELD_KEY, ApplicationRunParameters.this); return editor; } }; myActivityField = new ComponentWithBrowseButton<EditorTextField>(editorTextField, null); }
private void createUIComponents(Project project) { final EditorTextField editorTextField = new LanguageTextField(PlainTextLanguage.INSTANCE, project, "") { @Override protected EditorEx createEditor() { final EditorEx editor = super.createEditor(); final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (file != null) { DaemonCodeAnalyzer.getInstance(project).setHighlightingEnabled(file, false); } editor.putUserData( ACTIVITY_CLASS_TEXT_FIELD_KEY, BlazeAndroidBinaryRunConfigurationStateEditor.this); return editor; } }; activityField = new ComponentWithBrowseButton<EditorTextField>(editorTextField, null); }
@Nullable @Override protected JComponent createCustomPanel() { mySearchQueryField = new LanguageTextField(JqlLanguage.INSTANCE, myProject, myRepository.getSearchQuery()); enableJqlSearchIfSupported(); installListener(mySearchQueryField); mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT); myNoteLabel = new JBLabel(); myNoteLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL); updateNote(); return FormBuilder.createFormBuilder() .addLabeledComponent(mySearchLabel, mySearchQueryField) .addComponentToRightColumn(myNoteLabel) .getPanel(); }
@Nullable @Override protected JComponent createCustomPanel() { mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT); myDefaultSearch = new LanguageTextField(YouTrackLanguage.INSTANCE, myProject, myRepository.getDefaultSearch()); installListener(myDefaultSearch); return FormBuilder.createFormBuilder().addLabeledComponent(mySearchLabel, myDefaultSearch).getPanel(); }
private void createUIComponents() { myValuePattern = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getValuePattern(), new LanguageTextField.SimpleDocumentCreator() { public void customizePsiFile(PsiFile psiFile) { psiFile.putCopyableUserData(ValueRegExpAnnotator.KEY, Boolean.TRUE); } }); }
private void createUIComponents() { myLanguagePanel = new LanguagePanel(myProject, myOrigInjection); myTagPanel = new TagPanel(myProject, myOrigInjection); myAdvancedPanel = new AdvancedXmlPanel(myProject, myOrigInjection); myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getAttributeName()); myNamespace = new ComboBox(200); }
/** * Constructor. * * @param config Configuration for this UI to display. * @param project */ public ConfigUI(Config config, Project project) { super(new BorderLayout()); filterFieldName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldName()); filterFieldType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterFieldType()); filterMethodName = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodName()); filterMethodType = new LanguageTextField(RegExpLanguage.INSTANCE, project, config.getFilterMethodType()); init(); setConfig(config); }
@Nullable @Override protected JComponent createCustomPanel() { mySearchQueryField = new LanguageTextField(JqlLanguage.INSTANCE, myProject, myRepository.getSearchQuery()); installListener(mySearchQueryField); mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT); return FormBuilder.createFormBuilder().addLabeledComponent(mySearchLabel, mySearchQueryField).getPanel(); }
private void createUIComponents() { myLanguagePanel = new LanguagePanel(getProject(), getOrigInjection()); myTagPanel = new TagPanel(getProject(), getOrigInjection()); myAdvancedPanel = new AdvancedXmlPanel(getProject(), getOrigInjection()); myLocalName = new LanguageTextField(RegExpLanguageDelegate.RegExp.get(), getProject(), getOrigInjection().getAttributeName()); myNamespace = new ComboBox(200); }
protected JComponent createNorthPanel() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(4, 4, 4, 4); gbConstraints.weighty = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbPackage = new JRadioButton(RefactoringBundle.message("migration.entry.package")); panel.add(myRbPackage, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbClass = new JRadioButton(RefactoringBundle.message("migration.entry.class")); panel.add(myRbClass, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 1; panel.add(new JPanel(), gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbPackage); buttonGroup.add(myRbClass); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel oldNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.old.name")); panel.add(oldNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; final LanguageTextField.DocumentCreator documentCreator = new LanguageTextField.DocumentCreator() { @Override public Document createDocument(String value, @Nullable Language language, Project project) { PsiPackage defaultPackage = JavaPsiFacade.getInstance(project).findPackage(""); final JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(project).createReferenceCodeFragment("", defaultPackage, true, true); return PsiDocumentManager.getInstance(project).getDocument(fragment); } }; myOldNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.add(myOldNameField, gbConstraints); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel newNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.new.name")); panel.add(newNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; myNewNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.setPreferredSize(new Dimension(300, panel.getPreferredSize().height)); panel.add(myNewNameField, gbConstraints); final DocumentAdapter documentAdapter = new DocumentAdapter() { @Override public void documentChanged(DocumentEvent e) { validateOKButton(); } }; myOldNameField.getDocument().addDocumentListener(documentAdapter); myNewNameField.getDocument().addDocumentListener(documentAdapter); return panel; }
private void createUIComponents() { myLocalName = new LanguageTextField(RegExpLanguage.INSTANCE, myProject, myOrigInjection.getTagName()); myNamespace = new ComboBox(200); }
protected JComponent createNorthPanel() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = new Insets(4, 4, 4, 4); gbConstraints.weighty = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbPackage = new JRadioButton(RefactoringBundle.message("migration.entry.package")); panel.add(myRbPackage, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbClass = new JRadioButton(RefactoringBundle.message("migration.entry.class")); panel.add(myRbClass, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 1; panel.add(new JPanel(), gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbPackage); buttonGroup.add(myRbClass); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel oldNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.old.name")); panel.add(oldNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; final LanguageTextField.DocumentCreator documentCreator = new LanguageTextField.DocumentCreator() { @Override public Document createDocument(String value, @Nullable Language language, Project project) { PsiPackage defaultPackage = JavaPsiFacade.getInstance(project).findPackage(""); final JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(project).createReferenceCodeFragment("", defaultPackage, true, true); return PsiDocumentManager.getInstance(project).getDocument(fragment); } }; myOldNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.add(myOldNameField, gbConstraints); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel newNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.new.name")); panel.add(newNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; myNewNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.setPreferredSize(new Dimension(300, panel.getPreferredSize().height)); panel.add(myNewNameField, gbConstraints); final com.intellij.openapi.editor.event.DocumentAdapter documentAdapter = new com.intellij.openapi.editor.event.DocumentAdapter() { @Override public void documentChanged(com.intellij.openapi.editor.event.DocumentEvent e) { validateOKButton(); } }; myOldNameField.getDocument().addDocumentListener(documentAdapter); myNewNameField.getDocument().addDocumentListener(documentAdapter); return panel; }
private void createUIComponents() { myLocalName = new LanguageTextField(RegExpLanguageDelegate.RegExp.get(), getProject(), getOrigInjection().getTagName()); myNamespace = new ComboBox(200); }
@Override protected JComponent createNorthPanel() { JPanel panel = new JPanel(new GridBagLayout()); GridBagConstraints gbConstraints = new GridBagConstraints(); gbConstraints.insets = JBUI.insets(4); gbConstraints.weighty = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbPackage = new JRadioButton(RefactoringBundle.message("migration.entry.package")); panel.add(myRbPackage, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 0; myRbClass = new JRadioButton(RefactoringBundle.message("migration.entry.class")); panel.add(myRbClass, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.BOTH; gbConstraints.weightx = 1; panel.add(new JPanel(), gbConstraints); ButtonGroup buttonGroup = new ButtonGroup(); buttonGroup.add(myRbPackage); buttonGroup.add(myRbClass); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel oldNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.old.name")); panel.add(oldNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; final LanguageTextField.DocumentCreator documentCreator = new LanguageTextField.DocumentCreator() { @Override public Document createDocument(String value, @Nullable Language language, Project project) { PsiPackage defaultPackage = JavaPsiFacade.getInstance(project).findPackage(""); final JavaCodeFragment fragment = JavaCodeFragmentFactory.getInstance(project).createReferenceCodeFragment("", defaultPackage, true, true); return PsiDocumentManager.getInstance(project).getDocument(fragment); } }; myOldNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.add(myOldNameField, gbConstraints); gbConstraints.weightx = 0; gbConstraints.gridwidth = GridBagConstraints.RELATIVE; gbConstraints.fill = GridBagConstraints.NONE; JLabel newNamePrompt = new JLabel(RefactoringBundle.message("migration.entry.new.name")); panel.add(newNamePrompt, gbConstraints); gbConstraints.gridwidth = GridBagConstraints.REMAINDER; gbConstraints.fill = GridBagConstraints.HORIZONTAL; gbConstraints.weightx = 1; myNewNameField = new LanguageTextField(JavaLanguage.INSTANCE, myProject, "", documentCreator); panel.setPreferredSize(new Dimension(300, panel.getPreferredSize().height)); panel.add(myNewNameField, gbConstraints); final DocumentListener documentAdapter = new DocumentListener() { @Override public void documentChanged(DocumentEvent e) { validateOKButton(); } }; myOldNameField.getDocument().addDocumentListener(documentAdapter); myNewNameField.getDocument().addDocumentListener(documentAdapter); return panel; }