com.intellij.ui.TextFieldWithStoredHistory Java Examples

The following examples show how to use com.intellij.ui.TextFieldWithStoredHistory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GenerateFromBuildFileSelectProjectViewOption.java    From intellij with Apache License 2.0 6 votes vote down vote up
public GenerateFromBuildFileSelectProjectViewOption(BlazeNewProjectBuilder builder) {
  this.builder = builder;
  this.userSettings = builder.getUserSettings();

  this.buildFilePathField = new TextFieldWithStoredHistory(LAST_WORKSPACE_PATH);
  buildFilePathField.setName("build-file-path-field");
  buildFilePathField.setHistorySize(BlazeNewProjectBuilder.HISTORY_SIZE);
  buildFilePathField.setText(userSettings.get(LAST_WORKSPACE_PATH, ""));
  buildFilePathField.setMinimumAndPreferredWidth(MINIMUM_FIELD_WIDTH);

  JButton button = new JButton("...");
  button.addActionListener(action -> chooseWorkspacePath());
  int buttonSize = buildFilePathField.getPreferredSize().height;
  button.setPreferredSize(new Dimension(buttonSize, buttonSize));

  JComponent box =
      UiUtil.createHorizontalBox(
          HORIZONTAL_LAYOUT_GAP, new JLabel("BUILD file:"), buildFilePathField, button);
  UiUtil.setPreferredWidth(box, PREFERRED_COMPONENT_WIDTH);
  this.component = box;
}
 
Example #2
Source File: ImportFromWorkspaceProjectViewOption.java    From intellij with Apache License 2.0 6 votes vote down vote up
public ImportFromWorkspaceProjectViewOption(BlazeNewProjectBuilder builder) {
  this.builder = builder;
  this.userSettings = builder.getUserSettings();

  this.projectViewPathField = new TextFieldWithStoredHistory(LAST_WORKSPACE_PATH);
  projectViewPathField.setName("projectview-file-path-field");
  projectViewPathField.setHistorySize(BlazeNewProjectBuilder.HISTORY_SIZE);
  projectViewPathField.setText(userSettings.get(LAST_WORKSPACE_PATH, ""));
  projectViewPathField.setMinimumAndPreferredWidth(MINIMUM_FIELD_WIDTH);

  JButton button = new JButton("...");
  button.addActionListener(action -> chooseWorkspacePath());
  int buttonSize = projectViewPathField.getPreferredSize().height;
  button.setPreferredSize(new Dimension(buttonSize, buttonSize));

  JComponent box =
      UiUtil.createHorizontalBox(
          HORIZONTAL_LAYOUT_GAP, new JLabel("Project view:"), projectViewPathField, button);
  UiUtil.setPreferredWidth(box, PREFERRED_COMPONENT_WIDTH);
  this.component = box;
}
 
Example #3
Source File: CopyExternalProjectViewOption.java    From intellij with Apache License 2.0 6 votes vote down vote up
public CopyExternalProjectViewOption(BlazeNewProjectBuilder builder) {
  this.userSettings = builder.getUserSettings();

  this.projectViewPathField = new TextFieldWithStoredHistory(LAST_WORKSPACE_PATH);
  projectViewPathField.setHistorySize(BlazeNewProjectBuilder.HISTORY_SIZE);
  projectViewPathField.setText(userSettings.get(LAST_WORKSPACE_PATH, ""));
  projectViewPathField.setMinimumAndPreferredWidth(MINIMUM_FIELD_WIDTH);

  JButton button = new JButton("...");
  button.addActionListener(action -> chooseWorkspacePath());
  int buttonSize = projectViewPathField.getPreferredSize().height;
  button.setPreferredSize(new Dimension(buttonSize, buttonSize));

  JComponent box =
      UiUtil.createHorizontalBox(
          HORIZONTAL_LAYOUT_GAP, new JLabel("Project view:"), projectViewPathField, button);
  UiUtil.setPreferredWidth(box, PREFERRED_COMPONENT_WIDTH);
  this.component = box;
}
 
Example #4
Source File: ServerSelection.java    From intellij-spring-assistant with MIT License 5 votes vote down vote up
private void createUIComponents() {
  defaultHyperLink = new HyperlinkLabel(SPRING_IO_DEFAULT_INITIALIZR_SERVER_URL);
  defaultHyperLink.setHyperlinkTarget(SPRING_IO_DEFAULT_INITIALIZR_SERVER_URL);

  dataflowHyperLink = new HyperlinkLabel(SPRING_IO_DATAFLOW_INITIALIZR_SERVER_URL);
  dataflowHyperLink.setHyperlinkTarget(SPRING_IO_DATAFLOW_INITIALIZR_SERVER_URL);

  customTextFieldWithHistory =
      new TextFieldWithStoredHistory("spring.assistant.initializr.custom.server.url.history");
}
 
Example #5
Source File: FileSelectorWithStoredHistory.java    From intellij with Apache License 2.0 5 votes vote down vote up
private FileSelectorWithStoredHistory(TextFieldWithStoredHistory textField, String title) {
  super(textField, null);

  addBrowseFolderListener(
      title,
      "",
      null,
      BrowseFilesListener.SINGLE_FILE_DESCRIPTOR,
      TextComponentAccessor.TEXT_FIELD_WITH_STORED_HISTORY_WHOLE_TEXT);
}
 
Example #6
Source File: PrePostReviewForm.java    From reviewboard-plugin-for-idea with MIT License 5 votes vote down vote up
private void createUIComponents() {
        peopleTextField = new TextFieldWithStoredHistory("rb.people");

//        peopleTextField.addKeyboardListener(new KeyAdapter() {
//            @Override
//            public void keyTyped(KeyEvent e) {
//                System.out.println(e);
//                if (e.getKeyCode() == KeyEvent.VK_DELETE) {
//                    peopleTextField.setSelectedIndex(-1);
////                    peopleTextField
//                }
//            }
//        });
        groupTextField = new TextFieldWithStoredHistory("rb.group");
    }
 
Example #7
Source File: FileSelectorWithStoredHistory.java    From intellij with Apache License 2.0 4 votes vote down vote up
public static FileSelectorWithStoredHistory create(String historyKey, String title) {
  TextFieldWithStoredHistory textField = new TextFieldWithStoredHistory(historyKey);
  return new FileSelectorWithStoredHistory(textField, title);
}
 
Example #8
Source File: TextComponentAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
public String getText(TextFieldWithStoredHistory textField) {
  return textField.getText();
}
 
Example #9
Source File: TextComponentAccessor.java    From consulo with Apache License 2.0 4 votes vote down vote up
public void setText(TextFieldWithStoredHistory textField, String text) {
  textField.setText(text);
}
 
Example #10
Source File: CppRemoteDebugSettingEditor.java    From CppTools with Apache License 2.0 4 votes vote down vote up
private void createUIComponents() {
  myHost = new TextFieldWithStoredHistory("cpp.remote.debug.host");
  myPort = new TextFieldWithStoredHistory("cpp.remote.debug.port");
  myPid = new TextFieldWithStoredHistory("cpp.remote.debug.pid");
}