当前位置: 首页>>代码示例>>Java>>正文


Java ComponentWithBrowseButton类代码示例

本文整理汇总了Java中com.intellij.openapi.ui.ComponentWithBrowseButton的典型用法代码示例。如果您正苦于以下问题:Java ComponentWithBrowseButton类的具体用法?Java ComponentWithBrowseButton怎么用?Java ComponentWithBrowseButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ComponentWithBrowseButton类属于com.intellij.openapi.ui包,在下文中一共展示了ComponentWithBrowseButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUIComponents

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ApplicationRunParameters.java

示例2: createUIComponents

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
  mavenHomeField = new TextFieldWithHistory();
  mavenHomeField.setHistorySize(-1);
  final ArrayList<String> foundMavenHomes = new ArrayList<String>();
  foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_2);
  foundMavenHomes.add(MavenServerManager.BUNDLED_MAVEN_3);
  final File mavenHomeDirectory = MavenUtil.resolveMavenHomeDirectory(null);
  if (mavenHomeDirectory != null) {
    foundMavenHomes.add(FileUtil.toSystemIndependentName(mavenHomeDirectory.getPath()));
  }
  mavenHomeField.setHistory(foundMavenHomes);
  mavenHomeComponent = LabeledComponent.create(
    new ComponentWithBrowseButton<TextFieldWithHistory>(mavenHomeField, null), "Maven &amp;home directory");

  final JBLabel versionLabel = new JBLabel();
  versionLabel.setOpaque(true);
  versionLabel.setVerticalAlignment(SwingConstants.TOP);
  versionLabel.setVerticalTextPosition(SwingConstants.TOP);
  mavenVersionLabelComponent = LabeledComponent.create(versionLabel, "");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:MavenEnvironmentForm.java

示例3: MyEditor

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public MyEditor(final Project project) {
  myProject = project;
  myEditorTextField = new EditorTextField("", project, StdFileTypes.JAVA) {
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  myActionListener = new MyActionListener();
  myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
  myEditorTextField.setBorder(null);
  new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
  /*
  myEditorTextField.addActionListener(
    new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        fireValueCommitted();
      }
    }
  );
  */
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ClassToBindProperty.java

示例4: createUIComponents

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
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);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:20,代码来源:BlazeAndroidBinaryRunConfigurationStateEditor.java

示例5: fixButton

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void fixButton(final TextFieldWithStoredHistory historyField, ComponentWithBrowseButton<TextFieldWithStoredHistory> control) {
    FixedSizeButton button = control.getButton();
    control.remove(button);
    BorderLayout borderLayout = new BorderLayout();
    JPanel buttonPanel = new JPanel(borderLayout);
    buttonPanel.setBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0));
    buttonPanel.add(button, BorderLayout.CENTER);
    control.add(buttonPanel, BorderLayout.EAST);
    button.setAttachedComponent(new JComponent() {
        public Dimension getPreferredSize() {
            Dimension size = historyField.getTextEditor().getPreferredSize();
            return new Dimension(-1, size.height + 6);
        }

    });
}
 
开发者ID:jflex-de,项目名称:idea-jflex,代码行数:17,代码来源:JFlexSettingsForm.java

示例6: setupScriptPathField

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void setupScriptPathField(@NotNull final Project project) {
  final ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
    new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(
      "Select Script",
      "",
      myScriptPathField,
      project,
      FileChooserDescriptorFactory.createSingleFileDescriptor(TheRFileType.INSTANCE),
      TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT
    ) {
      @Override
      protected void onFileChosen(@NotNull final VirtualFile chosenFile) {
        super.onFileChosen(chosenFile);

        TheRRunConfigurationUtils.setSuggestedWorkingDirectoryPathIfNotSpecified(TheRRunConfigurationForm.this);
      }
    };

  myScriptPathField.addActionListener(listener);
}
 
开发者ID:ktisha,项目名称:TheRPlugin,代码行数:21,代码来源:TheRRunConfigurationForm.java

示例7: MyEditor

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public MyEditor(final Project project) {
  myProject = project;
  myEditorTextField = new EditorTextField("", project, JavaFileType.INSTANCE) {
    protected boolean shouldHaveBorder() {
      return false;
    }
  };
  myActionListener = new MyActionListener();
  myTfWithButton = new ComponentWithBrowseButton<EditorTextField>(myEditorTextField, myActionListener);
  myEditorTextField.setBorder(null);
  new MyCancelEditingAction().registerCustomShortcutSet(CommonShortcuts.ESCAPE, myTfWithButton);
  /*
  myEditorTextField.addActionListener(
    new ActionListener() {
      public void actionPerformed(final ActionEvent e) {
        fireValueCommitted();
      }
    }
  );
  */
}
 
开发者ID:consulo,项目名称:consulo-ui-designer,代码行数:22,代码来源:ClassToBindProperty.java

示例8: createPackageNameField

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
protected ComponentWithBrowseButton<EditorComboBox> createPackageNameField() {
  String name = "";
  PsiFile file = mySourceClass.getContainingFile();
  if (file instanceof PsiJavaFile) {
    name = ((PsiJavaFile)file).getPackageName();
  }
  return new PackageNameReferenceEditorCombo(name, myProject, DESTINATION_PACKAGE_RECENT_KEY,
                                                           RefactoringBundle.message("choose.destination.package"));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaExtractSuperBaseDialog.java

示例9: createUIComponents

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void createUIComponents() {
  regexp = createRegexComponent();
  regexprForExprType = createRegexComponent();
  formalArgType = createRegexComponent();
  customScriptCode = new ComponentWithBrowseButton<EditorTextField>(createScriptComponent(), null);

  myRegExHelpLabel = RegExHelpPopup.createRegExLink(SSRBundle.message("regular.expression.help.label"), regexp, LOG);
  myRegExHelpLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:EditVarConstraintsDialog.java

示例10: PythonRunConfigurationForm

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public PythonRunConfigurationForm(PythonRunConfiguration configuration) {
  myCommonOptionsForm = PyCommonOptionsFormFactory.getInstance().createForm(configuration.getCommonOptionsFormData());
  myCommonOptionsPlaceholder.add(myCommonOptionsForm.getMainPanel(), BorderLayout.CENTER);

  myProject = configuration.getProject();

  FileChooserDescriptor chooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
    @Override
    public boolean isFileVisible(VirtualFile file, boolean showHiddenFiles) {
      return file.isDirectory() || file.getExtension() == null || Comparing.equal(file.getExtension(), "py");
    }
  };
  //chooserDescriptor.setRoot(s.getProject().getBaseDir());

  ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
    new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>("Select Script", "", myScriptTextField, myProject,
                                                                         chooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {

      @Override
      protected void onFileChosen(@NotNull VirtualFile chosenFile) {
        super.onFileChosen(chosenFile);
        myCommonOptionsForm.setWorkingDirectory(chosenFile.getParent().getPath());
      }
    };

  myScriptTextField.addActionListener(listener);

  setAnchor(myCommonOptionsForm.getAnchor());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PythonRunConfigurationForm.java

示例11: AppEngineSdkEditor

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public AppEngineSdkEditor(final @Nullable Project project) {
  myPathEditor = new ComboboxWithBrowseButton(new ComboBox(100));
  myPathEditor.addBrowseFolderListener(project, new ComponentWithBrowseButton.BrowseFolderActionListener<JComboBox>("Google App Engine SDK",
                                   "Specify Google App Engine Java SDK home",
                                   myPathEditor, project,
                                   FileChooserDescriptorFactory.createSingleFolderDescriptor(),
                                   TextComponentAccessor.STRING_COMBOBOX_WHOLE_TEXT));
  final JComboBox comboBox = myPathEditor.getComboBox();
  comboBox.setEditable(true);
  comboBox.removeAllItems();
  for (AppEngineSdk sdk : AppEngineSdkManager.getInstance().getValidSdks()) {
    comboBox.addItem(FileUtil.toSystemDependentName(sdk.getSdkHomePath()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:AppEngineSdkEditor.java

示例12: propagateToolTip

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void propagateToolTip(JComponent source, JComponent ... targets) {
    String toolTip = source.getToolTipText();
    for(JComponent target: targets) {
        if(target instanceof ComponentWithBrowseButton) {
            ((ComponentWithBrowseButton) target).getChildComponent().setToolTipText(toolTip);
        } else {
            target.setToolTipText(toolTip);
        }
    }
}
 
开发者ID:headwirecom,项目名称:aem-ide-tooling-4-intellij,代码行数:11,代码来源:AemdcConfigurationDialog.java

示例13: LocalAndServerPathsForm

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public LocalAndServerPathsForm() {
  Disposer.register(this, myServerPathForm);

  myServerPathForm.addListener(new TfsTreeForm.SelectionListener() {
    @Override
    public void selectionChanged() {
      myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
    }
  });

  myLocalPathLabel.setLabelFor(myLocalPathField.getChildComponent());
  myLocalPathField.getChildComponent().getDocument().addDocumentListener(new DocumentAdapter() {
    protected void textChanged(final DocumentEvent e) {
      myEventDispatcher.getMulticaster().stateChanged(new ChangeEvent(this));
    }
  });

  FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  ComponentWithBrowseButton.BrowseFolderActionListener<JTextField> listener =
    new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(TFSBundle.message("choose.local.path.title"),
                                                                         TFSBundle.message("choose.local.path.description"),
                                                                         myLocalPathField, null, descriptor,
                                                                         TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);

  myServerPathLabel.setLabelFor(myServerPathForm.getPreferredFocusedComponent());
  myLocalPathField.addActionListener(listener);
  myMessageLabel.setIcon(UIUtil.getBalloonWarningIcon());
}
 
开发者ID:Microsoft,项目名称:vso-intellij,代码行数:29,代码来源:LocalAndServerPathsForm.java

示例14: initComponents

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
private void initComponents() {
  FileChooserDescriptor fcd = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fcd.setShowFileSystemRoots(true);
  fcd.setTitle(GctBundle.message("clonefromgcp.destination.directory.title"));
  fcd.setDescription(GctBundle.message("clonefromgcp.destination.directory.description"));
  fcd.setHideIgnored(false);
  parentDirectory.addActionListener(
      new ComponentWithBrowseButton.BrowseFolderActionListener<JTextField>(
          fcd.getTitle(),
          fcd.getDescription(),
          parentDirectory,
          project,
          fcd,
          TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT) {
        @Override
        protected VirtualFile getInitialFile() {
          String text = getComponentText();
          if (text.length() == 0) {
            VirtualFile file = project.getBaseDir();
            if (file != null) {
              return file;
            }
          }
          return super.getInitialFile();
        }
      });

  final DocumentListener updateOkButtonListener =
      new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent event) {
          updateButtons();
        }
      };
  parentDirectory.getChildComponent().getDocument().addDocumentListener(updateOkButtonListener);
  parentDirectory.setText(ProjectUtil.getBaseDir());
  directoryName.getDocument().addDocumentListener(updateOkButtonListener);

  setOKActionEnabled(false);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:41,代码来源:CloneCloudRepositoryDialog.java

示例15: ImageFileBrowserFolderActionListener

import com.intellij.openapi.ui.ComponentWithBrowseButton; //导入依赖的package包/类
public ImageFileBrowserFolderActionListener(String title,
                                            Project project,
                                            ComponentWithBrowseButton<JTextField> componentWithBrowseButton,
                                            FileChooserDescriptor fileChooserDescriptor) {
    super(title, null, componentWithBrowseButton, project, fileChooserDescriptor, TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
    this.title = title;
    this.project = project;
}
 
开发者ID:sayedyousef,项目名称:plgin,代码行数:9,代码来源:ImageFileBrowserFolderActionListener.java


注:本文中的com.intellij.openapi.ui.ComponentWithBrowseButton类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。