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


Java SpeedSearchSupply.isPopupActive方法代码示例

本文整理汇总了Java中com.intellij.ui.speedSearch.SpeedSearchSupply.isPopupActive方法的典型用法代码示例。如果您正苦于以下问题:Java SpeedSearchSupply.isPopupActive方法的具体用法?Java SpeedSearchSupply.isPopupActive怎么用?Java SpeedSearchSupply.isPopupActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.speedSearch.SpeedSearchSupply的用法示例。


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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(() -> focusManager.setTypeaheadEnabled(true));
    }

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

    return true;
  }
  return false;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:53,代码来源:JBTable.java


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