當前位置: 首頁>>代碼示例>>Java>>正文


Java SpeedSearchSupply類代碼示例

本文整理匯總了Java中com.intellij.ui.speedSearch.SpeedSearchSupply的典型用法代碼示例。如果您正苦於以下問題:Java SpeedSearchSupply類的具體用法?Java SpeedSearchSupply怎麽用?Java SpeedSearchSupply使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


SpeedSearchSupply類屬於com.intellij.ui.speedSearch包,在下文中一共展示了SpeedSearchSupply類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: enableSearch

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Nullable
@Override
public Runnable enableSearch(final String option) {
  return new Runnable() {
    @Override
    public void run() {
      ObjectUtils.assertNotNull(SpeedSearchSupply.getSupply(myTree, true)).findAndSelectElement(option);
    }
  };
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:11,代碼來源:RemoteServerListConfigurable.java

示例2: isSpeedSearchEditing

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
private static boolean isSpeedSearchEditing(KeyEvent e) {
  int keyCode = e.getKeyCode();
  if (keyCode == KeyEvent.VK_BACK_SPACE) {
    Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
    if (owner instanceof JComponent) {
      SpeedSearchSupply supply = SpeedSearchSupply.getSupply((JComponent)owner);
      return supply != null && supply.isPopupActive();
    }
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:IdeKeyEventDispatcher.java

示例3: getData

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Nullable
@Override
public Object getData(@NonNls String dataId) {
  if (SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY.is(dataId)) {
    return mySearchTextComponent.getText();
  }
  return myDataProviderDelegate != null ? myDataProviderDelegate.getData(dataId) : null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:SearchReplaceComponent.java

示例4: getInitialText

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
protected static Pair<String, Integer> getInitialText(boolean useEditorSelection, AnActionEvent e) {
  final String predefined = e.getData(PlatformDataKeys.PREDEFINED_TEXT);
  if (!StringUtil.isEmpty(predefined)) {
    return Pair.create(predefined, 0);
  }
  if (useEditorSelection) {
    final Editor editor = e.getData(CommonDataKeys.EDITOR);
    if (editor != null) {
      final String selectedText = editor.getSelectionModel().getSelectedText();
      if (selectedText != null && !selectedText.contains("\n")) {
        return Pair.create(selectedText, 0);
      }
    }
  }

  final String query = e.getData(SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY);
  if (!StringUtil.isEmpty(query)) {
    return Pair.create(query, 0);
  }

  final Component focusOwner = IdeFocusManager.getInstance(getEventProject(e)).getFocusOwner();
  if (focusOwner instanceof JComponent) {
    final SpeedSearchSupply supply = SpeedSearchSupply.getSupply((JComponent)focusOwner);
    if (supply != null) {
      return Pair.create(supply.getEnteredPrefix(), 0);
    }
  }

  if (myInAction != null) {
    final Pair<String, Integer> lastString = ourLastStrings.get(myInAction);
    if (lastString != null) {
      return lastString;
    }
  }

  return Pair.create("", 0);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:38,代碼來源:GotoActionBase.java

示例5: getData

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Override
@Nullable
public Object getData(@NonNls final String dataId) {
  if (SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY.is(dataId)) {
    return mySearchField.getText();
  }
  if (PlatformDataKeys.EDITOR_EVEN_IF_INACTIVE.is(dataId)) {
    return myEditor;
  }
  return null;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:12,代碼來源:EditorSearchComponent.java

示例6: getInitialText

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
protected static Pair<String, Integer> getInitialText(boolean useEditorSelection, AnActionEvent e) {
  final String predefined = e.getData(PlatformDataKeys.PREDEFINED_TEXT);
  if (!StringUtil.isEmpty(predefined)) {
    return Pair.create(predefined, 0);
  }
  if (useEditorSelection) {
    final Editor editor = e.getData(PlatformDataKeys.EDITOR);
    if (editor != null) {
      final String selectedText = editor.getSelectionModel().getSelectedText();
      if (selectedText != null && !selectedText.contains("\n")) {
        return Pair.create(selectedText, 0);
      }
    }
  }

  final String query = e.getData(SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY);
  if (!StringUtil.isEmpty(query)) {
    return Pair.create(query, 0);
  }

  final Component focusOwner = IdeFocusManager.getInstance(getEventProject(e)).getFocusOwner();
  if (focusOwner instanceof JComponent) {
    final SpeedSearchSupply supply = SpeedSearchSupply.getSupply((JComponent)focusOwner);
    if (supply != null) {
      return Pair.create(supply.getEnteredPrefix(), 0);
    }
  }

  if (myInAction != null) {
    final Pair<String, Integer> lastString = ourLastStrings.get(myInAction);
    if (lastString != null) {
      return lastString;
    }
  }

  return Pair.create("", 0);
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:38,代碼來源:GotoActionBase.java

示例7: getData

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Nullable
@Override
public Object getData(@Nonnull Key<?> dataId) {
  if (SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY == dataId) {
    return mySearchTextComponent.getText();
  }
  return myDataProviderDelegate != null ? myDataProviderDelegate.getData(dataId) : null;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:9,代碼來源:SearchReplaceComponent.java

示例8: getInitialText

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
protected static Pair<String, Integer> getInitialText(boolean useEditorSelection, AnActionEvent e) {
  final String predefined = e.getData(PlatformDataKeys.PREDEFINED_TEXT);
  if (!StringUtil.isEmpty(predefined)) {
    return Pair.create(predefined, 0);
  }
  if (useEditorSelection) {
    String selectedText = getInitialTextForNavigation(e.getData(CommonDataKeys.EDITOR));
    if (selectedText != null) return new Pair<>(selectedText, 0);
  }

  final String query = e.getData(SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY);
  if (!StringUtil.isEmpty(query)) {
    return Pair.create(query, 0);
  }

  final Component focusOwner = IdeFocusManager.getInstance(getEventProject(e)).getFocusOwner();
  if (focusOwner instanceof JComponent) {
    final SpeedSearchSupply supply = SpeedSearchSupply.getSupply((JComponent)focusOwner);
    if (supply != null) {
      return Pair.create(supply.getEnteredPrefix(), 0);
    }
  }

  if (myInAction != null) {
    final Pair<String, Integer> lastString = ourLastStrings.get(myInAction);
    if (lastString != null) {
      return lastString;
    }
  }

  return Pair.create("", 0);
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:33,代碼來源:GotoActionBase.java

示例9: isToggleEvent

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
private static boolean isToggleEvent(KeyEvent e, JComponent mainComponent) {
  return e.getKeyCode() == KeyEvent.VK_SPACE && SpeedSearchSupply.getSupply(mainComponent) == null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:CheckboxTreeHelper.java

示例10: editCellAt

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Override
public boolean editCellAt(final int row, final int column, final EventObject e) {
  if (cellEditor != null && !cellEditor.stopCellEditing()) {
    return false;
  }

  if (row < 0 || row >= getRowCount() || column < 0 || column >= getColumnCount()) {
    return false;
  }

  if (!isCellEditable(row, column)) {
    return false;
  }

  if (e instanceof KeyEvent) {
    // do not start editing in autoStartsEdit mode on Ctrl-Z and other non-typed events
    if (!UIUtil.isReallyTypedEvent((KeyEvent)e) || ((KeyEvent)e).getKeyChar() == KeyEvent.CHAR_UNDEFINED) return false;

    SpeedSearchSupply supply = SpeedSearchSupply.getSupply(this);
    if (supply != null && supply.isPopupActive()) {
      return false;
    }
  }

  final TableCellEditor editor = getCellEditor(row, column);
  if (editor != null && editor.isCellEditable(e)) {
    editorComp = prepareEditor(editor, row, column);
    //((JComponent)editorComp).setBorder(null);
    if (editorComp == null) {
      removeEditor();
      return false;
    }
    editorComp.setBounds(getCellRect(row, column, false));
    add(editorComp);
    editorComp.validate();

    if (surrendersFocusOnKeyStroke()) {
      // this replaces focus request in JTable.processKeyBinding
      final IdeFocusManager focusManager = IdeFocusManager.findInstanceByComponent(this);
      focusManager.setTypeaheadEnabled(false);
      focusManager.requestFocus(editorComp, true).doWhenProcessed(new Runnable() {
        @Override
        public void run() {
          focusManager.setTypeaheadEnabled(true);
        }
      });
    }

    setCellEditor(editor);
    setEditingRow(row);
    setEditingColumn(column);
    editor.addCellEditorListener(this);

    return true;
  }
  return false;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:58,代碼來源:JBTable.java

示例11: update

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
public void update(AnActionEvent event){
  String place = event.getPlace();
  Presentation presentation = event.getPresentation();
  if (ActionPlaces.PROJECT_VIEW_POPUP.equals(place) || ActionPlaces.COMMANDER_POPUP.equals(place))
    presentation.setText(IdeBundle.message("action.delete.ellipsis"));
  else
    presentation.setText(IdeBundle.message("action.delete"));
  DataContext dataContext = event.getDataContext();
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if (project == null) {
    presentation.setEnabled(false);
    return;
  }
  DeleteProvider provider = getDeleteProvider(dataContext);
  if (event.getInputEvent() instanceof KeyEvent) {
    KeyEvent keyEvent = (KeyEvent)event.getInputEvent();
    Object component = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
    if (component instanceof JTextComponent) provider = null; // Do not override text deletion
    if (keyEvent.getKeyCode() == KeyEvent.VK_BACK_SPACE) {
      // Do not override text deletion in speed search
      if (component instanceof JComponent) {
        SpeedSearchSupply searchSupply = SpeedSearchSupply.getSupply((JComponent)component);
        if (searchSupply != null) provider = null;
      }

      String activeSpeedSearchFilter = SpeedSearchSupply.SPEED_SEARCH_CURRENT_QUERY.getData(dataContext);
      if (!StringUtil.isEmpty(activeSpeedSearchFilter)) {
        provider = null;
      }
    }
  }
  if (provider instanceof TitledHandler) {
    presentation.setText(((TitledHandler)provider).getActionTitle());
  }
  final boolean canDelete = provider != null && provider.canDeleteElement(dataContext);
  if (ActionPlaces.isPopupPlace(event.getPlace())) {
    presentation.setVisible(canDelete);
  }
  else {
    presentation.setEnabled(canDelete);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:43,代碼來源:DeleteAction.java

示例12: filter

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
@Override
public void filter() {
  getPluginTable().putClientProperty(SpeedSearchSupply.SEARCH_QUERY_KEY, getFilter());
  pluginsModel.filter(getFilter().toLowerCase());
  TableUtil.ensureSelectionExists(getPluginTable());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:PluginManagerMain.java

示例13: selectGroup

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
public void selectGroup(String searchQuery) {
  ObjectUtils.assertNotNull(SpeedSearchSupply.getSupply(myTable, true)).findAndSelectElement(searchQuery);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:NotificationsConfigurablePanel.java

示例14: selectNode

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
void selectNode(@NotNull String searchQuery) {
  ObjectUtils.assertNotNull(SpeedSearchSupply.getSupply(myTree, true)).findAndSelectElement(searchQuery);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:4,代碼來源:TemplateListPanel.java

示例15: editCellAt

import com.intellij.ui.speedSearch.SpeedSearchSupply; //導入依賴的package包/類
public boolean editCellAt(final int row, final int column, final EventObject e) {
  if (cellEditor != null && !cellEditor.stopCellEditing()) {
    return false;
  }

  if (row < 0 || row >= getRowCount() || column < 0 || column >= getColumnCount()) {
    return false;
  }

  if (!isCellEditable(row, column)) {
    return false;
  }

  if (e instanceof KeyEvent && UIUtil.isReallyTypedEvent((KeyEvent)e)) {
    SpeedSearchSupply supply = SpeedSearchSupply.getSupply(this);
    if (supply != null && supply.isPopupActive()) {
      return false;
    }
  }

  if (myEditorRemover == null) {
    final KeyboardFocusManager keyboardFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
    myEditorRemover = new MyCellEditorRemover();
    //noinspection HardCodedStringLiteral
    keyboardFocusManager.addPropertyChangeListener("focusOwner", myEditorRemover);
    //noinspection HardCodedStringLiteral
    keyboardFocusManager.addPropertyChangeListener("permanentFocusOwner", myEditorRemover);
  }

  final TableCellEditor editor = getCellEditor(row, column);
  if (editor != null && editor.isCellEditable(e)) {
    editorComp = prepareEditor(editor, row, column);
    //((JComponent)editorComp).setBorder(null);
    if (editorComp == null) {
      removeEditor();
      return false;
    }
    editorComp.setBounds(getCellRect(row, column, false));
    add(editorComp);
    editorComp.validate();

    IdeFocusManager.findInstanceByComponent(this).requestFocus(editorComp, false);

    setCellEditor(editor);
    setEditingRow(row);
    setEditingColumn(column);
    editor.addCellEditorListener(this);
    if (isTypeAhead) {
      JTableCellEditorHelper.typeAhead(this, e, row, column);
    }
    return true;
  }
  return false;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:55,代碼來源:JBTable.java


注:本文中的com.intellij.ui.speedSearch.SpeedSearchSupply類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。