org.eclipse.swt.widgets.Table.isFocusControl()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.eclipse.swt.widgets.Table.isFocusControl()方法的一些代码示例,展示了Table.isFocusControl()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.isFocusControl()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.Table
类名称:Table
方法名:isFocusControl

Table.isFocusControl介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
 *Returns whether the context selector has the focus.
 *
 * @return <code>true</code> if teh context selector has the focus
 */
public boolean hasFocus() {
  if (Helper2.okToUse(fContextSelectorShell))
    return (fContextSelectorShell.isFocusControl() || fContextSelectorTable.isFocusControl());
  return false;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

/**
 * Returns whether this popup has the focus.
 *
 * @return <code>true</code> if the popup has the focus
 */
public boolean hasFocus() {
  if (Helper2.okToUse(fProposalShell))
    return (fProposalShell.isFocusControl() || fProposalTable.isFocusControl());
  return false;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 * Returns whether this popup has the focus.
 *
 * @return <code>true</code> if the popup has the focus
 */
public boolean hasFocus() {
  if (Helper2.okToUse(fProposalShell))
    return (fProposalShell.isFocusControl() || fProposalTable.isFocusControl());
  return false;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
  public void run() {
    if (Helper.okToUse(fTable) && !fTable.isFocusControl() && !fScrollbarClicked && fContentAssistant != null)
      fContentAssistant.popupFocusLost(e);
  }
});

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

/**
 *Returns whether the context selector has the focus.
 *
 * @return <code>true</code> if teh context selector has the focus
 */
public boolean hasFocus() {
  if (Helper2.okToUse(fContextSelectorShell))
    return (fContextSelectorShell.isFocusControl() || fContextSelectorTable.isFocusControl());
  return false;
}

代码示例来源:origin: org.eclipse.egit/ui

public ShowInContext getShowInContext() {
  if (stagedTableViewer != null && stagedTableViewer.getTable().isFocusControl())
    return getShowInContext(stagedTableViewer);
  else if (unstagedTableViewer != null && unstagedTableViewer.getTable().isFocusControl())
    return getShowInContext(unstagedTableViewer);
  else
    return null;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void focusLost(final FocusEvent e) {
  fScrollbarClicked= false;
  Display d= fTable.getDisplay();
  d.asyncExec(() -> {
    if (Helper.okToUse(fTable) && !fTable.isFocusControl() && !fScrollbarClicked && fContentAssistant != null)
      fContentAssistant.popupFocusLost(e);
  });
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void focusLost(final FocusEvent e) {
  fScrollbarClicked= false;
  Display d= fTable.getDisplay();
  d.asyncExec(() -> {
    if (Helper2.okToUse(fTable) && !fTable.isFocusControl() && !fScrollbarClicked && fContentAssistant != null)
      fContentAssistant.popupFocusLost(e);
  });
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

private boolean hasFocus() {
  if (!isValid()) {
    return false;
  }
  if (getShell().isFocusControl() || proposalTable.isFocusControl()) {
    return true;
  }
  if (infoPopup != null && infoPopup.hasFocus()) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

private boolean hasFocus() {
  if (!isValid()) {
    return false;
  }
  if (getShell().isFocusControl() || proposalTable.isFocusControl()) {
    return true;
  }
  if (infoPopup != null && infoPopup.hasFocus()) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.eclipse.egit/ui

@Override
public boolean isEnabled() {
  if (!unstagedTableViewer.getTable().isFocusControl())
    return false;
  IStructuredSelection selection = getSelection();
  if (selection.isEmpty())
    return false;
  for (Object element : selection.toList()) {
    StagingEntry entry = (StagingEntry) element;
    if (!entry.getAvailableActions().contains(StagingEntry.Action.DELETE))
      return false;
  }
  return true;
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

private boolean hasFocus() {
  if (!isValid()) {
    return false;
  }
  if (getShell().isFocusControl() || proposalTable.isFocusControl()) {
    return true;
  }
  if (infoPopup != null && infoPopup.hasFocus()) {
    return true;
  }
  return false;
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

public void mouseDown(MouseEvent e)
{
 // refresh table
 internalRefresh();
 // Clean up previous text editor control
 internalDispose();
 // update table
 if (table_.isFocusControl())
 {
  int selectedRowIndex = getSelectedRow(table_, e.y);
  if (currSelectionIndex_ != -1 && selectedRowIndex != -1 && currSelectionIndex_ == selectedRowIndex)
  {
   TableItem tableItem = table_.getItem(selectedRowIndex);
   int selectedColumnIndex = getSelectedColumn(tableItem, e.x, e.y);
   if (selectedColumnIndex != -1 && (text_ == null || text_.isDisposed() || selectedColumnIndex != editor_.getColumn()))
    editSelection(selectedRowIndex, selectedColumnIndex);
  }
  currSelectionIndex_ = selectedRowIndex;
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.ws.consumption.ui

public void mouseDown(MouseEvent e)
{
 // refresh table
 internalRefresh();
 // Clean up previous text editor control
 internalDispose();
 // update table
 if (table_.isFocusControl())
 {
  int selectedRowIndex = getSelectedRow(table_, e.y);
  if (currSelectionIndex_ != -1 && selectedRowIndex != -1 && currSelectionIndex_ == selectedRowIndex)
  {
   TableItem tableItem = table_.getItem(selectedRowIndex);
   int selectedColumnIndex = getSelectedColumn(tableItem, e.x, e.y);
   if (selectedColumnIndex != -1 && (text_ == null || text_.isDisposed() || selectedColumnIndex != editor_.getColumn()))
    editSelection(selectedRowIndex, selectedColumnIndex);
  }
  currSelectionIndex_ = selectedRowIndex;
 }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench

/**
 * Checks if the text or shell has focus. If not, closes the shell.
 *
 * @param table
 *            the shell's table
 * @param text
 *            the search text field
 */
protected void checkFocusLost(final Table table, final Text text) {
  if (!shell.isDisposed() && !table.isDisposed() && !text.isDisposed()) {
    if (table.getDisplay().getActiveShell() == table.getShell()) {
      // If the user selects the trim shell, leave focus on the text
      // so shell stays open
      text.setFocus();
      return;
    }
    if (!shell.isFocusControl() && !table.isFocusControl()
        && !text.isFocusControl()) {
      quickAccessContents.doClose();
    }
  }
}

相关文章

微信公众号

最新文章

更多

Table类方法