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

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

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

Table.getSelectionCount介绍

[英]Returns the number of selected items contained in the receiver.
[中]返回接收器中包含的选定项目数。

代码示例

代码示例来源:origin: caoxinyu/RedisClient

case Normal:
  btnAdd.setEnabled(true);
  if(table.getSelectionCount() > 0){
    btnDelete.setEnabled(true);
    btnWatch.setEnabled(true);

代码示例来源:origin: caoxinyu/RedisClient

@Override
  public void widgetSelected(SelectionEvent e) {
    if(table.getSelectionCount() > 0){
      String[] members = new String[table.getSelectionCount()];
      int i = 0;
      
      TableItem[] items = table.getSelection();
      for (TableItem item : items) {
        members[i++] = item.getText(1);
      }
      service.removeMembers(id, db, key, members);
      
      for (TableItem item : items) {
        item.dispose();
      }
      table.setSelection(-1);
      currentItem = null;
      btnDelete.setEnabled(false);
    }
  }
});

代码示例来源:origin: pentaho/pentaho-kettle

public void refreshGrid() {
 applyChangedValue();
 wTodo.removeAll();
 wKey.setText( "" );
 wMain.setText( "" );
 wValue.setText( "" );
 wSource.setText( "" );
 selectedLocale = wLocale.getSelectionCount() == 0 ? null : wLocale.getSelection()[0];
 selectedSourceFolder =
  wPackages.table.getSelectionCount() == 0 ? null : wPackages.table.getSelection()[0].getText( 1 );
 selectedMessagesPackage =
  wPackages.table.getSelectionCount() == 0 ? null : wPackages.table.getSelection()[0].getText( 2 );
 refreshPackages();
 // Only continue with a locale & a messages package, otherwise we won't
 // budge ;-)
 //
 if ( selectedLocale != null && selectedSourceFolder != null && selectedMessagesPackage != null ) {
  // Get the list of keys that need a translation...
  //
  java.util.List<KeyOccurrence> todo =
   getTodoList( selectedLocale, selectedMessagesPackage, selectedSourceFolder, false );
  String[] todoItems = new String[todo.size()];
  for ( int i = 0; i < todoItems.length; i++ ) {
   todoItems[i] = todo.get( i ).getKey();
  }
  wTodo.setItems( todoItems );
 }
}

代码示例来源:origin: caoxinyu/RedisClient

@Override
public void widgetSelected(SelectionEvent e) {
  if(table.getSelectionCount() > 0){
    switch(currentStatus){
    case Normal:

代码示例来源:origin: caoxinyu/RedisClient

protected void updateMenuServer(boolean isTable, Menu menu) {
  if (isTable && table.getSelectionCount() > 1) {
    menu.getItem(0).setEnabled(false);
    menu.getItem(1).setEnabled(true);
    menu.getItem(2).setEnabled(false);
    menu.getItem(4).setEnabled(false);
    menu.getItem(5).setEnabled(false);
    menu.getItem(6).setEnabled(false);
  } else {
    menu.getItem(0).setEnabled(true);
    menu.getItem(1).setEnabled(true);
    menu.getItem(2).setEnabled(true);
    menu.getItem(4).setEnabled(true);
    menu.getItem(5).setEnabled(true);
    menu.getItem(6).setEnabled(true);
  }
}

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

private void handleSelection() {
    if (ignoreTable.getSelectionCount() > 0) {
      removeButton.setEnabled(true);
    } else {
      removeButton.setEnabled(false);
    }
  }
}

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

private void handleSelection() {
    if (ignoreTable.getSelectionCount() > 0) {
      removeButton.setEnabled(true);
    } else {
      removeButton.setEnabled(false);
    }
  }
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

@Override
public void enableOK() {
 copyValuesFromGUI();
 okButton.setEnabled( (0 < nameSpacesUI.getSelectionCount()) &&
            (0 < matchingTypesUI.getSelectionCount()));
}

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

public void getName(AccessibleEvent e) {
    if (table.getSelectionCount() == 0) {
      e.result= Strings.removeMnemonicIndicator(JavaUIMessages.TypeSelectionComponent_label);
    }
  }
});

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

@Override
public void mouseDoubleClick(MouseEvent e) {
  int itemsSelectedCount = variableTable.getTable().getSelectionCount();
  if (itemsSelectedCount == 1 && canChangeSelection())
    editSelectedVariable();
}
@Override

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

@Override
  public void getName(AccessibleEvent e) {
    if (table.getSelectionCount() == 0) {
      e.result= Strings.removeMnemonicIndicator(JavaUIMessages.TypeSelectionComponent_label);
    }
  }
});

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

@Override
  public void getName(AccessibleEvent e) {
    if (table.getSelectionCount() == 0) {
      e.result= Strings.removeMnemonicIndicator(JavaUIMessages.TypeSelectionComponent_label);
    }
  }
});

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

private int getTableSelectionCount() {
  return getTable().getSelectionCount();
}

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

/**
 * Updates button enabled state, depending on the number of currently selected
 * variables in the table.
 */
private void updateEnabledState() {
  int itemsSelectedCount = variableTable.getTable().getSelectionCount();
  editButton.setEnabled(itemsSelectedCount == 1 && canChangeSelection());
  removeButton.setEnabled(itemsSelectedCount > 0 && canChangeSelection());
}

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

@Override
public void copyValuesFromGUI() {
 if (0 < matchingTypesUI.getSelectionCount()) {
  typeName = matchingTypesUI.getSelection()[0].getText();
 }
 if (0 < nameSpacesUI.getSelectionCount()) {
  nameSpaceName = nameSpacesUI.getSelection()[0].getText();
 }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.m2e.core.ui

public void widgetSelected(SelectionEvent e) {
  propertiesTable.remove(propertiesTable.getSelectionIndices());
  removeButton.setEnabled(propertiesTable.getSelectionCount() > 0);
  validate();
 }
});

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

@Override
public void copyValuesFromGUI() {
 selectedSofaNames = new String[table.getSelectionCount()];
 for (int i = 0, j = 0; i < table.getItemCount(); i++) {
  if (table.isSelected(i)) {
   selectedSofaNames[j++] = table.getItem(i).getText();
  }
 }
}

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

/**
   * Opens the currently selected link.
   */
  private void openSelectedLink() {
    if (fTable.getSelectionCount() < 1)
      return;
    
    TableItem selection= fTable.getSelection()[0];
    IHyperlink link= (IHyperlink)selection.getData();
    fManager.hideInformationControl();
    fManager.setCaret();
    link.open();
  }
}

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

@Override
  public void shellActivated(ShellEvent e) {
    if (viewer.getTable().getSelectionCount() == 0) {
      viewer.getTable().setSelection(0);
    }
    viewer.getTable().setFocus();
  }
});

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

@Override
  public void shellActivated(ShellEvent e) {
    if (viewer.getTable().getSelectionCount() == 0) {
      viewer.getTable().setSelection(0);
    }
    viewer.getTable().setFocus();
  }
});

相关文章

Table类方法