本文整理汇总了Java中com.intellij.ui.EditorTextFieldWithBrowseButton类的典型用法代码示例。如果您正苦于以下问题:Java EditorTextFieldWithBrowseButton类的具体用法?Java EditorTextFieldWithBrowseButton怎么用?Java EditorTextFieldWithBrowseButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EditorTextFieldWithBrowseButton类属于com.intellij.ui包,在下文中一共展示了EditorTextFieldWithBrowseButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUIComponents
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass) declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
}
}
return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
}
));
}
示例2: createUIComponents
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
return Visibility.VISIBLE;
}
}
return Visibility.NOT_VISIBLE;
}
}));
}
示例3: testEditJUnitConfiguration
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
public void testEditJUnitConfiguration() throws ConfigurationException {
if (PlatformTestUtil.COVERAGE_ENABLED_BUILD) return;
PsiClass testA = findTestA(getModule2());
JUnitConfiguration configuration = createConfiguration(testA);
JUnitConfigurable editor = new JUnitConfigurable(myProject);
try {
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
configurable.reset();
final EditorTextFieldWithBrowseButton component =
((LabeledComponent<EditorTextFieldWithBrowseButton>)editor.getTestLocation(JUnitConfigurationModel.CLASS)).getComponent();
assertEquals(testA.getQualifiedName(), component.getText());
PsiClass otherTest = findClass(getModule2(), "test2.Test2");
component.setText(otherTest.getQualifiedName());
configurable.apply();
assertEquals(otherTest.getName(), configuration.getName());
String specialName = "My name";
configuration.setName(specialName);
configuration.setNameChangedByUser(true);
configurable.reset();
component.setText(testA.getQualifiedName());
configurable.apply();
assertEquals(specialName, configuration.getName());
}
finally {
Disposer.dispose(editor);
}
}
示例4: TestRunParameters
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
TestRunParameters(Project project, ConfigurationModuleSelector moduleSelector) {
myProject = project;
myModuleSelector = moduleSelector;
myPackageComponent.setComponent(new EditorTextFieldWithBrowseButton(project, false));
bind(myPackageComponent, new MyPackageBrowser());
myClassComponent
.setComponent(new EditorTextFieldWithBrowseButton(project, true, new AndroidTestClassVisibilityChecker(moduleSelector)));
bind(myClassComponent,
new AndroidTestClassBrowser(project, moduleSelector, AndroidBundle.message("android.browse.test.class.dialog.title"), false));
myRunnerComponent.setComponent(new EditorTextFieldWithBrowseButton(project, true,
new AndroidInheritingClassVisibilityChecker(myProject, moduleSelector,
AndroidUtils.INSTRUMENTATION_RUNNER_BASE_CLASS)));
bind(myRunnerComponent, new AndroidInheritingClassBrowser(project, moduleSelector, AndroidUtils.INSTRUMENTATION_RUNNER_BASE_CLASS,
AndroidBundle.message("android.browse.instrumentation.class.dialog.title"), true
));
bind(myMethodComponent, new MyMethodBrowser());
addTestingType(TEST_ALL_IN_MODULE, myAllInModuleButton);
addTestingType(TEST_ALL_IN_PACKAGE, myAllInPackageButton);
addTestingType(TEST_CLASS, myClassButton);
addTestingType(TEST_METHOD, myTestMethodButton);
setAnchor(myPackageComponent.getLabel());
}
示例5: createUIComponents
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
/**
* Creates UI Components
*/
private void createUIComponents() {
myMainClass = new LabeledComponent<>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, (declaration, place) -> {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null || place.getParent() != null && myModuleSelector.findClass(((PsiClass)declaration).getQualifiedName()) != null) {
return JavaCodeFragment.VisibilityChecker.Visibility.VISIBLE;
}
}
return JavaCodeFragment.VisibilityChecker.Visibility.NOT_VISIBLE;
}));
}
示例6: createUIComponents
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
myMainClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
myMainClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
if (declaration instanceof PsiClass) {
final PsiClass aClass = (PsiClass)declaration;
if (ConfigurationUtil.MAIN_CLASS.value(aClass) && PsiMethodUtil.findMainMethod(aClass) != null) {
return Visibility.VISIBLE;
}
}
return Visibility.NOT_VISIBLE;
}
}));
}
示例7: testEditJUnitConfiguration
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
public void testEditJUnitConfiguration() throws ConfigurationException {
if (IdeaTestUtil.COVERAGE_ENABLED_BUILD) return;
PsiClass testA = findTestA(getModule2());
JUnitConfiguration configuration = createConfiguration(testA);
JUnitConfigurable editor = new JUnitConfigurable(myProject);
try {
Configurable configurable = new RunConfigurationConfigurableAdapter(editor, configuration);
configurable.reset();
final EditorTextFieldWithBrowseButton component =
((LabeledComponent<EditorTextFieldWithBrowseButton>)editor.getTestLocation(JUnitConfigurationModel.CLASS)).getComponent();
assertEquals(testA.getQualifiedName(), component.getText());
PsiClass otherTest = findClass(getModule2(), "test2.Test2");
component.setText(otherTest.getQualifiedName());
configurable.apply();
assertEquals(otherTest.getName(), configuration.getName());
String specialName = "My name";
configuration.setName(specialName);
configuration.setNameChangedByUser(true);
configurable.reset();
component.setText(testA.getQualifiedName());
configurable.apply();
assertEquals(specialName, configuration.getName());
}
finally {
Disposer.dispose(editor);
}
}
示例8: isClassInProductionSources
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private static <T extends ComboBox<?>> boolean isClassInProductionSources(T moduleComboBox, Function<T, Module> getSelectedModule, EditorTextFieldWithBrowseButton classSelector)
{
Module module = getSelectedModule.apply(moduleComboBox);
if(module == null)
{
return false;
}
return ObjectUtil.notNull(JavaParametersUtil.isClassInProductionSources(classSelector.getText(), module), Boolean.FALSE);
}
示例9: getMainClassField
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
public EditorTextFieldWithBrowseButton getMainClassField() {
return myMainClass.getComponent();
}
示例10: createClassTextField
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void createClassTextField() {
myClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
EditorTextFieldWithBrowseButton myClassBrowseTextField = new EditorTextFieldWithBrowseButton(project, true, JavaCodeFragment.VisibilityChecker.PROJECT_SCOPE_VISIBLE);
myClass.setComponent(myClassBrowseTextField);
}
示例11: createUIComponents
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
myPackage = new LabeledComponent<EditorTextFieldWithBrowseButton>();
myPackage.setComponent(new EditorTextFieldWithBrowseButton(myProject, false));
myClass = new LabeledComponent<EditorTextFieldWithBrowseButton>();
final TestClassBrowser classBrowser = new TestClassBrowser(myProject);
myClass.setComponent(new EditorTextFieldWithBrowseButton(myProject, true, new JavaCodeFragment.VisibilityChecker() {
@Override
public Visibility isDeclarationVisible(PsiElement declaration, PsiElement place) {
try {
if (declaration instanceof PsiClass && classBrowser.getFilter().isAccepted(((PsiClass)declaration))) {
return Visibility.VISIBLE;
}
}
catch (ClassBrowser.NoFilterException e) {
return Visibility.NOT_VISIBLE;
}
return Visibility.NOT_VISIBLE;
}
}));
myMethod = new LabeledComponent<EditorTextFieldWithBrowseButton>();
final EditorTextFieldWithBrowseButton textFieldWithBrowseButton = new EditorTextFieldWithBrowseButton(myProject, true,
JavaCodeFragment.VisibilityChecker.EVERYTHING_VISIBLE,
PlainTextLanguage.INSTANCE.getAssociatedFileType());
new TextFieldCompletionProvider() {
@Override
protected void addCompletionVariants(@NotNull String text, int offset, @NotNull String prefix, @NotNull CompletionResultSet result) {
final String className = getClassName();
if (className.trim().length() == 0) {
return;
}
final PsiClass testClass = getModuleSelector().findClass(className);
if (testClass == null) return;
final JUnitUtil.TestMethodFilter filter = new JUnitUtil.TestMethodFilter(testClass);
for (PsiMethod psiMethod : testClass.getAllMethods()) {
if (filter.value(psiMethod)) {
result.addElement(LookupElementBuilder.create(psiMethod.getName()));
}
}
}
}.apply(textFieldWithBrowseButton.getChildComponent());
myMethod.setComponent(textFieldWithBrowseButton);
}
示例12: getClassName
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private String getClassName() {
return ((LabeledComponent<EditorTextFieldWithBrowseButton>)getTestLocation(JUnitConfigurationModel.CLASS)).getComponent().getText();
}
示例13: setPackage
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
private void setPackage(final PsiPackage aPackage) {
if (aPackage == null) return;
((LabeledComponent<EditorTextFieldWithBrowseButton>)getTestLocation(JUnitConfigurationModel.ALL_IN_PACKAGE)).getComponent()
.setText(aPackage.getQualifiedName());
}
示例14: getMainClassField
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
public EditorTextFieldWithBrowseButton getMainClassField()
{
return myMainClassField;
}
示例15: SdkFromSourceRootDependencies
import com.intellij.ui.EditorTextFieldWithBrowseButton; //导入依赖的package包/类
public SdkFromSourceRootDependencies(T moduleComboBox, Function<T, Module> getSelectedModule, EditorTextFieldWithBrowseButton classSelector)
{
super(moduleComboBox, getSelectedModule, () -> isClassInProductionSources(moduleComboBox, getSelectedModule, classSelector));
myClassSelector = classSelector;
}